Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed rails 3.1 compatibility issues

  • Loading branch information...
commit a2a0de055b1f737578407d704adac4222fc258ec 1 parent f196351
@debaillie authored
Showing with 4 additions and 4 deletions.
  1. +1 −1  README.txt
  2. +3 −3 lib/enum/active_record_helper.rb
View
2  README.txt
@@ -14,7 +14,7 @@ How to use it.
In you Gemfile:
- gem 'enum_column3'
+ gem 'enum_column3', :git => 'git://github.com/debaillie/enum_column.git'
In your schema:
View
6 lib/enum/active_record_helper.rb
@@ -20,7 +20,7 @@ module Helpers
module FormOptionsHelper
#def select
def enum_select(object, method, options={}, html_options={})
- InstanceTag.new(object, method, self, options.delete(:object)).to_enum_select_tag(options, html_options)
+ InstanceTag.new(object.class.to_s.downcase, method, self, options.delete(:object)).to_enum_select_tag(options, html_options)
end
end
@@ -31,7 +31,7 @@ def to_enum_select_tag(options, html_options={})
if (value = self.object.__send__(method_name.to_sym))
options[:selected] ||= value.to_s
else
- options[:include_blank] = enums.allows_nil? if options[:include_blank].nil?
+ options[:include_blank] = false #enums.allows_nil? if options[:include_blank].nil?
end
end
to_select_tag(choices, options, html_options)
@@ -60,4 +60,4 @@ def enum_select(method, options={}, html_options={})
end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.