anchormodel 0.2.2 → 0.2.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: a9eebd14815541c3006409bb03f45b0155db2eb083511a09f228bf57ee68dd8a
4
- data.tar.gz: a359a0970ec983f9f50de59edb2355fa960db401a03febed48ade509d1e977ae
3
+ metadata.gz: 07bc0ce1f755bae4c92dfd6fa7c80e33b60ed348482ea8c25a6a1a65b10d8ef0
4
+ data.tar.gz: ea624e7f77d9b04bb2affdb86683e5f50cd102357a7a6d8ad3a6d82dfb00c4ab
5
5
  SHA512:
6
- metadata.gz: 1a4df45b4cbbc8c5235ddd8b52cb1e79639f2d253ffbd627e151fdeef1102584ea9280f0b383f5ac608f395a6b26d946e299b2e810e2609509d1147e2c28f1d5
7
- data.tar.gz: 90598b9ec18955a30519e8b0fae7e8986f16ecc9c7ee00f8c9d8025118199680e735914527bc3ea35ff3e12800e67f66feacd7695af0951adcc1350063216d72
6
+ metadata.gz: 2b39a0f238bc979f960a81bf9ff117c7be02e74a7bf942e075cd29586120c53f2d8158753db132733b3cb6099faad94e7a076079613711404a7fd69c3a1b1ef9
7
+ data.tar.gz: 31e6137480ca09a3d2eb0624c70e43f02494a4c2e7b2ecc4c671f032304d6956d75c8fc53959564447362230ef57ab3519ff741fa27b65377e50982657dcfaa6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 0.2.4 (06.11.2024)
2
+
3
+ - Implement `YourConstant.first` as a shorthand for `YourConstant.all.first` to avoid Rubocop problems
4
+
5
+ # 0.2.3 (01.11.2024)
6
+
7
+ - Relax Rails dependency
8
+
1
9
  # 0.2.2 (14.08.2024)
2
10
 
3
11
  - Allow passing `anchormodel_attribute` explicitely to `anchormodel` input and enhance error message
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- anchormodel (0.2.2)
4
+ anchormodel (0.2.3.edge)
5
5
  rails (~> 7.0)
6
6
 
7
7
  GEM
@@ -79,7 +79,7 @@ GEM
79
79
  concurrent-ruby (1.1.10)
80
80
  crass (1.0.6)
81
81
  date (3.3.4)
82
- erubi (1.12.0)
82
+ erubi (1.13.0)
83
83
  globalid (1.2.1)
84
84
  activesupport (>= 6.1)
85
85
  i18n (1.12.0)
@@ -102,7 +102,7 @@ GEM
102
102
  builder
103
103
  minitest (>= 5.0)
104
104
  ruby-progressbar
105
- net-imap (0.4.12)
105
+ net-imap (0.4.14)
106
106
  date
107
107
  net-protocol
108
108
  net-pop (0.1.2)
@@ -112,7 +112,7 @@ GEM
112
112
  net-smtp (0.5.0)
113
113
  net-protocol
114
114
  nio4r (2.7.3)
115
- nokogiri (1.16.5-x86_64-linux)
115
+ nokogiri (1.16.7-x86_64-linux)
116
116
  racc (~> 1.4)
117
117
  parallel (1.22.1)
118
118
  parser (3.2.0.0)
@@ -120,7 +120,7 @@ GEM
120
120
  pry (0.14.1)
121
121
  coderay (~> 1.1)
122
122
  method_source (~> 1.0)
123
- racc (1.8.0)
123
+ racc (1.8.1)
124
124
  rack (2.2.5)
125
125
  rack-test (2.1.0)
126
126
  rack (>= 1.3)
@@ -187,7 +187,7 @@ GEM
187
187
  webrick (~> 1.7.0)
188
188
  yard-activesupport-concern (0.0.1)
189
189
  yard (>= 0.8)
190
- zeitwerk (2.6.15)
190
+ zeitwerk (2.6.17)
191
191
 
192
192
  PLATFORMS
193
193
  x86_64-linux
data/Rakefile CHANGED
@@ -16,7 +16,7 @@ task :gemspec do
16
16
  s.homepage = 'https://github.com/kalsan/anchormodel'
17
17
 
18
18
  # Dependencies
19
- s.add_runtime_dependency 'rails', '~> 7.0'
19
+ s.add_runtime_dependency 'rails', '>= 7.0'
20
20
 
21
21
  s.add_development_dependency 'rake', '~> 13.0.6'
