Browse files

Get rid of extra_conditions param from configure_dependency_for_has_m…

…any. I can't see a particularly plausible argument for this being used by plugins, and if they really want they can just redefine the callback or whatever. Note also that before my recent commit the extra_conditions param was completely ignored for :dependent => :destroy.
  • Loading branch information...
1 parent 6db9085 commit f7a15d0e03dc173ab5f88773a97a3bf26d7b957e @jonleighton jonleighton committed Dec 30, 2010
Showing with 3 additions and 9 deletions.
  1. +3 −9 activerecord/lib/active_record/associations.rb
View
12 activerecord/lib/active_record/associations.rb
@@ -1612,11 +1612,7 @@ def add_touch_callbacks(reflection, touch_attribute)
# - set the foreign key to NULL if the option is set to :nullify
# - do not delete the parent record if there is any child record if the
# option is set to :restrict
- #
- # The +extra_conditions+ parameter, which is not used within the main
- # Active Record codebase, is meant to allow plugins to define extra
- # finder conditions.
- def configure_dependency_for_has_many(reflection, extra_conditions = nil)
+ def configure_dependency_for_has_many(reflection)
if reflection.options[:dependent]
method_name = "has_many_dependent_for_#{reflection.name}"
@@ -1636,10 +1632,8 @@ class << o
end
end
- reflection.klass.send(:with_scope, :find => { :conditions => extra_conditions }) do
- # AssociationProxy#delete_all looks at the :dependent option and acts accordingly
- send(reflection.name).delete_all
- end
+ # AssociationProxy#delete_all looks at the :dependent option and acts accordingly
+ send(reflection.name).delete_all
end
when :restrict
define_method(method_name) do

0 comments on commit f7a15d0

Please sign in to comment.