role_authorization 0.2.7 → 0.2.8

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.
@@ -52,17 +52,17 @@ module RoleAuthorization
52
52
  scope, scope_id = scope_with(scope)
53
53
 
54
54
  (serialized_roles || {}).inject([]) do |array, (key, value)|
55
- if key == :global
56
- array << value if scope.nil?
55
+ if key == :global && scope.nil?
56
+ array << value
57
57
  else
58
58
  if scope.nil? || (key == scope.to_sym && scope_id.nil?)
59
59
  if value.is_a?(Hash)
60
60
  array << value.values
61
61
  else
62
- array << value
62
+ array << value unless value.nil?
63
63
  end
64
64
  else
65
- array << value[scope_id]
65
+ array << value[scope_id] unless scope_id.nil?
66
66
  end
67
67
  end
68
68
 
@@ -1,3 +1,3 @@
1
1
  module RoleAuthorization
2
- VERSION = "0.2.7"
2
+ VERSION = "0.2.8"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: role_authorization
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.7
5
+ version: 0.2.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - John 'asceth' Long