22
22
  s.add_development_dependency 'pry', '~> 0.14.1'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.4
data/anchormodel.gemspec CHANGED
@@ -2,26 +2,26 @@
2
2
  # This file is auto-generated via: 'rake gemspec'.
3
3
 
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: anchormodel 0.2.2 ruby lib
5
+ # stub: anchormodel 0.2.4 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "anchormodel".freeze
9
- s.version = "0.2.2".freeze
9
+ s.version = "0.2.4".freeze
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Sandro Kalbermatter".freeze]
14
- s.date = "2024-08-14"
14
+ s.date = "2024-11-06"
15
15
  s.files = [".gitignore".freeze, ".ruby-version".freeze, ".yardopts".freeze, "CHANGELOG.md".freeze, "Gemfile".freeze, "Gemfile.lock".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "VERSION".freeze, "anchormodel.gemspec".freeze, "bin/rails".freeze, "doc/Anchormodel.html".freeze, "doc/Anchormodel/ActiveModelTypeValue.html".freeze, "doc/Anchormodel/ActiveModelTypeValueMulti.html".freeze, "doc/Anchormodel/ActiveModelTypeValueSingle.html".freeze, "doc/Anchormodel/Attribute.html".freeze, "doc/Anchormodel/ModelMixin.html".freeze, "doc/Anchormodel/SimpleFormInputs.html".freeze, "doc/Anchormodel/SimpleFormInputs/Helpers.html".freeze, "doc/Anchormodel/SimpleFormInputs/Helpers/AnchormodelInputsCommon.html".freeze, "doc/Anchormodel/Util.html".freeze, "doc/Anchormodel/Version.html".freeze, "doc/AnchormodelCheckBoxesInput.html".freeze, "doc/AnchormodelGenerator.html".freeze, "doc/AnchormodelInput.html".freeze, "doc/AnchormodelRadioButtonsInput.html".freeze, "doc/_index.html".freeze, "doc/class_list.html".freeze, "doc/css/common.css".freeze, "doc/css/full_list.css".freeze, "doc/css/style.css".freeze, "doc/file.README.html".freeze, "doc/file_list.html".freeze, "doc/frames.html".freeze, "doc/index.html".freeze, "doc/js/app.js".freeze, "doc/js/full_list.js".freeze, "doc/js/jquery.js".freeze, "doc/method_list.html".freeze, "doc/top-level-namespace.html".freeze, "lib/anchormodel.rb".freeze, "lib/anchormodel/active_model_type_value_multi.rb".freeze, "lib/anchormodel/active_model_type_value_single.rb".freeze, "lib/anchormodel/attribute.rb".freeze, "lib/anchormodel/model_mixin.rb".freeze, "lib/anchormodel/simple_form_inputs/anchormodel_check_boxes_input.rb".freeze, "lib/anchormodel/simple_form_inputs/anchormodel_input.rb".freeze, "lib/anchormodel/simple_form_inputs/anchormodel_radio_buttons_input.rb".freeze, "lib/anchormodel/simple_form_inputs/helpers/anchormodel_inputs_common.rb".freeze, "lib/anchormodel/util.rb".freeze, "lib/anchormodel/version.rb".freeze, "lib/generators/anchormodel/USAGE".freeze, "lib/generators/anchormodel/anchormodel_generator.rb".freeze, "lib/generators/anchormodel/templates/anchormodel.rb.erb".freeze, "logo.svg".freeze, "test/active_record_model/user_test.rb".freeze, "test/dummy/.gitignore".freeze, "test/dummy/Rakefile".freeze, "test/dummy/app/anchormodels/animal.rb".freeze, "test/dummy/app/anchormodels/locale.rb".freeze, "test/dummy/app/anchormodels/role.rb".freeze, "test/dummy/app/helpers/application_helper.rb".freeze, "test/dummy/app/models/application_record.rb".freeze, "test/dummy/app/models/concerns/.keep".freeze, "test/dummy/app/models/user.rb".freeze, "test/dummy/bin/rails".freeze, "test/dummy/bin/rake".freeze, "test/dummy/bin/setup".freeze, "test/dummy/config.ru".freeze, "test/dummy/config/application.rb".freeze, "test/dummy/config/boot.rb".freeze, "test/dummy/config/credentials.yml.enc".freeze, "test/dummy/config/database.yml".freeze, "test/dummy/config/environment.rb".freeze, "test/dummy/config/environments/test.rb".freeze, "test/dummy/config/initializers/content_security_policy.rb".freeze, "test/dummy/config/initializers/filter_parameter_logging.rb".freeze, "test/dummy/config/initializers/inflections.rb".freeze, "test/dummy/config/initializers/permissions_policy.rb".freeze, "test/dummy/config/locales/en.yml".freeze, "test/dummy/config/puma.rb".freeze, "test/dummy/config/routes.rb".freeze, "test/dummy/db/migrate/20230107173151_create_users.rb".freeze, "test/dummy/db/migrate/20240425182000_add_animals_to_users.rb".freeze, "test/dummy/db/schema.rb".freeze, "test/dummy/db/seeds.rb".freeze, "test/dummy/lib/tasks/.keep".freeze, "test/dummy/log/.keep".freeze, "test/dummy/tmp/.keep".freeze, "test/dummy/tmp/pids/.keep".freeze, "test/test_helper.rb".freeze]
