crewd_policies 0.3.1 → 0.3.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: e00be59f41afaf3cee180c45ff49150983ea0a61
4
- data.tar.gz: 50a550704ad57460802ad00f9363cd60d80566a6
3
+ metadata.gz: 79f754752bc6dec904e86214c84ce3cc367ef819
4
+ data.tar.gz: 500277df978ea184d161151b29d8bf18b788cf1f
5
5
  SHA512:
6
- metadata.gz: 91468f165e3a89c323cd3c91642d1de2202733cd1ba92f7a6f556733f975cb3d3991a853e79f53fa307013b2fcef6285b5f4b818dd9723d827c60dcdc74c1b6c
7
- data.tar.gz: 40987e4fb0a168c219da4cb89a0810f08f06c15c103fd086c4c5c9c479018b927237bcb0276469e1065757514f707f90b6a550bc1b59285848217af95c6358d5
6
+ metadata.gz: 050307ed65d1ee99dbd65f11491c871c786a489b4643e7ad45155c0fdfb49fca1c2f079d746fe5503dbea345da951828ce04129e0d5d29b5bae4bee914b8e9b4
7
+ data.tar.gz: ad33e8f4cb4455a459c1b06f034203f29623de04eb8bf5e7a1188d4b5efb4c2a14f7ed8eeab2ce4275a4a1839240960d5c489ceac5650f53b46ad5a6607df679
@@ -18,7 +18,7 @@ module CrewdPolicies
18
18
 
19
19
  def inherited(subclass)
20
20
  super
21
- attrs = ::Pundit.policy!(nil,subclass._model_class).all_attributes.map(&:to_sym)
21
+ attrs = subclass._model_class.column_names.map(&:to_sym)
22
22
  attrs -= [:id]
23
23
  subclass.send(:attributes, *attrs) unless attrs.empty?
24
24
  end
@@ -33,7 +33,7 @@ module CrewdPolicies
33
33
  end
34
34
 
35
35
  def fetchable_fields
36
- ::Pundit.policy!(context[:user],_model).permitted_attributes_for_read.map(&:to_sym)
36
+ ::Pundit.policy!(context[:user],_model).allowed_fields(:read).map(&:to_sym) # includes assocations
37
37
  end
38
38
  end
39
39
  end
@@ -1,3 +1,3 @@
1
1
  module CrewdPolicies
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  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.3.1
4
+ version: 0.3.2
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-03-31 00:00:00.000000000 Z
11
+ date: 2017-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pundit