formwandler 0.4.0 → 0.4.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: 66c573ed311eeaed84bd8a92801b60d04d2fc550
4
- data.tar.gz: d8c0f269f19e42d4a31ccbecfdbb69db6c04ba89
3
+ metadata.gz: 1a27068466663a6f025c030ea940bcba509ecb09
4
+ data.tar.gz: 78089c958ca21790a7538f6d85e3c25762ff8fb3
5
5
  SHA512:
6
- metadata.gz: e1f2fa32f9e1248e50bf8bd4dc3d6dd17aacf85650832cc93beac1cca3172b6462ea1d3b87e71a8d0a4fb476b911cc91bc30b296bf5bfdf4762266752071ed3f
7
- data.tar.gz: 4c6b3d9bd15d0cde087c295a9996ccd3e6a314bd5f6e98a447a0a19f354ae0a390b1b8de0d2a8d6dff8ffec5e899d3f06ec1be55362c459d27ef7896ba78d738
6
+ metadata.gz: 2a4e3b0b19310c31aa8dc71099dabda8e128e7042271753c4d1d835aadb764fa4afe455ab4b0c7adc53a9750e5654b0aa18cd9c703f38fc8bc8d94302c7e87e4
7
+ data.tar.gz: 1eeddda4bc9f432351c4ebeab0ce50fea589cc9c200d2d941e3b6be54bd7c56ca83ad387414b8b2a6592c84eb9a3c8e46ce2b863ea7d362e1eedefcbea4a8262
@@ -135,10 +135,16 @@ module Formwandler
135
135
 
136
136
  def permitted_params
137
137
  visible_fields = fields.reject(&:hidden?).map(&:name)
138
- delocalizations = fields.map(&:delocalize).compact
139
138
  controller.params.require(model_name.param_key).permit(*visible_fields).delocalize(delocalizations)
140
139
  end
141
140
 
141
+ def delocalizations
142
+ fields.reduce({}) do |memo, field|
143
+ memo[field.name] = field.delocalize
144
+ memo
145
+ end.compact
146
+ end
147
+
142
148
  def initialize_fields
143
149
  @fields = self.class.field_definitions.transform_values do |field_definition|
144
150
  Field.new(form: self, field_definition: field_definition)
@@ -1,3 +1,3 @@
1
1
  module Formwandler
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formwandler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Bilharz