Skip to content

Commit

Permalink
Option *dependent* should destroy/delete/nullify associated records b…
Browse files Browse the repository at this point in the history
…efore destroy
  • Loading branch information
bearded committed Sep 6, 2011
1 parent 5a70995 commit f131f94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/mongo_mapper/plugins/associations/many_association.rb
Expand Up @@ -44,7 +44,7 @@ def #{name}=(value)
association = self
options = self.options

model.after_destroy do
model.before_destroy do
if !association.embeddable?
case options[:dependent]
when :destroy
Expand Down
2 changes: 1 addition & 1 deletion lib/mongo_mapper/plugins/associations/one_association.rb
Expand Up @@ -24,7 +24,7 @@ def setup(model)
association = self
options = self.options

model.after_destroy do
model.before_destroy do
if !association.embeddable?
proxy = self.get_proxy(association)

Expand Down

0 comments on commit f131f94

Please sign in to comment.