darkhelmet-role_on 0.1.3 → 0.1.4
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 +4 -0
- data/role_on.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/lib/role_on.rb
CHANGED
@@ -32,6 +32,10 @@ module RoleOn
|
|
32
32
|
def helper_for(role,name = role.to_s.pluralize)
|
33
33
|
(class << self; self; end).class_eval do
|
34
34
|
define_method("all_#{name}") do
|
35
|
+
User.find(:all, :conditions => ['role_id = ?', Role[role].id], :joins => :roles)
|
36
|
+
end
|
37
|
+
|
38
|
+
define_method("all_non_#{name}") do
|
35
39
|
User.find(:all, :conditions => [ 'roles.id is ? or roles.id != ?', nil, Role[role].id ], :include => :roles)
|
36
40
|
end
|
37
41
|
end
|
data/role_on.gemspec
CHANGED