Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix to return scope instead of array

  • Loading branch information...
commit ea1b60d97872138a303227141b9d49174f673200 1 parent 4df69ad
@maxprokopiev authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/cancan/model_adapters/mongo_mapper_adapter.rb
View
2  lib/cancan/model_adapters/mongo_mapper_adapter.rb
@@ -32,7 +32,7 @@ def database_records
# there are no rules with empty conditions
rules = @rules.reject { |rule| rule.conditions.empty? }
process_can_rules = @rules.count == rules.count
- rules.inject(@model_class.all) do |records, rule|
+ rules.inject(@model_class.where) do |records, rule|
if process_can_rules && rule.base_behavior
records.or rule.conditions
elsif !rule.base_behavior
Please sign in to comment.
Something went wrong with that request. Please try again.