darkhelmet-role_on 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/role_on.rb +2 -2
- data/role_on.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.5
|
data/lib/role_on.rb
CHANGED
@@ -33,8 +33,8 @@ module RoleOn
|
|
33
33
|
|
34
34
|
module RoleOnUserClassMethods
|
35
35
|
def helper_for(role,name = role.to_s.pluralize)
|
36
|
-
named_scope(name, lambda { { :conditions => ['
|
37
|
-
named_scope("non_#{name}", lambda { { :conditions => [ 'roles.id is ? or roles.id != ?', nil, Role[role].id ], :
|
36
|
+
named_scope(name, lambda { { :conditions => ['roles.id = ?', Role[role].id], :joins => :roles } })
|
37
|
+
named_scope("non_#{name}", lambda { { :conditions => [ 'roles.id is ? or roles.id != ?', nil, Role[role].id ], :include => :roles } })
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
data/role_on.gemspec
CHANGED