Skip to content

undefined method 'enum' when migrating #49

@unikitty37

Description

@unikitty37

I've just installed enumerated_attribute (using rails 3.2.1) by the standard method of adding it to the Gemfile and running bundle. I have the following migration

class AddReadableByToArticle < ActiveRecord::Migration
  def change
    change_table :articles do |t|
      t.enum :readable_by
    end
  end
end

and the following as models/article.rb:

class Article < ActiveRecord::Base
  enum_attr :readable_by, %w(^draft branch members public)

According to the README, this should work, no?

But I get undefined methodenum' for #ActiveRecord::ConnectionAdapters::Table:0x007fbc533e87f0` when I try to migrate.

Are the docs out of date? I notice that the README still refers to using rake gems:install to install the gem, so I'm wondering if the docs no longer reflect reality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions