formwandler 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/formwandler/form_loader.rb +7 -11
- data/lib/formwandler/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66346495ce82162b0731fb3263fa8977dd8f55e80c1e1f919fa7014b5b612e9c
|
4
|
+
data.tar.gz: 40056efd340d347534d994208c7d3a01940321f77df11796e0f9c9a7f61d582a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e8f616e7ffeee9c4c709d041f804acb39c90a749c302b705350728f9786bcbf5f67d4ecf783c53fb6907be9d176ba8977479ae1590ee8cac272ffd6468cfba6
|
7
|
+
data.tar.gz: 28dc8f68e34baf128ff272c02e9bdd84c01aabddec4d4d8a32c1923f00becc2037201ec8d66aa3d350ee75bbcf682909ba2b1ebba64672c533a01ea3e3d0d03f
|
@@ -6,22 +6,18 @@ module Formwandler
|
|
6
6
|
|
7
7
|
class_methods do
|
8
8
|
def load_form(opts = {})
|
9
|
-
before_action
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
before_action(opts.except(:models)) do
|
10
|
+
if opts.fetch(:models, true)
|
11
|
+
models = {inferred_resource_name.to_sym => instance_variable_get("@#{inferred_resource_name}")}.compact
|
12
|
+
end
|
13
|
+
form_instance = form_class.new(models: models || {}, controller: self)
|
14
|
+
instance_variable_set("@#{form_instance_name}", form_instance)
|
15
|
+
end
|
14
16
|
end
|
15
17
|
end
|
16
18
|
|
17
19
|
private
|
18
20
|
|
19
|
-
def _formwandler_load_form
|
20
|
-
models = {inferred_resource_name.to_sym => instance_variable_get("@#{inferred_resource_name}")}.compact
|
21
|
-
form_instance = form_class.new(models: models, controller: self)
|
22
|
-
instance_variable_set("@#{form_instance_name}", form_instance)
|
23
|
-
end
|
24
|
-
|
25
21
|
def form_class_name
|
26
22
|
"#{namespace}::#{inferred_resource_name.camelize}Form"
|
27
23
|
end
|
data/lib/formwandler/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: formwandler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Bilharz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
142
|
- !ruby/object:Gem::Version
|
143
143
|
version: '0'
|
144
144
|
requirements: []
|
145
|
-
rubygems_version: 3.0.
|
145
|
+
rubygems_version: 3.0.3
|
146
146
|
signing_key:
|
147
147
|
specification_version: 4
|
148
148
|
summary: Form objects for rails
|