16
16
  s.homepage = "https://github.com/kalsan/anchormodel".freeze
17
17
  s.licenses = ["LGPL-3.0-or-later".freeze]
18
18
  s.required_ruby_version = Gem::Requirement.new(">= 3.0.0".freeze)
19
- s.rubygems_version = "3.5.11".freeze
19
+ s.rubygems_version = "3.5.22".freeze
20
20
  s.summary = "Bringing object-oriented programming to Rails enums".freeze
21
21
 
22
22
  s.specification_version = 4
23
23
 
24
- s.add_runtime_dependency(%q<rails>.freeze, ["~> 7.0".freeze])
24
+ s.add_runtime_dependency(%q<rails>.freeze, [">= 7.0".freeze])
25
25
  s.add_development_dependency(%q<rake>.freeze, ["~> 13.0.6".freeze])
26
26
  s.add_development_dependency(%q<pry>.freeze, ["~> 0.14.1".freeze])
27
27
  s.add_development_dependency(%q<rubocop>.freeze, ["~> 1.43.0".freeze])
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Anchormodel::ActiveModelTypeValueMulti
8
8
 
9
- &mdash; Documentation by YARD 0.9.34
9
+ &mdash; Documentation by YARD 0.9.37
10
10
 
11
11
  </title>
12
12
 
@@ -400,9 +400,9 @@
400
400
  </div>
401
401
 
402
402
  <div id="footer">
403
- Generated on Wed May 22 11:24:47 2024 by
403
+ Generated on Wed Nov 6 17:50:34 2024 by
404
404
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
405
- 0.9.34 (ruby-3.2.2).
405
+ 0.9.37 (ruby-3.3.5).
406
406
  </div>
407
407
 
408
408
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Anchormodel::ActiveModelTypeValueSingle
8
8
 
9
- &mdash; Documentation by YARD 0.9.34
9
+ &mdash; Documentation by YARD 0.9.37
10
10
 
11
11
  </title>
12
12
 
@@ -687,9 +687,9 @@
687
687
  </div>
688
688
 
689
689
  <div id="footer">
690
- Generated on Wed May 22 11:24:47 2024 by
690
+ Generated on Wed Nov 6 17:50:34 2024 by
691
691
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
692
- 0.9.34 (ruby-3.2.2).
692
+ 0.9.37 (ruby-3.3.5).
693
693
  </div>
694
694
 
695
695
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Anchormodel::Attribute
8
8
 
9
- &mdash; Documentation by YARD 0.9.34
9
+ &mdash; Documentation by YARD 0.9.37
10
10
 
11
11
  </title>
12
12
 
@@ -596,9 +596,9 @@
596
596
  </div>
597
597
 
598
598
  <div id="footer">
599
- Generated on Wed May 22 11:24:47 2024 by
599
+ Generated on Wed Nov 6 17:50:34 2024 by
600
600
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
601
- 0.9.34 (ruby-3.2.2).
601
+ 0.9.37 (ruby-3.3.5).
602
602
  </div>
603
603
 
604
604
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Anchormodel::ModelMixin
8
8
 
9
- &mdash; Documentation by YARD 0.9.34
9
+ &mdash; Documentation by YARD 0.9.37
10
10
 
11
11
  </title>
12
12
 
@@ -106,15 +106,176 @@
106
106
 
107
107
 
108
108
 
