rectify 0.9.0 → 0.9.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
  SHA1:
3
- metadata.gz: 4f81f92c6b9b526d6000d455dbb9ba6fa54f2918
4
- data.tar.gz: 941296c66a7deedccde2e30cd90021edbaab2980
3
+ metadata.gz: ed179d09baec15d8adc4c6bcf6c78bcc4766e71e
4
+ data.tar.gz: 486c246e99345dee440152d904b37dd004f1600a
5
5
  SHA512:
6
- metadata.gz: e5824327074db708534c6d3009769b7b4b7669bd294fa609e5020784fded58738a363eba433b23376530cd754200d2e5f1c3a372a3203fcffcfb2c77996cca7e
7
- data.tar.gz: aa430bbd17f4ed0075f918fe203da94fc73d04a4a23c8602945c84f3f19d58c439b9ad6a10e526c7b43fca2eb78b73188d9f5e89399e9678ff2913b3295baf55
6
+ metadata.gz: e1dbacf58c68b37a38c3263f4cd5d0382ca6ac75ba65b9a48194425c19de4763cb1613f600d0e42b03996d621910fcb331c151a566f0fc9e124b2f875187735c
7
+ data.tar.gz: 8ea6e909cf18ef9fc5a1a2b6476338c75ecde7d73302677a26b0c495db48cb735eeb8dbbc9578698f865b750c5b4eedbb1fc522eb0708de438a830853ce2f9bf
data/lib/rectify/form.rb CHANGED
@@ -10,14 +10,16 @@ module Rectify
10
10
  def self.from_params(params, additional_params = {})
11
11
  params_hash = hash_from(params)
12
12
 
13
- attribute_names = attribute_set.map(&:name)
14
-
15
13
  attributes_hash = params_hash
16
14
  .fetch(mimicked_model_name, {})
17
- .merge(params_hash.slice(*attribute_names))
15
+ .merge(params_hash)
18
16
  .merge(additional_params)
19
17
 
20
- new(FormatAttributesHash.new(attribute_set).format(attributes_hash))
18
+ formatted_attributes = FormatAttributesHash
19
+ .new(attribute_set)
20
+ .format(attributes_hash)
21
+
22
+ new(formatted_attributes)
21
23
  end
22
24
 
23
25
  def self.from_model(model)
@@ -1,3 +1,3 @@
1
1
  module Rectify
2
- VERSION = "0.9.0".freeze
2
+ VERSION = "0.9.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rectify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Pike