objectbouncer 0.1.3 → 0.1.4

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.
@@ -37,7 +37,7 @@ module ObjectBouncer
37
37
  end
38
38
 
39
39
  def policies
40
- @policies
40
+ @policies ||= {}
41
41
  end
42
42
 
43
43
  def blank_policy_template
@@ -61,14 +61,13 @@ module ObjectBouncer
61
61
  new_klass.instance_eval do
62
62
  include ObjectBouncer::Doorman
63
63
  end
64
- new_klass.policies = self.policies
64
+ new_klass.policies = self.policies || {}
65
65
  new_klass.current_user = accessee
66
66
  new_klass.apply_policies
67
67
  new_klass
68
68
  end
69
69
 
70
70
  def door_policy(&block)
71
- @policies = {}
72
71
  yield
73
72
  apply_policies
74
73
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: objectbouncer
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.3
5
+ version: 0.1.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Glenn Gillen