electronick / enum_column

Enum column support for Rails 3
MIT License
75 stars 45 forks source link

enum_select error #8

Closed emkman closed 12 years ago

emkman commented 12 years ago

I added enum_column3 to my gemfile for a rails 3.01 project, installed it with bundler, and created and ran a migration. I confirmed in the rails console that the column was created as expected. Here is the error output:

undefined local variable or method `enum' for #ActionView::Helpers::InstanceTag:0x29e7f94 Extracted source (around line #24):

21:

22:
23: <%= f.label :subject %>
24: <%= f.enum_select :subject %> 25:

I have traced it to line 34 in active_record_helper.rb:

31:  if (value = self.object.__send__(method_name.to_sym))
32:    options[:selected] ||= value.to_s
33:  else
34:    options[:include_blank] = enums.allows_nil? if options[:include_blank].nil?
35:  end

enums is not defined or referenced anywhere outside line 34.

electronick commented 12 years ago

fixed in https://github.com/electronick/enum_column/commit/0285260c02ad136f4636e5f8d009bf34dc5a128b