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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/role_on.rb +7 -2
  3. data/role_on.gemspec +1 -1
  4. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.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, :conditions => ['role_id = ?', Role[role].id], :joins => :roles)
37
- named_scope("non_#{name}", :conditions => [ 'roles.id is ? or roles.id != ?', nil, Role[role].id ], :joins => :roles)
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{role_on}
5
- s.version = "0.2.2"
5
+ s.version = "0.2.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Daniel Huckstep"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: darkhelmet-role_on
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Huckstep