Commit f63ccc7f by John Hawthorn

Simplify restore_associated_records

parent 723ec506
...@@ -142,8 +142,8 @@ module Paranoia ...@@ -142,8 +142,8 @@ module Paranoia
end end
if association_data.nil? && association.macro.to_s == "has_one" if association_data.nil? && association.macro.to_s == "has_one"
association_class_name = association.options[:class_name].present? ? association.options[:class_name] : association.name.to_s.camelize association_class_name = association.class_name
association_foreign_key = association.foreign_key.present? ? association.foreign_key : "#{self.class.name.to_s.underscore}_id" association_foreign_key = association.foreign_key
if association.type if association.type
association_polymorphic_type = association.type association_polymorphic_type = association.type
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment