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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8b9e7ee4eddd3653789dd875597d62305a654ce6
4
- data.tar.gz: 993fb849adabe31de43bf04eca916c361cb0fe3e
2
+ SHA256:
3
+ metadata.gz: 9d1b6765085639d4473934d340f48c3dd72d519e3837b5af945dbdcd8c74ae89
4
+ data.tar.gz: 6239d1cf32f003eb211d3d3bafdb8fcbf441abaaafbd4140367c535664af518d
5
5
  SHA512:
6
- metadata.gz: af20afd5e17a2916dd893b13c40ed75e51677bb04b4371e22d423c94243b7526263203438cc90e156f0ce50a9607c2160d15a7803213d97d3c91bed05f038d06
7
- data.tar.gz: 5c401788d50e2d21cd96438871628cfd5e6942dad11a5ec601354dd0b1dffa54fc03546b6f1b6c13dba7b27f7c3907095d0fdea04e31ef40d3a636d725864577
6
+ metadata.gz: 59dc7b1b3207e35a7c5c27aff5e84fec4fdcbc35d0521bb73923c33109156c6c57a346806924cdcff7d71e2a886cd81e94cc260a017d515b52a4c74c38828d8d
7
+ data.tar.gz: '097ccfc3c5d7ba33098dd565da4c04813f082e5da11dff300c55e7908125507c64c1218cb3db35d944e0e8f79bc9c92bf5b777cef6a82f48eecd545d6b8a3187'
@@ -1,4 +1,6 @@
1
1
  require 'active_model'
2
+ # require 'active_model/serializers/xml'
3
+
2
4
  class Cyrax::Decorator < Cyrax::Wrapper
3
5
  include ActiveModel::Serialization
4
6
  include ActiveModel::Serializers::JSON
@@ -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.any do
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
- value = options[:assignments][attribute]
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
@@ -1,3 +1,3 @@
1
1
  module Cyrax
2
- VERSION = "0.5.12"
2
+ VERSION = "0.5.15"
3
3
  end
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.12
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: 2016-02-03 00:00:00.000000000 Z
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: '0'
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: '0'
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: '0'
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: '0'
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
- rubyforge_project:
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/resource_spec.rb
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