form_props 0.0.3 → 0.0.4

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
  SHA256:
3
- metadata.gz: 6afc4d5cd3b6527eda75e36d715a828d50fb91f7cd35015840cfda0fd3bd1757
4
- data.tar.gz: 112580b30cc0ee20c4bb7903bf2b710c07452e9584753306badd4b091965f367
3
+ metadata.gz: e3200a705c61ab6b0ebae4316cb80874b53ee0be1297e1230632e8b4568d7054
4
+ data.tar.gz: e0f83bff9ce077fee68002cedc1a0906d4139aff509fe514c73a4e085c82a386
5
5
  SHA512:
6
- metadata.gz: f96bd0cf7459cf432c86d4e0b660a061b0787d294ce154ed18af9c6a44feebc5ee8451525bc9e9304823c1b16ff41be0a10423e0e30e47435b5b94e3eae6e1de
7
- data.tar.gz: f15f59d1ce001e8f4208d1e9081feb01967964cd6e8b2be7633ac97166ef17aaf8a4df2b2a0333b113ba7438858a2ffa0913d7bc5cfaa5dfc9a83906718f38b2
6
+ metadata.gz: 6054204836874c8cebb5fa3f9cfd6f84fb3cb5c96f27ac9945683dc5e2aac73fe4be3a652dd64d3cfab33bfc70703fb2283fcf553d1908eaba46a0b4c10a8c7c
7
+ data.tar.gz: d586f6ebb862c1e75fe55056cdf7138dc72db2a0e3f2c847563524d2889d44b5afb16dc4135681b7524e80c4d2081ae08719fdd46951e3a14631fa73fa84a504
@@ -140,6 +140,7 @@ module FormProps
140
140
  def fields_for_with_nested_attributes(association_name, association, options, block)
141
141
  name = "#{object_name}[#{association_name}_attributes]"
142
142
  association = convert_to_model(association)
143
+ json = @template.instance_variable_get(:@__json)
143
144
 
144
145
  if association.respond_to?(:persisted?)
145
146
  association = [association] if @object.public_send(association_name).respond_to?(:to_ary)
@@ -150,8 +151,8 @@ module FormProps
150
151
  if association.respond_to?(:to_ary)
151
152
  explicit_child_index = options[:child_index]
152
153
 
153
- @template.json.set!("#{association_name}_attributes") do
154
- @template.json.array! association do |child|
154
+ json.set!("#{association_name}_attributes") do
155
+ json.array! association do |child|
155
156
  if explicit_child_index
156
157
  options[:child_index] = explicit_child_index.call if explicit_child_index.respond_to?(:call)
157
158
  else
@@ -162,7 +163,7 @@ module FormProps
162
163
  end
163
164
  end
164
165
  elsif association
165
- @template.json.set!("#{association_name}_attributes") do
166
+ json.set!("#{association_name}_attributes") do
166
167
  fields_for_nested_model(name, association, options, block)
167
168
  end
168
169
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FormProps
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: form_props
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johny Ho
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-28 00:00:00.000000000 Z
11
+ date: 2023-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -106,7 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
- version: '2.5'
109
+ version: '2.7'
110
110
  required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  requirements:
112
112
  - - ">="