lib/mongo_mapper/associations.rb in djsun-mongo_mapper-0.5.5.3 vs lib/mongo_mapper/associations.rb in djsun-mongo_mapper-0.5.6.1
- old
+ new
@@ -40,12 +40,10 @@
def define_dependent_callback(association)
if association.options[:dependent]
if association.many?
define_dependent_callback_for_many(association)
- elsif association.belongs_to?
- define_dependent_callback_for_belongs_to(association)
end
end
end
def define_dependent_callback_for_many(association)
@@ -61,17 +59,9 @@
end
end
end
end
- def define_dependent_callback_for_belongs_to(association)
- after_destroy do |doc|
- case association.options[:dependent]
- when :destroy
- doc.get_proxy(association).destroy
- end
- end
- end
end
module InstanceMethods
def get_proxy(association)
unless proxy = self.instance_variable_get(association.ivar)