actionset 0.5.3 → 0.5.4

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
  SHA1:
3
- metadata.gz: d6e04a93e2805a074c0f5b5e5fca32e3e7280dc6
4
- data.tar.gz: e8a0f5ad1bf00103fe183031d00549df20b5b7e3
3
+ metadata.gz: ec3fafb97dceebded86c4106ff2515254524d8ad
4
+ data.tar.gz: 18a2b68db72f4eac5205c58493447c3283db67c1
5
5
  SHA512:
6
- metadata.gz: 158335ca4f482e0cbf00371fede04be07d502291c9293ea761a71ca16983ab13b839a840baaa50fdcb3ac3b8c243f3179f3d77e1f79a196738c681d90b672652
7
- data.tar.gz: ce8354010e833973bf840d106cf9c880d28b2ffe8f302d058663d2d388bc30b59285bd685983436de6d183394eb622e43673f15b39013d051ad338f9fb2f53fe
6
+ metadata.gz: '01828b37ea7c42ec93d8c3961b79b72abdea34b934a096e449436a04613653e9f811b4256336957ac78604f2341fcdc28ee6522217c0a0974e114ab65963d855'
7
+ data.tar.gz: 5085a765387a6d58d73cdd31504a59d35eb5e4b7e4b4a8b9fd05b307ae6cd1ec5824725855c44ddc56e469a02237e87951e06b123a825ae5e784ba8d1d790b26
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v 0.5.4
2
+ - Allow the `form_for_object_from_param` helper to accept defaults hash
1
3
  v 0.5.3
2
4
  - allow attributes to be passed to the `sort_link_for` and `pagination_links_for` helper methods
3
5
  v 0.5.2
@@ -5,11 +5,12 @@ require 'ostruct'
5
5
 
6
6
  module Params
7
7
  module FormForObjectHelper
8
- def form_for_object_from_param(param)
9
- form_for_params = params.fetch(param, {})
8
+ def form_for_object_from_param(param, defaults = {})
9
+ form_for_params = current_params.fetch(param, {})
10
10
  form_for_requirements = { model_name: { param_key: param } }
11
+ form_for_hash = defaults.merge(form_for_params).merge(form_for_requirements)
11
12
 
12
- JSON.parse(form_for_params.merge(form_for_requirements).to_json,
13
+ JSON.parse(form_for_hash.to_json,
13
14
  object_class: OpenStruct)
14
15
  end
15
16
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActionSet
4
- VERSION = '0.5.3'
4
+ VERSION = '0.5.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionset
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Margheim
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-07 00:00:00.000000000 Z
11
+ date: 2018-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeset