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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22c594dcc9a5e42093f7704e25d35a0e2070cb5ded791b808e27cf3cadfd9cb5
4
- data.tar.gz: 56c28f65cd1bc5eef1430d9eb054a2d223147d5b8f44146010e22245559b7f69
3
+ metadata.gz: b4969c611478b01b2eb3a9d42d1c29b8e9ffb5d9ac93af2782a06bab6338f7c5
4
+ data.tar.gz: 45f10ea26c2b7f42768159d6568270c19b4214010be57c4db81bf6e13a0d18bc
5
5
  SHA512:
6
- metadata.gz: 34fadfadf82df643a40a8bc3966b8585e276165fd25da6e00939feef9e2ddddf14916208627ff34112858c3a0d4b8c1edd79ef78f006bcd56ed5640cb7eb4482
7
- data.tar.gz: 787abae553001a6104bddd2d2feb1fbb189225647aaa1fdf5d680239788e258f06b64f60cee2e268df44f83caa72090c5dd1ab6c4d96db9ff5b69aaf6fd7abbf
6
+ metadata.gz: '0908aaf60135006c81c700a532d330a14b2cbe562f39defccf16cf219b11fd323ddd6ce6b6e0daef8c838dd2b5d6d1a5833d8d968161080bd79434e57884518f'
7
+ data.tar.gz: 1e5a27236dec947b92fadab1be8ab5a1419b81e8863a49a76a50d9bbb698b4aa8602496cd576e5f138a47d592d9ee917f3c91380010cb86dba19ec494022aaee
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module Pinkman
2
- VERSION = "1.2.6"
2
+ VERSION = "1.3.0"
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.2.6
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-14 00:00:00.000000000 Z
11
+ date: 2019-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler