Skip to content

Commit

Permalink
A fix for the bug of not removing old uploads when the identity map i…
Browse files Browse the repository at this point in the history
…s enabled.
  • Loading branch information
exoth committed Sep 13, 2012
1 parent c2ed3be commit 7260aaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/carrierwave/mongoid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def find_previous_model_for_#{column}
association = ancestors.inject(reloaded_parent) { |parent,(key,ancestor)| (parent.is_a?(Array) ? parent.find(ancestor.to_key.first) : parent).send(key) }
association.is_a?(Array) ? association.find(to_key.first) : association
else
self.class.unscoped.find(to_key.first)
self.class.unscoped.for_ids(to_key.first).first
end
end
Expand Down

0 comments on commit 7260aaa

Please sign in to comment.