Skip to content

Commit

Permalink
Fixed Mongoid 3's signature change of for_ids
Browse files Browse the repository at this point in the history
  • Loading branch information
rmm5t committed Dec 16, 2012
1 parent ba9c3eb commit 78b793d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/carrierwave/mongoid.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -57,7 +57,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 = 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 association.is_a?(Array) ? association.find(to_key.first) : association
else else
self.class.unscoped.for_ids(to_key.first).first self.class.unscoped.for_ids(to_key).first
end end
end end
Expand Down

0 comments on commit 78b793d

Please sign in to comment.