darkhelmet-role_on 0.2.2 → 0.2.3
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 +7 -2
- data/role_on.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/lib/role_on.rb
CHANGED
@@ -33,8 +33,13 @@ module RoleOn
|
|
33
33
|
|
34
34
|
module RoleOnUserClassMethods
|
35
35
|
def helper_for(role,name = role.to_s.pluralize)
|
36
|
-
named_scope(name
|
37
|
-
|
36
|
+
named_scope(name) do
|
37
|
+
{ :conditions => ['role_id = ?', Role[role].id], :joins => :roles }
|
38
|
+
end
|
39
|
+
|
40
|
+
named_scope("non_#{name}") do
|
41
|
+
{ :conditions => [ 'roles.id is ? or roles.id != ?', nil, Role[role].id ], :joins => :roles }
|
42
|
+
end
|
38
43
|
end
|
39
44
|
end
|
40
45
|
|
data/role_on.gemspec
CHANGED