sanction 2.1.1 → 2.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54b4bc26ea4486d4933609a99ce9069cc9d0e006
4
- data.tar.gz: 61e47caeb74f34362da54ca9e4fc4795502e0141
3
+ metadata.gz: ef97b7042edafedf55e2bde7da8dede6a1aa628a
4
+ data.tar.gz: 6f41a829e4b0a53bbd138d65ae29d6b138a2f51a
5
5
  SHA512:
6
- metadata.gz: eccc4a6e58d4c3db5ead80ef35479c329e64843eb6259096476a2c368b61cc902723ee917c3a6c5147ea94922fd1f0294f869d8abd1d451aa3287ccf8f09b656
7
- data.tar.gz: e340fc3cb7f86837bf9bf2c5ff91206f7502dda29b0128da593e777de8ae863cefd5badf92d0617cfd91a9106618597761049444650c06f5667db67ca5ae7e21
6
+ metadata.gz: 428b993f4be88352331de15a703e56440030b35e52277cecc7c4012d44d78699b190dd9957b9f0a24e60a0df2d5d5ff6b7dda44c7dcef0abca7ac89249691bd6
7
+ data.tar.gz: 169be6b0f3db5d5f1d85e1547aca66de2fd7d8b26fc8959ed78cc395371ba27296db9cab3c8a6599c4284e5377cd2593befbd9ee9c5f4252c6dee262626b7fa6
data/.gitignore CHANGED
@@ -12,3 +12,4 @@
12
12
  *.o
13
13
  *.a
14
14
  mkmf.log
15
+ .DS_Store
data/lib/sanction/node.rb CHANGED
@@ -89,12 +89,13 @@ module Sanction
89
89
  return @scope if (parent.blank? && root?)
90
90
  @scope.blank? ? parent.scope : @scope
91
91
  end
92
-
92
+
93
93
  def scope=(attribute)
94
94
  @scope = [attribute].flatten.compact.map(&:to_sym)
95
95
  end
96
96
 
97
97
  def add_scope(attribute)
98
+ clone_scope! if @scope.blank?
98
99
  @scope << attribute.to_sym
99
100
  sanitize_scope!
100
101
  end
@@ -132,6 +133,10 @@ module Sanction
132
133
 
133
134
  private
134
135
 
136
+ def clone_scope!
137
+ @scope = parent.scope.dup
138
+ end
139
+
135
140
  def sanitize_scope!
136
141
  @scope = @scope.flatten.compact.uniq.map(&:to_sym)
137
142
  end
@@ -1,3 +1,3 @@
1
1
  module Sanction
2
- VERSION = "2.1.1"
2
+ VERSION = "2.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sanction
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Carlile
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-15 00:00:00.000000000 Z
12
+ date: 2015-03-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  version: '0'
151
151
  requirements: []
152
152
  rubyforge_project:
153
- rubygems_version: 2.2.2
153
+ rubygems_version: 2.4.5
154
154
  signing_key:
155
155
  specification_version: 4
156
156
  summary: A permissions gem for people who love JSON