Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

decouple extensions from association object state

  • Loading branch information...
commit bb1492e334e2d2efccb9d3c111648b895f626633 1 parent 1ccc132
Aaron Patterson tenderlove authored
4 activerecord/lib/active_record/associations/builder/association.rb
View
@@ -48,14 +48,14 @@ def mixin
@model.generated_feature_methods
end
- include Module.new { def build; end }
+ include Module.new { def build(*args); end }
def build
validate_options
define_accessors
configure_dependency if options[:dependent]
@reflection = model.create_reflection(macro, name, scope, options, model)
- super # provides an extension point
+ super(@model, @reflection) # provides an extension point
@reflection
end
2  activerecord/lib/active_record/autosave_association.rb
View
@@ -127,7 +127,7 @@ module AutosaveAssociation
extend ActiveSupport::Concern
module AssociationBuilderExtension #:nodoc:
- def build
+ def build(model, reflection)
model.send(:add_autosave_association_callbacks, reflection)
super
end
Please sign in to comment.
Something went wrong with that request. Please try again.