on_form 2.2.1 → 2.2.2
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 +4 -4
- data/CHANGES.md +5 -0
- data/lib/on_form/attributes.rb +3 -1
- data/lib/on_form/form.rb +1 -0
- data/lib/on_form/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: fc9552629f219a60bdb440b73aeaff5bab8ee8a7
|
|
4
|
+
data.tar.gz: 30fe72e471a35b622fd9203899b175a554f85785
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 31cae4ebd42811962196cc71da3e0b44d549a30d906b4be52cf88f6dfc6342d24bcbeab9971b91025a799732786a427dfbbc4566be1e84643cc1771be6f1718e
|
|
7
|
+
data.tar.gz: 1336b1e8f6d98778ab2d836dbbfba0986f3a76e7641676386443a4b1d71f667c015537d602d97964af57857b943976961a2364b0f794ed3cdbdf73c948401941
|
data/CHANGES.md
CHANGED
data/lib/on_form/attributes.rb
CHANGED
|
@@ -32,7 +32,9 @@ module OnForm
|
|
|
32
32
|
|
|
33
33
|
def attributes=(attributes)
|
|
34
34
|
# match ActiveRecord #attributes= behavior on nil, scalars, etc.
|
|
35
|
-
|
|
35
|
+
if !attributes.respond_to?(:stringify_keys)
|
|
36
|
+
raise ArgumentError, "When assigning attributes, you must pass a hash as an argument."
|
|
37
|
+
end
|
|
36
38
|
|
|
37
39
|
multiparameter_attributes = {}
|
|
38
40
|
attributes.each do |attribute_name, attribute_value|
|
data/lib/on_form/form.rb
CHANGED
|
@@ -24,6 +24,7 @@ module OnForm
|
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def self.expose(backing_attribute_names, on:, prefix: nil, suffix: nil, as: nil)
|
|
27
|
+
backing_attribute_names = Array(backing_attribute_names)
|
|
27
28
|
raise ArgumentError, "can't expose multiple attributes as the same form attribute!" if as && backing_attribute_names.size != 1
|
|
28
29
|
on = on.to_sym
|
|
29
30
|
expose_backing_model(on)
|
data/lib/on_form/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: on_form
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.2.
|
|
4
|
+
version: 2.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Will Bryant
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-10-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activemodel
|