diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-08-01 10:33:23 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-08-01 11:02:15 -0700 |
commit | 5dd38ad021adb0b2e27908b2595a292dacf59cad (patch) | |
tree | 4f169bca1ff353140fd229d47f5e4329b2c7aef5 /activerecord | |
parent | 9da52a5e55cc665a539afb45783f84d9f3607282 (diff) | |
download | rails-5dd38ad021adb0b2e27908b2595a292dacf59cad.tar.gz rails-5dd38ad021adb0b2e27908b2595a292dacf59cad.tar.bz2 rails-5dd38ad021adb0b2e27908b2595a292dacf59cad.zip |
pushing out more callback definitions
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/associations/builder/collection_association.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/builder/collection_association.rb b/activerecord/lib/active_record/associations/builder/collection_association.rb index 22e8479b71..bdfd65cd33 100644 --- a/activerecord/lib/active_record/associations/builder/collection_association.rb +++ b/activerecord/lib/active_record/associations/builder/collection_association.rb @@ -22,10 +22,14 @@ module ActiveRecord::Associations::Builder def build wrap_block_extension reflection = super - CALLBACKS.each { |callback_name| define_callback(callback_name) } reflection end + def define_callbacks(model, reflection) + super + CALLBACKS.each { |callback_name| define_callback(model, callback_name) } + end + def writable? true end @@ -51,7 +55,7 @@ module ActiveRecord::Associations::Builder @extension_module_name ||= "#{model.name.demodulize}#{name.to_s.camelize}AssociationExtension" end - def define_callback(callback_name) + def define_callback(model, callback_name) full_callback_name = "#{callback_name}_for_#{name}" # TODO : why do i need method_defined? I think its because of the inheritance chain |