hal_api-rails 1.1.0 → 1.1.1

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
2
  SHA256:
3
- metadata.gz: 93692b389012f8d919478bd871f756f90118c517a1edde2a5ae6cbb463d644b1
4
- data.tar.gz: b15713d0ba0c1e005044dc48cc0a737066d89e1de84f1233e8072e17cdabc6d6
3
+ metadata.gz: e65263d5ce378a545b2d3567660f7e7794557d7709e325e34a493a683993ad36
4
+ data.tar.gz: a9ec78d859e620c476757e2e7885aafeb3b3cb3203e33b0d8666c9710074ec9c
5
5
  SHA512:
6
- metadata.gz: 572d57798b5240e8e33032de9b74492548f4901bb3fc74e9f2c40b65c59fea32d59b51a958e62087609365302ceb6fc349532920fb779a9d3d35aab841e97be5
7
- data.tar.gz: 8f2e81fe36e137287dab3492dc0636588c06ba3910fe9ddb682e3bfe42ddede2c4e79717229f12a6af8174bbde2fcf1cb222fbdc5aaadc1d64807f0c12e7e175
6
+ metadata.gz: 60c496246425fc92b38f6d495bd78d9f8ac4c30e0af0b925bb248f8b346b06a15c191ddd47a8c676417dbd224f067f15765155bd1aee5627be6a65c4772331ac
7
+ data.tar.gz: 3b96b70cad2e0845d70778361d69f69aadfb2711302123ddec2b03aa95ff16a6a98e961ff03a431f2a57659b49cadbcf8ed1d629764efb5758f8e9d7304bb0ef
@@ -71,7 +71,9 @@ module HalApi::Controller::Actions
71
71
 
72
72
  def valid_params_for_action(action)
73
73
  (params.permit(*self.class.valid_params_list(action)) || {}).tap do |p|
74
- p[:zoom] = zoom_param if zoom_param
74
+ if zoom_param
75
+ p[:user_options] = (p[:user_options] || {}).merge(zoom: zoom_param)
76
+ end
75
77
  end.
76
78
  to_h
77
79
  end
@@ -1,5 +1,5 @@
1
1
  module HalApi
2
2
  module Rails
3
- VERSION = "1.1.0"
3
+ VERSION = "1.1.1"
4
4
  end
5
5
  end
@@ -10,15 +10,6 @@ module HalApi::Representer::Embeds
10
10
  Representable::Binding.send(:include, HalApiRailsRenderPipeline) if !Representable::Binding.include?(HalApiRailsRenderPipeline)
11
11
  end
12
12
 
13
- def normalize_options!(options)
14
- propagated_options, private_options = super(options)
15
-
16
- # we want this to propogate, and be available for `skip_property?`, so don't delete
17
- private_options[:zoom] = options[:zoom] if options.key?(:zoom)
18
-
19
- [propagated_options, private_options]
20
- end
21
-
22
13
  module HalApiRailsRenderPipeline
23
14
 
24
15
  def skip_property?(binding, private_options)
@@ -37,8 +28,6 @@ module HalApi::Representer::Embeds
37
28
 
38
29
  # embed if zoomed
39
30
  def suppress_embed?(input, options)
40
- user_options = options[:options]
41
-
42
31
  binding = options[:binding]
43
32
 
44
33
  # guard against non-hal representers
@@ -51,7 +40,8 @@ module HalApi::Representer::Embeds
51
40
  return false if !embedded
52
41
 
53
42
  ## check if it should be zoomed, suppress if not
54
- !embed_zoomed?(name, binding[:zoom], user_options[:zoom])
43
+ user_zooms = options[:options].try(:[], :user_options).try(:[], :zoom)
44
+ !embed_zoomed?(name, binding[:zoom], user_zooms)
55
45
  end
56
46
 
57
47
  def embed_zoomed?(name, zoom_def = nil, zoom_param = nil)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hal_api-rails
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
  - Chris Rhoden
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-01-08 00:00:00.000000000 Z
12
+ date: 2020-02-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -254,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
254
254
  - !ruby/object:Gem::Version
255
255
  version: '0'
256
256
  requirements: []
257
- rubygems_version: 3.0.3
257
+ rubygems_version: 3.0.1
258
258
  signing_key:
259
259
  specification_version: 4
260
260
  summary: JSON HAL APIs on Rails in the style of PRX