formnestic 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/formnestic.gemspec +1 -1
- data/lib/formnestic/form_builder/base_builder.rb +17 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e281623f8c90a084c73a74df1ba4410e290e7718bbd309f0b7692dca5f5cbb39
|
4
|
+
data.tar.gz: 323e7995e366b181b816f23cbefc7eeb137607c5c9df9c5db6d6bdcea4a38b2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e533786817be4cc37a4c33cf8efa1ffb5c66e05f2ae7085f7133ee288e8c872d6a842f19d004001af8e56afc58ea376d4a577fe194f1c3235e98015c182a201
|
7
|
+
data.tar.gz: 2a4725a220dc4f31dd5e611c79b18b50173ec941372caa3048867d8416e12f53417dbfc277ee1af438c14f433947b50bf5c89f84b5b1020c16e8ef9d0066fd93
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.9
|
data/formnestic.gemspec
CHANGED
@@ -22,8 +22,23 @@ module Formnestic
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
def formnestic_link_to_add_fields_with_content(
|
26
|
-
|
25
|
+
def formnestic_link_to_add_fields_with_content(
|
26
|
+
record_or_name_or_array, *args, &block
|
27
|
+
)
|
28
|
+
relationship = object.class.reflections[record_or_name_or_array.to_s]
|
29
|
+
if relationship.nil?
|
30
|
+
raise "#{record_or_name_or_array} is not a \
|
31
|
+
relationship of #{object.class}"
|
32
|
+
end
|
33
|
+
|
34
|
+
new_object =
|
35
|
+
if relationship.is_a?(
|
36
|
+
ActiveRecord::Reflection::HasManyReflection
|
37
|
+
)
|
38
|
+
object.public_send(record_or_name_or_array).build
|
39
|
+
else
|
40
|
+
relationship.klass.new
|
41
|
+
end
|
27
42
|
options = args.dup.extract_options!
|
28
43
|
options[:max_entry] ||= -1
|
29
44
|
duplicate_args = args.dup
|