rectify 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rectify/form.rb +7 -4
- data/lib/rectify/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d17170c50a6d7e85611f9cc82503946e5bbf5fbc
|
4
|
+
data.tar.gz: 62f958cbf21a255a949f7e69f03e0b6c9e2457c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee90509aa99f4b2b56ef755ca8cfd9f971b2af056da4af1b91cf67c8daa35e94a0e72a23877fccc26fb6a24091b9f4f00441bd9c07f5baf5606a6d8a2a7f0220
|
7
|
+
data.tar.gz: 05746e98f92c12066c5922f4f46782b8f6898062de952d93fbbbc77c528fd03f46d334a8656a44adfe180fa2a77a5fa038cb280aa725041302a59a93d5397d1b
|
data/lib/rectify/form.rb
CHANGED
@@ -6,13 +6,16 @@ module Rectify
|
|
6
6
|
attribute :id, Integer
|
7
7
|
|
8
8
|
def self.from_params(params, additional_params = {})
|
9
|
-
|
9
|
+
params_hash = hash_from(params)
|
10
|
+
|
11
|
+
attribute_names = attribute_set.map(&:name)
|
12
|
+
|
13
|
+
attributes = params_hash
|
10
14
|
.fetch(mimicked_model_name, {})
|
15
|
+
.merge(params_hash.slice(*attribute_names))
|
11
16
|
.merge(additional_params)
|
12
17
|
|
13
|
-
new(attributes)
|
14
|
-
f.id = params[:id]
|
15
|
-
end
|
18
|
+
new(attributes)
|
16
19
|
end
|
17
20
|
|
18
21
|
def self.from_model(model)
|
data/lib/rectify/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rectify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Pike
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|