objectbouncer 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. data/lib/objectbouncer/base.rb +3 -3
  2. metadata +1 -1
@@ -32,7 +32,7 @@ module ObjectBouncer
32
32
  end
33
33
 
34
34
  def policies
35
- @policies || self.class.instance_policies
35
+ @policies || self.class.policies
36
36
  end
37
37
 
38
38
  def self.included(klass)
@@ -54,10 +54,10 @@ module ObjectBouncer
54
54
  return false if current_user.nil? && !enforced?
55
55
  if meth_policies = policies[meth]
56
56
  if !meth_policies[:unless].empty?
57
- return false if meth_policies[:unless].detect{|policy| policy.call(current_user, @object, *args) rescue nil}
57
+ return false if meth_policies[:unless].detect{|policy| policy.call(current_user, self, *args) rescue nil}
58
58
  return true
59
59
  end
60
- return true if meth_policies[:if].detect{|policy| policy.call(current_user, @object, *args) rescue nil}
60
+ return true if meth_policies[:if].detect{|policy| policy.call(current_user, self, *args) rescue nil}
61
61
  end
62
62
  end
63
63
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: objectbouncer
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Glenn Gillen