Skip to content

Commit

Permalink
Merge pull request #9 from janosch-x/master
Browse files Browse the repository at this point in the history
fix for associations with class_name parameter, issue #7
  • Loading branch information
jisaacks committed Jan 29, 2015
2 parents 94cb563 + da79139 commit d9bb3c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/recurse-delete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def delete_recursively(parent_class, parent_ids)
end
assocs.each do |assoc|
# get the dependent class
dependent_class = assoc.name.to_s.classify.constantize
dependent_class = assoc.klass
# get the foreign key
foreign_key = (assoc.options[:foreign_key] or parent_class.to_s.foreign_key)
# get all the dependent record ids
Expand Down

0 comments on commit d9bb3c8

Please sign in to comment.