pinkman 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pinkman/serializer/scope.rb +7 -2
- data/lib/pinkman/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c25bae9a1ae443e0c447ac5811d44abb935e6ffb58aad10a2b2271e8e69c46b
|
4
|
+
data.tar.gz: bf705ab6cf39a314115680d707be7d52a6ed5ee4658c67f31bb05812d99998f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
data/lib/pinkman/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2019-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|