109
+
110
+ <h2>
111
+ Class Method Summary
112
+ <small><a href="#" class="summary_toggle">collapse</a></small>
113
+ </h2>
114
+
115
+ <ul class="summary">
116
+
117
+ <li class="public ">
118
+ <span class="summary_signature">
119
+
120
+ <a href="#belongs_to_anchormodel-class_method" title="belongs_to_anchormodel (class method)">.<strong>belongs_to_anchormodel</strong>(*args, **kwargs) &#x21d2; Object </a>
121
+
122
+
123
+
124
+ </span>
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+ <span class="summary_desc"><div class='inline'>
135
+ <p>Creates an attribute linking to an Anchormodel.</p>
136
+ </div></span>
137
+
138
+ </li>
139
+
140
+
141
+ <li class="public ">
142
+ <span class="summary_signature">
143
+
144
+ <a href="#belongs_to_anchormodels-class_method" title="belongs_to_anchormodels (class method)">.<strong>belongs_to_anchormodels</strong>(*args, **kwargs) &#x21d2; Object </a>
145
+
146
+
147
+
148
+ </span>
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+ <span class="summary_desc"><div class='inline'>
159
+ <p>Creates an attribute linking to an array of Anchormodels.</p>
160
+ </div></span>
161
+
162
+ </li>
163
+
164
+
165
+ </ul>
166
+
167
+
168
+
169
+
170
+
171
+ <div id="class_method_details" class="method_details_list">
172
+ <h2>Class Method Details</h2>
173
+
174
+
175
+ <div class="method_details first">
176
+ <h3 class="signature first" id="belongs_to_anchormodel-class_method">
177
+
178
+ .<strong>belongs_to_anchormodel</strong>(*args, **kwargs) &#x21d2; <tt>Object</tt>
179
+
180
+
181
+
182
+
183
+
184
+ </h3><div class="docstring">
185
+ <div class="discussion">
186
+
187
+ <p>Creates an attribute linking to an Anchormodel. The attribute should be present in the DB and the column should be of type String and named the same as <code>attribute_name</code>.</p>
188
+
189
+
190
+ </div>
191
+ </div>
192
+ <div class="tags">
193
+
194
+
195
+ <p class="tag_title">See Also:</p>
196
+ <ul class="see">
197
+
198
+ <li>Parameters</li>
199
+
200
+ </ul>
201
+
202
+ </div><table class="source_code">
203
+ <tr>
204
+ <td>
205
+ <pre class="lines">
206
+
207
+
208
+ 14
209
+ 15
210
+ 16</pre>
211
+ </td>
212
+ <td>
213
+ <pre class="code"><span class="info file"># File 'lib/anchormodel/model_mixin.rb', line 14</span>
214
+
215
+ <span class='kw'>def</span> <span class='id identifier rubyid_belongs_to_anchormodel'>belongs_to_anchormodel</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='rparen'>)</span>
216
+ <span class='const'><span class='object_link'><a href="../Anchormodel.html" title="Anchormodel (class)">Anchormodel</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Util.html" title="Anchormodel::Util (module)">Util</a></span></span><span class='period'>.</span><span class='id identifier rubyid_install_methods_in_model'><span class='object_link'><a href="Util.html#install_methods_in_model-class_method" title="Anchormodel::Util.install_methods_in_model (method)">install_methods_in_model</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='rparen'>)</span>
217
+ <span class='kw'>end</span></pre>
218
+ </td>
219
+ </tr>
220
+ </table>
221
+ </div>
222
+
223
+ <div class="method_details ">
224
+ <h3 class="signature " id="belongs_to_anchormodels-class_method">
225
+
226
+ .<strong>belongs_to_anchormodels</strong>(*args, **kwargs) &#x21d2; <tt>Object</tt>
227
+
228
+
229
+
109
230
 
110
231
 
232
+ </h3><div class="docstring">
233
+ <div class="discussion">
234
+
235
+ <p>Creates an attribute linking to an array of Anchormodels. The attribute should be present in the DB and the column should be named the singular of <code>attribute_name</code>.</p>
236
+
237
+
238
+ </div>
239
+ </div>
240
+ <div class="tags">
241
+
242
+
243
+ <p class="tag_title">See Also:</p>
244
+ <ul class="see">
245
+
246
+ <li>Parameters</li>
247
+
248
+ </ul>
249
+
250
+ </div><table class="source_code">
251
+ <tr>
252
+ <td>
253
+ <pre class="lines">
254
+
255
+
256
+ 21
257
+ 22
258
+ 23</pre>
259
+ </td>
260
+ <td>
261
+ <pre class="code"><span class="info file"># File 'lib/anchormodel/model_mixin.rb', line 21</span>
262
+
263
+ <span class='kw'>def</span> <span class='id identifier rubyid_belongs_to_anchormodels'>belongs_to_anchormodels</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='rparen'>)</span>
264
+ <span class='const'><span class='object_link'><a href="../Anchormodel.html" title="Anchormodel (class)">Anchormodel</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Util.html" title="Anchormodel::Util (module)">Util</a></span></span><span class='period'>.</span><span class='id identifier rubyid_install_methods_in_model'><span class='object_link'><a href="Util.html#install_methods_in_model-class_method" title="Anchormodel::Util.install_methods_in_model (method)">install_methods_in_model</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='comma'>,</span> <span class='label'>multiple:</span> <span class='kw'>true</span><span class='rparen'>)</span>
265
+ <span class='kw'>end</span></pre>
266
+ </td>
267
+ </tr>
268
+ </table>
269
+ </div>
270
+
271
+ </div>
111
272
 
