aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/core.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-12-23 21:55:05 +0000
committerJon Leighton <j@jonathanleighton.com>2011-12-24 11:08:16 +0000
commit95795bcb2f3527d2b48a626e70e298a9665cfc66 (patch)
tree509c2089369cf48e5162d53dcacdcce2f7de4ee0 /activerecord/lib/active_record/core.rb
parent649869557a9592af5767b0ad3ae65d84fa0c0eb9 (diff)
downloadrails-95795bcb2f3527d2b48a626e70e298a9665cfc66.tar.gz
rails-95795bcb2f3527d2b48a626e70e298a9665cfc66.tar.bz2
rails-95795bcb2f3527d2b48a626e70e298a9665cfc66.zip
Make generated_feature_methods work with ActiveRecord::Model
Diffstat (limited to 'activerecord/lib/active_record/core.rb')
-rw-r--r--activerecord/lib/active_record/core.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb
index b3db41f1d3..8143e31f26 100644
--- a/activerecord/lib/active_record/core.rb
+++ b/activerecord/lib/active_record/core.rb
@@ -62,21 +62,26 @@ module ActiveRecord
Configuration.define :timestamped_migrations, true
included do
-
##
# :singleton-method:
# The connection handler
class_attribute :connection_handler, :instance_writer => false
+
+ initialize_generated_modules
end
module ClassMethods
def inherited(child_class) #:nodoc:
- # force attribute methods to be higher in inheritance hierarchy than other generated methods
- child_class.generated_attribute_methods
- child_class.generated_feature_methods
+ child_class.initialize_generated_modules
super
end
+ def initialize_generated_modules
+ # force attribute methods to be higher in inheritance hierarchy than other generated methods
+ generated_attribute_methods
+ generated_feature_methods
+ end
+
def generated_feature_methods
@generated_feature_methods ||= begin
mod = const_set(:GeneratedFeatureMethods, Module.new)