cyrax 0.5.12 → 0.5.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/cyrax/decorator.rb +2 -0
- data/lib/cyrax/helpers/controller.rb +5 -1
- data/lib/cyrax/serializers/scope.rb +2 -1
- data/lib/cyrax/version.rb +1 -1
- metadata +16 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9d1b6765085639d4473934d340f48c3dd72d519e3837b5af945dbdcd8c74ae89
|
4
|
+
data.tar.gz: 6239d1cf32f003eb211d3d3bafdb8fcbf441abaaafbd4140367c535664af518d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59dc7b1b3207e35a7c5c27aff5e84fec4fdcbc35d0521bb73923c33109156c6c57a346806924cdcff7d71e2a886cd81e94cc260a017d515b52a4c74c38828d8d
|
7
|
+
data.tar.gz: '097ccfc3c5d7ba33098dd565da4c04813f082e5da11dff300c55e7908125507c64c1218cb3db35d944e0e8f79bc9c92bf5b777cef6a82f48eecd545d6b8a3187'
|
data/lib/cyrax/decorator.rb
CHANGED
@@ -15,7 +15,7 @@ module Cyrax::ControllerHelper
|
|
15
15
|
result = result.to_model if result.respond_to?(:to_model)
|
16
16
|
|
17
17
|
respond_to do |format|
|
18
|
-
format.
|
18
|
+
format.html do
|
19
19
|
# set flashes
|
20
20
|
if response.success?
|
21
21
|
flash[:notice] = options[:notice] if options[:notice].present?
|
@@ -29,6 +29,10 @@ module Cyrax::ControllerHelper
|
|
29
29
|
format.json do
|
30
30
|
render json: MultiJson.dump(response.as_json), status: options[:status] || 200
|
31
31
|
end
|
32
|
+
format.any do
|
33
|
+
set_resource_from(response)
|
34
|
+
super(response, options, &block)
|
35
|
+
end
|
32
36
|
end
|
33
37
|
else
|
34
38
|
super(*args)
|
@@ -69,7 +69,8 @@ module Cyrax::Serializers
|
|
69
69
|
result[attribute] = scope.serialize(value, options)
|
70
70
|
end
|
71
71
|
@assigned_attrs.map do |attribute, scope|
|
72
|
-
|
72
|
+
assignments = options[:assignments] || {}
|
73
|
+
value = assignments[attribute]
|
73
74
|
result[attribute] = scope.serialize(value, options)
|
74
75
|
end
|
75
76
|
@namespace_attrs.map do |attribute, scope|
|
data/lib/cyrax/version.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cyrax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Droidlabs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '4.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '4.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activemodel
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '4.2'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '4.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: has_active_logger
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,19 +150,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
150
|
- !ruby/object:Gem::Version
|
151
151
|
version: '0'
|
152
152
|
requirements: []
|
153
|
-
|
154
|
-
rubygems_version: 2.2.2
|
153
|
+
rubygems_version: 3.0.3.1
|
155
154
|
signing_key:
|
156
155
|
specification_version: 4
|
157
156
|
summary: Small library for adding service layer to Rails projects
|
158
157
|
test_files:
|
159
|
-
- spec/cyrax/base_spec.rb
|
160
|
-
- spec/cyrax/decorator_spec.rb
|
161
|
-
- spec/cyrax/extensions/has_decorator_spec.rb
|
162
158
|
- spec/cyrax/extensions/has_resource_spec.rb
|
163
|
-
- spec/cyrax/extensions/has_response_spec.rb
|
164
159
|
- spec/cyrax/extensions/has_service_spec.rb
|
165
|
-
- spec/cyrax/
|
160
|
+
- spec/cyrax/extensions/has_decorator_spec.rb
|
161
|
+
- spec/cyrax/extensions/has_response_spec.rb
|
166
162
|
- spec/cyrax/response_spec.rb
|
167
163
|
- spec/cyrax/serializer_spec.rb
|
164
|
+
- spec/cyrax/resource_spec.rb
|
165
|
+
- spec/cyrax/base_spec.rb
|
166
|
+
- spec/cyrax/decorator_spec.rb
|
168
167
|
- spec/spec_helper.rb
|