Permalink
Browse files

fix read_inheritable_attribute deprecated error in enumerations_mixin

  • Loading branch information...
1 parent 104beb3 commit f1ba9be37aa21a0714ce29175c5771f30edb3cf8 @t-bullock t-bullock committed Sep 16, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 vendor/plugins/enumerations_mixin/lib/active_record/acts/enumerated.rb
View
3 vendor/plugins/enumerations_mixin/lib/active_record/acts/enumerated.rb
@@ -14,6 +14,7 @@ def acts_as_enumerated(options = {})
valid_keys = [:conditions, :order, :on_lookup_failure]
options.assert_valid_keys(*valid_keys)
valid_keys.each do |key|
+ class_attribute :acts_enumerated_on_lookup_failure
class_attribute "acts_enumerated_#{key.to_s}"
if options.has_key?( key )
self.send "acts_enumerated_#{key.to_s}=", options[key]
@@ -55,7 +56,7 @@ def [](arg)
else
raise TypeError, "#{self.name}[]: argument should be a String, Symbol or Fixnum but got a: #{arg.class.name}"
end
- self.send((read_inheritable_attribute(:acts_enumerated_on_lookup_failure) || :enforce_strict_literals), arg)
+ self.send(:acts_enumerated_on_lookup_failure) || self.send(:enforce_strict_literals, arg)
end
def lookup_id(arg)

0 comments on commit f1ba9be

Please sign in to comment.