crewd_policies 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/crewd_policies/jsonapi_resources.rb +3 -1
- data/lib/crewd_policies/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: f2ccb5b994f527abdf5cf5a3531d6c7a265df0a2
|
4
|
+
data.tar.gz: 394164bede7020671253fdab0b58a8cd636c8aa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af545d247798a06bdaa90f48857c7c15b545872d5247d426bd1cec4686bb24a13f9979c32eec32914afc2ba09a1be361a5dea06fc0802a9494212cc6f9b5d472
|
7
|
+
data.tar.gz: c471f30ba88ab063b483c276e40c8b7e6154c89c7dd6db3ff4e010c547ecf358bbda767814fa60ba68b33eddf51e5b3263e5253cbfa2be2ce3f6e20b964585e9
|
@@ -18,7 +18,9 @@ module CrewdPolicies
|
|
18
18
|
|
19
19
|
def inherited(subclass)
|
20
20
|
super
|
21
|
-
|
21
|
+
cls = subclass._model_class
|
22
|
+
attrs = cls.roles_rules.values.flatten.map{|h| h[:fields]}.compact.flatten.uniq.map(&:to_sym) # all fields from all rules
|
23
|
+
attrs.delete_if { |f| cls.reflections.has_key? f.to_s } if cls.respond_to? :reflections # remove associations
|
22
24
|
attrs -= [:id]
|
23
25
|
subclass.send(:attributes, *attrs) unless attrs.empty?
|
24
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crewd_policies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gary McGhee
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pundit
|