112
273
  </div>
113
274
 
114
275
  <div id="footer">
115
- Generated on Wed May 22 11:24:47 2024 by
276
+ Generated on Wed Nov 6 17:50:34 2024 by
116
277
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
117
- 0.9.34 (ruby-3.2.2).
278
+ 0.9.37 (ruby-3.3.5).
118
279
  </div>
119
280
 
120
281
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Anchormodel::SimpleFormInputs::Helpers::AnchormodelInputsCommon
8
8
 
9
- &mdash; Documentation by YARD 0.9.34
9
+ &mdash; Documentation by YARD 0.9.37
10
10
 
11
11
  </title>
12
12
 
@@ -204,18 +204,30 @@
204
204
  39
205
205
  40
206
206
  41
207
- 42</pre>
207
+ 42
208
+ 43
209
+ 44
210
+ 45
211
+ 46
212
+ 47
213
+ 48</pre>
208
214
  </td>
209
215
  <td>
210
216
  <pre class="code"><span class="info file"># File 'lib/anchormodel/simple_form_inputs/helpers/anchormodel_inputs_common.rb', line 5</span>
211
217
 
212
218
  <span class='kw'>def</span> <span class='id identifier rubyid_input'>input</span><span class='lparen'>(</span><span class='id identifier rubyid_wrapper_options'>wrapper_options</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
213
- <span class='kw'>unless</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:anchormodel_attributes</span><span class='rparen'>)</span>
214
- <span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>The form field object does not appear to respond to `anchormodel_attributes`, \
215
- did you `include Anchormodel::ModelMixin` in your `application_record.rb`? Affected object: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
219
+ <span class='kw'>if</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span>
220
+ <span class='kw'>unless</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:anchormodel_attributes</span><span class='rparen'>)</span>
221
+ <span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>The form field object does not appear to respond to `anchormodel_attributes`, \
222
+ did you `include Anchormodel::ModelMixin` in your `application_record.rb`? Affected object: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
223
+ <span class='kw'>end</span>
224
+ <span class='id identifier rubyid_am_attr'>am_attr</span> <span class='op'>=</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_anchormodel_attributes'>anchormodel_attributes</span><span class='lbracket'>[</span><span class='ivar'>@attribute_name</span><span class='rbracket'>]</span>
225
+ <span class='kw'>elsif</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='symbol'>:anchormodel_attribute</span><span class='rparen'>)</span>
226
+ <span class='id identifier rubyid_am_attr'>am_attr</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:anchormodel_attribute</span><span class='rparen'>)</span>
227
+ <span class='kw'>else</span>
228
+ <span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>:anchormodel input requires either an object or the input option :anchormodel_attribute, but neither is set.</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
216
229
  <span class='kw'>end</span>
217
230
 
218
- <span class='id identifier rubyid_am_attr'>am_attr</span> <span class='op'>=</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_anchormodel_attributes'>anchormodel_attributes</span><span class='lbracket'>[</span><span class='ivar'>@attribute_name</span><span class='rbracket'>]</span>
219
231
  <span class='kw'>unless</span> <span class='id identifier rubyid_am_attr'>am_attr</span>
220
232
  <span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='ivar'>@attribute_name</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'> does not look like an Anchormodel attribute, is `belongs_to_anchormodel` called in your model? \
221
233
  Affected object: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
@@ -224,7 +236,7 @@ Affected object: </span><span class='embexpr_beg'>#{</span><span class='id ident
224
236
  <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:multiple</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_am_attr'>am_attr</span><span class='period'>.</span><span class='id identifier rubyid_multiple?'>multiple?</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:multiple</span><span class='rbracket'>]</span> <span class='op'>!=</span> <span class='kw'>false</span> <span class='comment'># allow overriding
