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 +4 -4
- data/lib/protector/adapters/active_record/base.rb +8 -5
- data/lib/protector/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a2b754f71ad4665dfb640dd5ab5c2060d4f76d4
|
4
|
+
data.tar.gz: bb360fdf2df2fb9fb363b3c1bc504f55ac43251a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/protector/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2013-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|