pinkman 1.2.6 → 1.3.0
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 +4 -4
- data/lib/pinkman/model/base.rb +1 -1
- data/lib/pinkman/serializer/scope.rb +12 -0
- 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: b4969c611478b01b2eb3a9d42d1c29b8e9ffb5d9ac93af2782a06bab6338f7c5
|
|
4
|
+
data.tar.gz: 45f10ea26c2b7f42768159d6568270c19b4214010be57c4db81bf6e13a0d18bc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0908aaf60135006c81c700a532d330a14b2cbe562f39defccf16cf219b11fd323ddd6ce6b6e0daef8c838dd2b5d6d1a5833d8d968161080bd79434e57884518f'
|
|
7
|
+
data.tar.gz: 1e5a27236dec947b92fadab1be8ab5a1419b81e8863a49a76a50d9bbb698b4aa8602496cd576e5f138a47d592d9ee917f3c91380010cb86dba19ec494022aaee
|
data/lib/pinkman/model/base.rb
CHANGED
|
@@ -38,7 +38,7 @@ module Pinkman
|
|
|
38
38
|
options_select = options[:select] || []
|
|
39
39
|
|
|
40
40
|
scope_obj = serializer.scope(scope)
|
|
41
|
-
including_array = scope_obj.including + options_includes
|
|
41
|
+
including_array = scope_obj.including + scope_obj.associations_inclusion + options_includes
|
|
42
42
|
selecting_array = scope_obj.selecting + options_select
|
|
43
43
|
|
|
44
44
|
includes(including_array).select(selecting_array)
|
|
@@ -81,6 +81,18 @@ module Pinkman
|
|
|
81
81
|
self.access = [] unless args.first
|
|
82
82
|
access
|
|
83
83
|
end
|
|
84
|
+
|
|
85
|
+
def associations_inclusion
|
|
86
|
+
@associations_inclusion ||= []
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def associations_inclusion= val
|
|
90
|
+
@associations_inclusion = val
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def include_associations *args
|
|
94
|
+
self.associations_inclusion = args
|
|
95
|
+
end
|
|
84
96
|
|
|
85
97
|
def can_read? attribute
|
|
86
98
|
read.include?(:all) or read.include?(attribute.to_sym) or attribute.to_sym == :error or attribute.to_sym == :errors or read_ghost.include?(attribute.to_sym)
|
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.
|
|
4
|
+
version: 1.3.0
|
|
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-05-
|
|
11
|
+
date: 2019-05-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|