cancan 1.6.3 → 1.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,8 @@
1
+ 1.6.4 (March 29, 2011)
2
+
3
+ * Fixed mongoid 'or' error - see issue #322
4
+
5
+
1
6
  1.6.3 (March 25, 2011)
2
7
 
3
8
  * Make sure ActiveRecord::Relation is defined before checking conditions against it so Rails 2 is supported again - see issue #312
@@ -20,7 +20,9 @@ module CanCan
20
20
  @model_class.where(:_id => {'$exists' => false, '$type' => 7}) # return no records in Mongoid
21
21
  else
22
22
  @rules.inject(@model_class.all) do |records, rule|
23
- if rule.base_behavior
23
+ if rule.conditions.empty?
24
+ records
25
+ elsif rule.base_behavior
24
26
  records.or(rule.conditions)
25
27
  else
26
28
  records.excludes(rule.conditions)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cancan
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 6
9
- - 3
10
- version: 1.6.3
9
+ - 4
10
+ version: 1.6.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Bates
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-25 00:00:00 -07:00
18
+ date: 2011-03-29 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency