Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bcfd3d295 | ||
|
|
e96cf5bea4 |
@@ -1,3 +1,8 @@
|
||||
1.6.4 (March 29, 2011)
|
||||
|
||||
* Fixed mongoid 'or' error - see issue #322
|
||||
|
||||
|
||||
1.6.3 (March 25, 2011)
|
||||
|
||||
* Make sure ActiveRecord::Relation is defined before checking conditions against it so Rails 2 is supported again - see issue #312
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "cancan"
|
||||
s.version = "1.6.3"
|
||||
s.version = "1.6.4"
|
||||
s.author = "Ryan Bates"
|
||||
s.email = "ryan@railscasts.com"
|
||||
s.homepage = "http://github.com/ryanb/cancan"
|
||||
|
||||
@@ -20,7 +20,9 @@ module CanCan
|
||||
@model_class.where(:_id => {'$exists' => false, '$type' => 7}) # return no records in Mongoid
|
||||
else
|
||||
@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)
|
||||
else
|
||||
records.excludes(rule.conditions)
|
||||
|
||||
Reference in New Issue
Block a user