diff options
Diffstat (limited to 'activerecord/lib/active_record/core.rb')
-rw-r--r-- | activerecord/lib/active_record/core.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index 957027c1ee..94c6684700 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -83,7 +83,12 @@ module ActiveRecord @attribute_methods_mutex = Mutex.new # force attribute methods to be higher in inheritance hierarchy than other generated methods - generated_attribute_methods + generated_attribute_methods.const_set(:AttrNames, Module.new { + def self.const_missing(name) + const_set(name, [name.to_s.sub(/ATTR_/, '')].pack('h*').freeze) + end + }) + generated_feature_methods end |