225
237
  </span>
226
238
  <span class='comment'># Attempt to read selected key from html input options &quot;value&quot;, as the caller might not know that this is a select.
227
- </span> <span class='id identifier rubyid_selected_key'>selected_key</span> <span class='op'>=</span> <span class='id identifier rubyid_input_options'>input_options</span><span class='lbracket'>[</span><span class='symbol'>:value</span><span class='rbracket'>]</span>
239
+ </span> <span class='id identifier rubyid_selected_key'>selected_key</span> <span class='op'>=</span> <span class='id identifier rubyid_input_options'>input_options</span><span class='lbracket'>[</span><span class='symbol'>:value</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_presence'>presence</span> <span class='op'>||</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_dig'>dig</span><span class='lparen'>(</span><span class='symbol'>:input_html</span><span class='comma'>,</span> <span class='symbol'>:value</span><span class='rparen'>)</span>
228
240
  <span class='kw'>if</span> <span class='id identifier rubyid_selected_key'>selected_key</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_object'>object</span>
229
241
  <span class='comment'># No selected key override present and a model is present, use the model to find out what to select.
230
242
  </span> <span class='id identifier rubyid_selected_am'>selected_am</span> <span class='op'>=</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='ivar'>@attribute_name</span><span class='rparen'>)</span>
@@ -257,9 +269,9 @@ Affected object: </span><span class='embexpr_beg'>#{</span><span class='id ident
257
269
  </div>
258
270
 
259
271
  <div id="footer">
260
- Generated on Wed May 22 11:24:47 2024 by
272
+ Generated on Wed Nov 6 17:50:34 2024 by
261
273
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
262
- 0.9.34 (ruby-3.2.2).
274
+ 0.9.37 (ruby-3.3.5).
263
275
  </div>
264
276
 
265
277
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Anchormodel::SimpleFormInputs::Helpers
8
8
 
9
- &mdash; Documentation by YARD 0.9.34
9
+ &mdash; Documentation by YARD 0.9.37
10
10
 
11
11
  </title>
12
12
 
@@ -114,9 +114,9 @@
114
114
  </div>
115
115
 
116
116
  <div id="footer">
117
- Generated on Wed May 22 11:24:47 2024 by
117
+ Generated on Wed Nov 6 17:50:34 2024 by
118
118
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
119
- 0.9.34 (ruby-3.2.2).
119
+ 0.9.37 (ruby-3.3.5).
120
120
  </div>
121
121
 
122
122
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Anchormodel::SimpleFormInputs
8
8
 
9
- &mdash; Documentation by YARD 0.9.34
9
+ &mdash; Documentation by YARD 0.9.37
10
10
 
11
11
  </title>
12
12
 
@@ -114,9 +114,9 @@
114
114
  </div>
115
115
 
116
116
  <div id="footer">
117
- Generated on Wed May 22 11:24:47 2024 by
117
+ Generated on Wed Nov 6 17:50:34 2024 by
118
118
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
119
- 0.9.34 (ruby-3.2.2).
119
+ 0.9.37 (ruby-3.3.5).
120
120
  </div>
121
121
 
122
122
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Anchormodel::Util
8
8
 
9
- &mdash; Documentation by YARD 0.9.34
9
+ &mdash; Documentation by YARD 0.9.37
10
10
 
11
11
  </title>
12
12
 
@@ -602,9 +602,9 @@
602
602
  </div>
603
603
 
604
604
  <div id="footer">
605
- Generated on Wed May 22 11:24:47 2024 by
605
+ Generated on Wed Nov 6 17:50:34 2024 by
606
606
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
607
- 0.9.34 (ruby-3.2.2).
607
+ 0.9.37 (ruby-3.3.5).
608
608
  </div>
609
609
 
610
610
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Anchormodel::Version
8
8
 
9
- &mdash; Documentation by YARD 0.9.34
9
+ &mdash; Documentation by YARD 0.9.37
10
10
 
11
11
  </title>
12
12
 
@@ -129,9 +129,9 @@
129
129
  </div>
130
130
 
131
131
  <div id="footer">
132
- Generated on Wed May 22 11:24:47 2024 by
132
+ Generated on Wed Nov 6 17:50:34 2024 by
133
133
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
134
- 0.9.34 (ruby-3.2.2).
134
+ 0.9.37 (ruby-3.3.5).
135
135
  </div>
136
136
 
137
137
  </div>