Skip to content

Commit

Permalink
Merge branch 'release/1.17.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
coorasse committed Mar 26, 2017
2 parents 17805b1 + 4336d28 commit e633592
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ Develop

Unreleased

1.17.0 (March 26th, 2017)

* Improve performance for the Mongoid Adapter

1.16.0 (February 2nd, 2017)

* Introduce rubocop and fixes most of the issues
Expand Down
2 changes: 1 addition & 1 deletion lib/cancan/model_adapters/mongoid_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def simplify_relations(model_class, conditions)
if (relation = model_relations[k])
relation_class_name = relation[:class_name].blank? ? k.to_s.classify : relation[:class_name]
v = simplify_relations(relation_class_name.constantize, v)
relation_ids = relation_class_name.constantize.where(v).only(:id).map(&:id)
relation_ids = relation_class_name.constantize.where(v).distinct(:_id)
k = "#{k}_id"
v = { '$in' => relation_ids }
end
Expand Down
2 changes: 1 addition & 1 deletion lib/cancan/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module CanCan
VERSION = '1.16.0'.freeze
VERSION = '1.17.0'.freeze
end

0 comments on commit e633592

Please sign in to comment.