protector 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4db3bb657e21375e7642202dac85b1c694a9b572
4
- data.tar.gz: 3e3e2498415ba55e7fd8b2c6cdc4ff432aaaf8b0
3
+ metadata.gz: 0a2b754f71ad4665dfb640dd5ab5c2060d4f76d4
4
+ data.tar.gz: bb360fdf2df2fb9fb363b3c1bc504f55ac43251a
5
5
  SHA512:
6
- metadata.gz: 27cbad32b5ac59f45af321ae849854146c69ec716b4c7cd51ae0941621b5971352c569746bf352ed3879bb3fa42af76b419d71be604d7e0faa7740c908e9934d
7
- data.tar.gz: 77170151fc817bad0d5913ff82025f98e3ef31346062c68821cae69f9165eb80f16aedcbf21aab0a03b4b74f1b8937780ca1d8bff3993059bdeddd5a0c2d7b9e
6
+ metadata.gz: e369f3564da219a73ff7064e1e61fcfee92f3250861c2a55f98a01db1465a532be4ffa8d2a2154dafb2571ccc104a7911f5e2960f503d44d1de95fcbd7fd0daa
7
+ data.tar.gz: b0fe0645dfbb8e596baf3fa097005e1aff161fef6503413917d95d8a1c3362ebffbecc4d78823ba8b1ddd74adad5a49b74640b3439dcd576b13463e4fdfd5711
@@ -9,6 +9,8 @@ module Protector
9
9
  include Protector::DSL::Base
10
10
  include Protector::DSL::Entry
11
11
 
12
+ before_destroy :protector_ensure_destroyable
13
+
12
14
  # We need this to make sure no ActiveRecord classes managed
13
15
  # to cache db scheme and create corresponding methods since
14
16
  # we want to modify the way they get created
@@ -25,11 +27,6 @@ module Protector
25
27
  end
26
28
  end
27
29
 
28
- before_destroy do
29
- return true unless protector_subject?
30
- destroyable?
31
- end
32
-
33
30
  # Drops {Protector::DSL::Meta::Box} cache when subject changes
34
31
  def restrict!(*args)
35
32
  @protector_meta = nil
@@ -133,6 +130,12 @@ module Protector
133
130
  def can?(action, field=false)
134
131
  protector_meta.can?(action, field)
135
132
  end
133
+
134
+ private
135
+ def protector_ensure_destroyable
136
+ return true unless protector_subject?
137
+ destroyable?
138
+ end
136
139
  end
137
140
  end
138
141
  end
@@ -1,4 +1,4 @@
1
1
  module Protector
2
2
  # Gem version
3
- VERSION = '0.7.2'
3
+ VERSION = '0.7.3'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris Staal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-03 00:00:00.000000000 Z
11
+ date: 2013-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport