anchormodel 0.1.5 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +6 -6
- data/README.md +78 -2
- data/VERSION +1 -1
- data/anchormodel.gemspec +4 -4
- data/doc/Anchormodel/ActiveModelTypeValueMulti.html +410 -0
- data/doc/Anchormodel/ActiveModelTypeValueSingle.html +113 -31
- data/doc/Anchormodel/Attribute.html +109 -9
- data/doc/Anchormodel/ModelMixin.html +3 -92
- data/doc/Anchormodel/SimpleFormInputs/Helpers/AnchormodelInputsCommon.html +267 -0
- data/doc/Anchormodel/SimpleFormInputs/Helpers.html +124 -0
- data/doc/Anchormodel/SimpleFormInputs.html +124 -0
- data/doc/Anchormodel/Util.html +131 -15
- data/doc/Anchormodel/Version.html +3 -3
- data/doc/Anchormodel.html +97 -32
- data/doc/AnchormodelCheckBoxesInput.html +140 -0
- data/doc/AnchormodelGenerator.html +3 -3
- data/doc/AnchormodelInput.html +140 -0
- data/doc/AnchormodelRadioButtonsInput.html +140 -0
- data/doc/_index.html +16 -4
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +77 -5
- data/doc/frames.html +1 -1
- data/doc/index.html +77 -5
- data/doc/method_list.html +49 -9
- data/doc/top-level-namespace.html +4 -4
- data/lib/anchormodel/active_model_type_value_multi.rb +31 -0
- data/lib/anchormodel/active_model_type_value_single.rb +4 -2
- data/lib/anchormodel/attribute.rb +7 -1
- data/lib/anchormodel/model_mixin.rb +7 -0
- data/lib/anchormodel/simple_form_inputs/anchormodel_check_boxes_input.rb +23 -0
- data/lib/anchormodel/simple_form_inputs/helpers/anchormodel_inputs_common.rb +7 -3
- data/lib/anchormodel/util.rb +57 -7
- data/lib/anchormodel.rb +7 -0
- data/test/active_record_model/user_test.rb +73 -9
- data/test/dummy/app/anchormodels/animal.rb +6 -0
- data/test/dummy/app/models/user.rb +1 -0
- data/test/dummy/db/migrate/20240425182000_add_animals_to_users.rb +5 -0
- data/test/dummy/db/schema.rb +2 -1
- metadata +13 -2
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Anchormodel::ActiveModelTypeValueSingle
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.34
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -117,11 +117,47 @@
|
|
117
117
|
|
118
118
|
</ul>
|
119
119
|
|
120
|
+
</div><div id="subclasses">
|
121
|
+
<h2>Direct Known Subclasses</h2>
|
122
|
+
<p class="children"><span class='object_link'><a href="ActiveModelTypeValueMulti.html" title="Anchormodel::ActiveModelTypeValueMulti (class)">ActiveModelTypeValueMulti</a></span></p>
|
120
123
|
</div>
|
121
124
|
|
122
125
|
|
123
126
|
|
124
127
|
|
128
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
129
|
+
<ul class="summary">
|
130
|
+
|
131
|
+
<li class="public ">
|
132
|
+
<span class="summary_signature">
|
133
|
+
|
134
|
+
<a href="#attribute-instance_method" title="#attribute (instance method)">#<strong>attribute</strong> ⇒ Object </a>
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
</span>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
<span class="note title readonly">readonly</span>
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
154
|
+
|
155
|
+
</li>
|
156
|
+
|
157
|
+
|
158
|
+
</ul>
|
159
|
+
|
160
|
+
|
125
161
|
|
126
162
|
|
127
163
|
|
@@ -150,7 +186,7 @@
|
|
150
186
|
|
151
187
|
|
152
188
|
<span class="summary_desc"><div class='inline'>
|
153
|
-
<p>This converts
|
189
|
+
<p>This converts DB or input to an Anchormodel instance.</p>
|
154
190
|
</div></span>
|
155
191
|
|
156
192
|
</li>
|
@@ -244,7 +280,7 @@
|
|
244
280
|
|
245
281
|
|
246
282
|
<span class="summary_desc"><div class='inline'>
|
247
|
-
<p>This converts
|
283
|
+
<p>This converts an Anchormodel instance to string for DB.</p>
|
248
284
|
</div></span>
|
249
285
|
|
250
286
|
</li>
|
@@ -305,13 +341,13 @@
|
|
305
341
|
<pre class="lines">
|
306
342
|
|
307
343
|
|
308
|
-
3
|
309
|
-
4
|
310
344
|
5
|
311
|
-
6
|
345
|
+
6
|
346
|
+
7
|
347
|
+
8</pre>
|
312
348
|
</td>
|
313
349
|
<td>
|
314
|
-
<pre class="code"><span class="info file"># File 'lib/anchormodel/active_model_type_value_single.rb', line
|
350
|
+
<pre class="code"><span class="info file"># File 'lib/anchormodel/active_model_type_value_single.rb', line 5</span>
|
315
351
|
|
316
352
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_attribute'>attribute</span><span class='rparen'>)</span>
|
317
353
|
<span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
@@ -324,6 +360,52 @@
|
|
324
360
|
|
325
361
|
</div>
|
326
362
|
|
363
|
+
<div id="instance_attr_details" class="attr_details">
|
364
|
+
<h2>Instance Attribute Details</h2>
|
365
|
+
|
366
|
+
|
367
|
+
<span id=""></span>
|
368
|
+
<div class="method_details first">
|
369
|
+
<h3 class="signature first" id="attribute-instance_method">
|
370
|
+
|
371
|
+
#<strong>attribute</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
</h3><div class="docstring">
|
378
|
+
<div class="discussion">
|
379
|
+
|
380
|
+
|
381
|
+
</div>
|
382
|
+
</div>
|
383
|
+
<div class="tags">
|
384
|
+
|
385
|
+
|
386
|
+
</div><table class="source_code">
|
387
|
+
<tr>
|
388
|
+
<td>
|
389
|
+
<pre class="lines">
|
390
|
+
|
391
|
+
|
392
|
+
3
|
393
|
+
4
|
394
|
+
5</pre>
|
395
|
+
</td>
|
396
|
+
<td>
|
397
|
+
<pre class="code"><span class="info file"># File 'lib/anchormodel/active_model_type_value_single.rb', line 3</span>
|
398
|
+
|
399
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_attribute'>attribute</span>
|
400
|
+
<span class='ivar'>@attribute</span>
|
401
|
+
<span class='kw'>end</span></pre>
|
402
|
+
</td>
|
403
|
+
</tr>
|
404
|
+
</table>
|
405
|
+
</div>
|
406
|
+
|
407
|
+
</div>
|
408
|
+
|
327
409
|
|
328
410
|
<div id="instance_method_details" class="method_details_list">
|
329
411
|
<h2>Instance Method Details</h2>
|
@@ -341,7 +423,7 @@
|
|
341
423
|
</h3><div class="docstring">
|
342
424
|
<div class="discussion">
|
343
425
|
|
344
|
-
<p>This converts
|
426
|
+
<p>This converts DB or input to an Anchormodel instance</p>
|
345
427
|
|
346
428
|
|
347
429
|
</div>
|
@@ -355,14 +437,14 @@
|
|
355
437
|
<pre class="lines">
|
356
438
|
|
357
439
|
|
358
|
-
13
|
359
|
-
14
|
360
440
|
15
|
361
441
|
16
|
362
|
-
17
|
442
|
+
17
|
443
|
+
18
|
444
|
+
19</pre>
|
363
445
|
</td>
|
364
446
|
<td>
|
365
|
-
<pre class="code"><span class="info file"># File 'lib/anchormodel/active_model_type_value_single.rb', line
|
447
|
+
<pre class="code"><span class="info file"># File 'lib/anchormodel/active_model_type_value_single.rb', line 15</span>
|
366
448
|
|
367
449
|
<span class='kw'>def</span> <span class='id identifier rubyid_cast'>cast</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
368
450
|
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_presence'>presence</span>
|
@@ -411,13 +493,13 @@
|
|
411
493
|
<pre class="lines">
|
412
494
|
|
413
495
|
|
414
|
-
48
|
415
|
-
49
|
416
496
|
50
|
417
|
-
51
|
497
|
+
51
|
498
|
+
52
|
499
|
+
53</pre>
|
418
500
|
</td>
|
419
501
|
<td>
|
420
|
-
<pre class="code"><span class="info file"># File 'lib/anchormodel/active_model_type_value_single.rb', line
|
502
|
+
<pre class="code"><span class="info file"># File 'lib/anchormodel/active_model_type_value_single.rb', line 50</span>
|
421
503
|
|
422
504
|
<span class='kw'>def</span> <span class='id identifier rubyid_changed_in_place?'>changed_in_place?</span><span class='lparen'>(</span><span class='id identifier rubyid_raw_old_value'>raw_old_value</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
423
505
|
<span class='id identifier rubyid_old_value'>old_value</span> <span class='op'>=</span> <span class='id identifier rubyid_deserialize'>deserialize</span><span class='lparen'>(</span><span class='id identifier rubyid_raw_old_value'>raw_old_value</span><span class='rparen'>)</span>
|
@@ -465,8 +547,6 @@
|
|
465
547
|
<pre class="lines">
|
466
548
|
|
467
549
|
|
468
|
-
37
|
469
|
-
38
|
470
550
|
39
|
471
551
|
40
|
472
552
|
41
|
@@ -474,10 +554,12 @@
|
|
474
554
|
43
|
475
555
|
44
|
476
556
|
45
|
477
|
-
46
|
557
|
+
46
|
558
|
+
47
|
559
|
+
48</pre>
|
478
560
|
</td>
|
479
561
|
<td>
|
480
|
-
<pre class="code"><span class="info file"># File 'lib/anchormodel/active_model_type_value_single.rb', line
|
562
|
+
<pre class="code"><span class="info file"># File 'lib/anchormodel/active_model_type_value_single.rb', line 39</span>
|
481
563
|
|
482
564
|
<span class='kw'>def</span> <span class='id identifier rubyid_serializable?'>serializable?</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
483
565
|
<span class='kw'>return</span> <span class='kw'>case</span> <span class='id identifier rubyid_value'>value</span>
|
@@ -506,7 +588,7 @@
|
|
506
588
|
</h3><div class="docstring">
|
507
589
|
<div class="discussion">
|
508
590
|
|
509
|
-
<p>This converts
|
591
|
+
<p>This converts an Anchormodel instance to string for DB</p>
|
510
592
|
|
511
593
|
|
512
594
|
</div>
|
@@ -520,8 +602,6 @@
|
|
520
602
|
<pre class="lines">
|
521
603
|
|
522
604
|
|
523
|
-
20
|
524
|
-
21
|
525
605
|
22
|
526
606
|
23
|
527
607
|
24
|
@@ -535,10 +615,12 @@
|
|
535
615
|
32
|
536
616
|
33
|
537
617
|
34
|
538
|
-
35
|
618
|
+
35
|
619
|
+
36
|
620
|
+
37</pre>
|
539
621
|
</td>
|
540
622
|
<td>
|
541
|
-
<pre class="code"><span class="info file"># File 'lib/anchormodel/active_model_type_value_single.rb', line
|
623
|
+
<pre class="code"><span class="info file"># File 'lib/anchormodel/active_model_type_value_single.rb', line 22</span>
|
542
624
|
|
543
625
|
<span class='kw'>def</span> <span class='id identifier rubyid_serialize'>serialize</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
544
626
|
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_presence'>presence</span>
|
@@ -585,12 +667,12 @@
|
|
585
667
|
<pre class="lines">
|
586
668
|
|
587
669
|
|
588
|
-
|
589
|
-
|
590
|
-
|
670
|
+
10
|
671
|
+
11
|
672
|
+
12</pre>
|
591
673
|
</td>
|
592
674
|
<td>
|
593
|
-
<pre class="code"><span class="info file"># File 'lib/anchormodel/active_model_type_value_single.rb', line
|
675
|
+
<pre class="code"><span class="info file"># File 'lib/anchormodel/active_model_type_value_single.rb', line 10</span>
|
594
676
|
|
595
677
|
<span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span>
|
596
678
|
<span class='symbol'>:anchormodel</span>
|
@@ -605,9 +687,9 @@
|
|
605
687
|
</div>
|
606
688
|
|
607
689
|
<div id="footer">
|
608
|
-
Generated on Wed
|
690
|
+
Generated on Wed May 22 11:24:43 2024 by
|
609
691
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
610
|
-
0.9.
|
692
|
+
0.9.34 (ruby-3.2.2).
|
611
693
|
</div>
|
612
694
|
|
613
695
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Anchormodel::Attribute
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.34
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -214,7 +214,7 @@
|
|
214
214
|
<li class="public ">
|
215
215
|
<span class="summary_signature">
|
216
216
|
|
217
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(model_class, attribute_name, anchormodel_class = nil, optional = false) ⇒ Attribute </a>
|
217
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(model_class, attribute_name, anchormodel_class = nil, optional = false, multiple = false) ⇒ Attribute </a>
|
218
218
|
|
219
219
|
|
220
220
|
|
@@ -234,6 +234,28 @@
|
|
234
234
|
<p>A new instance of Attribute.</p>
|
235
235
|
</div></span>
|
236
236
|
|
237
|
+
</li>
|
238
|
+
|
239
|
+
|
240
|
+
<li class="public ">
|
241
|
+
<span class="summary_signature">
|
242
|
+
|
243
|
+
<a href="#multiple%3F-instance_method" title="#multiple? (instance method)">#<strong>multiple?</strong> ⇒ Boolean </a>
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
</span>
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
258
|
+
|
237
259
|
</li>
|
238
260
|
|
239
261
|
|
@@ -246,7 +268,7 @@
|
|
246
268
|
<div class="method_details first">
|
247
269
|
<h3 class="signature first" id="initialize-instance_method">
|
248
270
|
|
249
|
-
#<strong>initialize</strong>(model_class, attribute_name, anchormodel_class = nil, optional = false) ⇒ <tt><span class='object_link'><a href="" title="Anchormodel::Attribute (class)">Attribute</a></span></tt>
|
271
|
+
#<strong>initialize</strong>(model_class, attribute_name, anchormodel_class = nil, optional = false, multiple = false) ⇒ <tt><span class='object_link'><a href="" title="Anchormodel::Attribute (class)">Attribute</a></span></tt>
|
250
272
|
|
251
273
|
|
252
274
|
|
@@ -328,6 +350,24 @@
|
|
328
350
|
—
|
329
351
|
<div class='inline'>
|
330
352
|
<p>If true, a presence validation is added to the model.</p>
|
353
|
+
</div>
|
354
|
+
|
355
|
+
</li>
|
356
|
+
|
357
|
+
<li>
|
358
|
+
|
359
|
+
<span class='name'>multiple</span>
|
360
|
+
|
361
|
+
|
362
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
363
|
+
|
364
|
+
|
365
|
+
<em class="default">(defaults to: <tt>false</tt>)</em>
|
366
|
+
|
367
|
+
|
368
|
+
—
|
369
|
+
<div class='inline'>
|
370
|
+
<p>If true, this attribute holds multiple anchormodels.</p>
|
331
371
|
</div>
|
332
372
|
|
333
373
|
</li>
|
@@ -341,21 +381,23 @@
|
|
341
381
|
<pre class="lines">
|
342
382
|
|
343
383
|
|
344
|
-
13
|
345
384
|
14
|
346
385
|
15
|
347
386
|
16
|
348
387
|
17
|
349
|
-
18
|
388
|
+
18
|
389
|
+
19
|
390
|
+
20</pre>
|
350
391
|
</td>
|
351
392
|
<td>
|
352
|
-
<pre class="code"><span class="info file"># File 'lib/anchormodel/attribute.rb', line
|
393
|
+
<pre class="code"><span class="info file"># File 'lib/anchormodel/attribute.rb', line 14</span>
|
353
394
|
|
354
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_model_class'>model_class</span><span class='comma'>,</span> <span class='id identifier rubyid_attribute_name'>attribute_name</span><span class='comma'>,</span> <span class='id identifier rubyid_anchormodel_class'>anchormodel_class</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_optional'>optional</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
395
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_model_class'>model_class</span><span class='comma'>,</span> <span class='id identifier rubyid_attribute_name'>attribute_name</span><span class='comma'>,</span> <span class='id identifier rubyid_anchormodel_class'>anchormodel_class</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_optional'>optional</span> <span class='op'>=</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='id identifier rubyid_multiple'>multiple</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
355
396
|
<span class='ivar'>@model_class</span> <span class='op'>=</span> <span class='id identifier rubyid_model_class'>model_class</span>
|
356
397
|
<span class='ivar'>@attribute_name</span> <span class='op'>=</span> <span class='id identifier rubyid_attribute_name'>attribute_name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
357
398
|
<span class='ivar'>@anchormodel_class</span> <span class='op'>=</span> <span class='id identifier rubyid_anchormodel_class'>anchormodel_class</span>
|
358
399
|
<span class='ivar'>@optional</span> <span class='op'>=</span> <span class='id identifier rubyid_optional'>optional</span>
|
400
|
+
<span class='ivar'>@multiple</span> <span class='op'>=</span> <span class='id identifier rubyid_multiple'>multiple</span>
|
359
401
|
<span class='kw'>end</span></pre>
|
360
402
|
</td>
|
361
403
|
</tr>
|
@@ -493,12 +535,70 @@
|
|
493
535
|
</div>
|
494
536
|
|
495
537
|
|
538
|
+
<div id="instance_method_details" class="method_details_list">
|
539
|
+
<h2>Instance Method Details</h2>
|
540
|
+
|
541
|
+
|
542
|
+
<div class="method_details first">
|
543
|
+
<h3 class="signature first" id="multiple?-instance_method">
|
544
|
+
|
545
|
+
#<strong>multiple?</strong> ⇒ <tt>Boolean</tt>
|
546
|
+
|
547
|
+
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
</h3><div class="docstring">
|
552
|
+
<div class="discussion">
|
553
|
+
|
554
|
+
|
555
|
+
</div>
|
556
|
+
</div>
|
557
|
+
<div class="tags">
|
558
|
+
|
559
|
+
<p class="tag_title">Returns:</p>
|
560
|
+
<ul class="return">
|
561
|
+
|
562
|
+
<li>
|
563
|
+
|
564
|
+
|
565
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
566
|
+
|
567
|
+
|
568
|
+
|
569
|
+
</li>
|
570
|
+
|
571
|
+
</ul>
|
572
|
+
|
573
|
+
</div><table class="source_code">
|
574
|
+
<tr>
|
575
|
+
<td>
|
576
|
+
<pre class="lines">
|
577
|
+
|
578
|
+
|
579
|
+
22
|
580
|
+
23
|
581
|
+
24</pre>
|
582
|
+
</td>
|
583
|
+
<td>
|
584
|
+
<pre class="code"><span class="info file"># File 'lib/anchormodel/attribute.rb', line 22</span>
|
585
|
+
|
586
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_multiple?'>multiple?</span>
|
587
|
+
<span class='ivar'>@multiple</span>
|
588
|
+
<span class='kw'>end</span></pre>
|
589
|
+
</td>
|
590
|
+
</tr>
|
591
|
+
</table>
|
592
|
+
</div>
|
593
|
+
|
594
|
+
</div>
|
595
|
+
|
496
596
|
</div>
|
497
597
|
|
498
598
|
<div id="footer">
|
499
|
-
Generated on Wed
|
599
|
+
Generated on Wed May 22 11:24:43 2024 by
|
500
600
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
501
|
-
0.9.
|
601
|
+
0.9.34 (ruby-3.2.2).
|
502
602
|
</div>
|
503
603
|
|
504
604
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Anchormodel::ModelMixin
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.34
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -106,104 +106,15 @@
|
|
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) ⇒ 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
|
-
</ul>
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
109
|
|
147
|
-
<div id="class_method_details" class="method_details_list">
|
148
|
-
<h2>Class Method Details</h2>
|
149
|
-
|
150
|
-
|
151
|
-
<div class="method_details first">
|
152
|
-
<h3 class="signature first" id="belongs_to_anchormodel-class_method">
|
153
|
-
|
154
|
-
.<strong>belongs_to_anchormodel</strong>(*args, **kwargs) ⇒ <tt>Object</tt>
|
155
110
|
|
156
111
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
</h3><div class="docstring">
|
161
|
-
<div class="discussion">
|
162
|
-
|
163
|
-
<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>
|
164
|
-
|
165
|
-
|
166
|
-
</div>
|
167
|
-
</div>
|
168
|
-
<div class="tags">
|
169
|
-
|
170
|
-
|
171
|
-
<p class="tag_title">See Also:</p>
|
172
|
-
<ul class="see">
|
173
|
-
|
174
|
-
<li>Parameters</li>
|
175
|
-
|
176
|
-
</ul>
|
177
|
-
|
178
|
-
</div><table class="source_code">
|
179
|
-
<tr>
|
180
|
-
<td>
|
181
|
-
<pre class="lines">
|
182
|
-
|
183
|
-
|
184
|
-
14
|
185
|
-
15
|
186
|
-
16</pre>
|
187
|
-
</td>
|
188
|
-
<td>
|
189
|
-
<pre class="code"><span class="info file"># File 'lib/anchormodel/model_mixin.rb', line 14</span>
|
190
|
-
|
191
|
-
<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>
|
192
|
-
<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>
|
193
|
-
<span class='kw'>end</span></pre>
|
194
|
-
</td>
|
195
|
-
</tr>
|
196
|
-
</table>
|
197
|
-
</div>
|
198
|
-
|
199
|
-
</div>
|
200
|
-
|
201
112
|
</div>
|
202
113
|
|
203
114
|
<div id="footer">
|
204
|
-
Generated on Wed
|
115
|
+
Generated on Wed May 22 11:24:43 2024 by
|
205
116
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
206
|
-
0.9.
|
117
|
+
0.9.34 (ruby-3.2.2).
|
207
118
|
</div>
|
208
119
|
|
209
120
|
</div>
|