jsonapi_responses 1.1.0 → 1.1.1

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: ab50f413d2756f7f1f6b1faae376ebaf041a60fef7df43b29c037cfdfff295c2
4
- data.tar.gz: a3921894b3f3c0a3565e4be39667c4c9f643b9837c35c1a1e8c9c1ac491c477d
3
+ metadata.gz: '066548a9ebf27a83035e88ae033d84a8aee310cb6ee13fb4e789498ebdfa5d72'
4
+ data.tar.gz: 8714c314df3e5125f56cfd79119dc5acbdf1aaa66583dce4ed6e74faa13ca25c
5
5
  SHA512:
6
- metadata.gz: 0bfebe0f3f65b8125776d5161b7c26ac0d673ae979e8ca84ebca91422ef895812260e857ee43404c5a684eeec2e816258397229d25f172b3b4875d311cd6b979
7
- data.tar.gz: 83a0979577818624cabe42b395c12df5c1ea594768a855469ecd9de0673911bc6b6843731020f21931b81da35f8eb83582d9d99f826f19d13cfc52381d3e9955
6
+ metadata.gz: d2c2603d5d6f1cf28211af7742f22954562b84283d2818f1bfab517e305b5aa86bf2a7f5214e2b9c8e1d558371f8d440b138a58086faa4d814d4cfd22f5e476a
7
+ data.tar.gz: db9adb8eb6635f91fd5d18595285d7d42dc1f4aac13be52d4471f572a5404defe6abde66d816b51f68357ff78587241026a2509d5ae86a864848d00a5ead5869
@@ -165,7 +165,8 @@ module JsonapiResponses
165
165
  def render_with(record, options = {})
166
166
  action = options[:action] || action_name.to_sym
167
167
  context = (options[:context] || {}).merge(serialization_user)
168
- context = context.merge(view: params[:view]&.to_sym) if context.key?(:view)
168
+ # Only use params[:view] if view is not already provided in context
169
+ context[:view] ||= params[:view]&.to_sym
169
170
  serializer_class = options[:serializer] || "#{controller_name.singularize.camelize}Serializer".constantize
170
171
 
171
172
  # If a custom responder is provided, use it
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JsonapiResponses
4
- VERSION = '1.1.0'.freeze
4
+ VERSION = '1.1.1'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi_responses
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Ortega