pinkman 1.1.1 → 1.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
  SHA256:
3
- metadata.gz: 3763200ced79aa36f7e47198b0195abdcdfd0318f3b553b3875bfcecdb1883a3
4
- data.tar.gz: a6d43c350ee70c96812144476c408b3b46612b3b16a0b9ed4b4d2f14919b7263
3
+ metadata.gz: 7c25bae9a1ae443e0c447ac5811d44abb935e6ffb58aad10a2b2271e8e69c46b
4
+ data.tar.gz: bf705ab6cf39a314115680d707be7d52a6ed5ee4658c67f31bb05812d99998f0
5
5
  SHA512:
6
- metadata.gz: 900495e9e1845b8c5f55d70d5236bed4f1f602e548c59833bdd0fc62f1a30520d73810f93e1a08255f180cab5a34155d38dd3df59a446cdaaeb34744e83afde1
7
- data.tar.gz: ecb1773b0a1b504c4872786460def8868949209eb91ecdc2f28005c7d73c3a7c67c43806d21127c62e9ed28c72cb7cd473f78ca11d4f3429996316f2c59c2f7d
6
+ metadata.gz: b3be985a092e5fb10c4d954b4e4fbe635593bffc58e555bf6f7248b72d062006c93f6e8392d4e1de68fcaa54b052c4fa78b2a18c0936f1599aede9a85b1eb87e
7
+ data.tar.gz: 203a212d72659b8618b71c7e38009dacb6f0842b7c1724677994e9327086f2a7b5c9468d3c6821a5c220bd8e38e03fd338d3790cb7c8601fccc9aaabb3fa4f53
@@ -87,7 +87,7 @@ module Pinkman
87
87
  end
88
88
 
89
89
  def can_write? attribute
90
- (write.include?(:all) or write.include?(attribute.to_sym)) and (serializer.column_names.include?(attribute.to_s) or (serializer.instance_methods.include?("#{attribute.to_s}=".to_sym) and write.include?(attribute.to_sym)))
90
+ (write.include?(:all) or write.include?(attribute.to_sym)) and (serializer.model.column_names.include?(attribute.to_s) or (serializer.instance_methods.include?("#{attribute.to_s}=".to_sym) and write.include?(attribute.to_sym)))
91
91
  end
92
92
 
93
93
  def can_access? action
@@ -136,7 +136,11 @@ module Pinkman
136
136
 
137
137
 
138
138
  def get_associated_model(reflection)
139
- reflection.klass
139
+ if reflection.options[:polymorphic]
140
+ reflection.klass
141
+ else
142
+ reflection.active_record
143
+ end
140
144
  end
141
145
 
142
146
  def get_associated_serializer(attribute)
@@ -152,6 +156,7 @@ module Pinkman
152
156
  if assoc_serializer
153
157
  assoc_serializer.scope(name.to_sym)
154
158
  else
159
+ binding.pry
155
160
  raise ArgumentError, "#{serializer}.#{name}: association named - #{attribute} - found but I can't find its serializer."
156
161
  end
157
162
  end
@@ -1,3 +1,3 @@
1
1
  module Pinkman
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pinkman
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agilso Oliveira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-12 00:00:00.000000000 Z
11
+ date: 2019-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler