fixing mongoid 'or' error - closes #322
This commit is contained in:
parent
fb8e9bde57
commit
e96cf5bea4
|
@ -20,7 +20,9 @@ module CanCan
|
||||||
@model_class.where(:_id => {'$exists' => false, '$type' => 7}) # return no records in Mongoid
|
@model_class.where(:_id => {'$exists' => false, '$type' => 7}) # return no records in Mongoid
|
||||||
else
|
else
|
||||||
@rules.inject(@model_class.all) do |records, rule|
|
@rules.inject(@model_class.all) do |records, rule|
|
||||||
if rule.base_behavior
|
if rule.conditions.empty?
|
||||||
|
records
|
||||||
|
elsif rule.base_behavior
|
||||||
records.or(rule.conditions)
|
records.or(rule.conditions)
|
||||||
else
|
else
|
||||||
records.excludes(rule.conditions)
|
records.excludes(rule.conditions)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user