mutils 1.1.8 → 1.2.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/CHANGELOG.md +7 -0
- data/Gemfile.lock +2 -2
- data/README.md +2 -0
- data/Version +1 -1
- data/lib/mutils/serialization/results/attributes.rb +4 -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: ee4bcc8d29af2074d7f171e424c90b27a1214813ccdec6a97f5696f1e7bb9e90
|
|
4
|
+
data.tar.gz: bfd86ae9c1f17998804f8904706e0acbb0af72a05d5f9a8c9c3123cf1da777e2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7b85fbb8d97f1fa6e751564895c5efe4810038d2884f26fb1d94e6033ec0005da5a82f020a105b4b5636125225f30c35990395e957a64cf305442328aa234458
|
|
7
|
+
data.tar.gz: f601f8d4e1f7351823d5353feb392b19386d7830eb0126a2e45fa6fe5cc81bfd65871b9f0b3c410d392999ded18bb1d20940fadac59f35d79cf0a40129f01819
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [1.2.0](https://github.com/Code-Vedas/mutils/compare/v1.1.8...v1.2.0) (2021-08-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* attribute can accept Proc without params ([c014fef](https://github.com/Code-Vedas/mutils/commit/c014fef841426673d1f409b56a1c2548222fd2f5))
|
|
7
|
+
|
|
1
8
|
## [1.1.8](https://github.com/Code-Vedas/mutils/compare/v1.1.7...v1.1.8) (2021-08-20)
|
|
2
9
|
|
|
3
10
|
|
data/Gemfile.lock
CHANGED
|
@@ -7,7 +7,7 @@ GIT
|
|
|
7
7
|
PATH
|
|
8
8
|
remote: .
|
|
9
9
|
specs:
|
|
10
|
-
mutils (1.1.
|
|
10
|
+
mutils (1.1.8)
|
|
11
11
|
dry-inflector
|
|
12
12
|
|
|
13
13
|
GEM
|
|
@@ -25,7 +25,7 @@ GEM
|
|
|
25
25
|
tins (~> 1.6)
|
|
26
26
|
diff-lcs (1.4.4)
|
|
27
27
|
docile (1.3.2)
|
|
28
|
-
dry-inflector (0.2.
|
|
28
|
+
dry-inflector (0.2.1)
|
|
29
29
|
json (2.5.1)
|
|
30
30
|
json (2.5.1-java)
|
|
31
31
|
parallel (1.20.1)
|
data/README.md
CHANGED
|
@@ -74,6 +74,8 @@ class UserSerializer < Mutils::Serialization::BaseSerializer
|
|
|
74
74
|
attributes :id, :first_name, :last_name, :email
|
|
75
75
|
## OR
|
|
76
76
|
attribute :email, {always_include: true} ## this will allow to selectively include email
|
|
77
|
+
## OR
|
|
78
|
+
attribute :email, &:email ## this will call email attribute from User
|
|
77
79
|
end
|
|
78
80
|
```
|
|
79
81
|
### Relations
|
data/Version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
v1.
|
|
1
|
+
v1.2.0
|
|
@@ -9,7 +9,10 @@ module Mutils
|
|
|
9
9
|
module Attributes
|
|
10
10
|
def fetch_block_attributes(attributes, result_hash)
|
|
11
11
|
attributes&.each do |key, s_options|
|
|
12
|
-
|
|
12
|
+
arg = [scope]
|
|
13
|
+
arg << options[:params] || {} unless s_options[:block].parameters.flatten.include?(:rest)
|
|
14
|
+
|
|
15
|
+
result_hash[key] = s_options[:block].call(*arg)
|
|
13
16
|
end
|
|
14
17
|
end
|
|
15
18
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mutils
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nitesh Purohit
|
|
@@ -114,7 +114,7 @@ licenses:
|
|
|
114
114
|
- MIT
|
|
115
115
|
metadata:
|
|
116
116
|
bug_tracker_uri: https://github.com/code-vedas/mutils/issues
|
|
117
|
-
source_code_uri: https://github.com/code-vedas/mutils/tree/v1.
|
|
117
|
+
source_code_uri: https://github.com/code-vedas/mutils/tree/v1.2.0
|
|
118
118
|
post_install_message:
|
|
119
119
|
rdoc_options: []
|
|
120
120
|
require_paths:
|