2 Commits
1.6.3 ... 1.6.4

Author SHA1 Message Date
Ryan Bates
7bcfd3d295 releasing 1.6.4 2011-03-29 17:51:15 -07:00
Ryan Bates
e96cf5bea4 fixing mongoid 'or' error - closes #322 2011-03-29 17:49:18 -07:00
3 changed files with 9 additions and 2 deletions

View File

@@ -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

View File

@@ -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"

View File

@@ -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)