Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

14 lines (12 sloc) 0.447 kB
class ActiveRecord::Associations::HasManyThroughAssociation
private
def delete_records(records)
klass = @reflection.through_reflection.klass
method_map = {:destroy => :destroy_all}
method_name = method_map.fetch(@reflection.options[:dependent], :delete_all)
delete_method = klass.method(method_name)
records.each do |associate|
delete_method.call(construct_join_attributes(associate))
end
end
end
Jump to Line
Something went wrong with that request. Please try again.