dynamoid 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Dynamoid.gemspec +65 -3
- data/Gemfile +3 -0
- data/Gemfile.lock +6 -0
- data/README.markdown +117 -22
- data/Rakefile +22 -9
- data/VERSION +1 -1
- data/doc/.nojekyll +0 -0
- data/doc/Dynamoid.html +300 -0
- data/doc/Dynamoid/Adapter.html +1387 -0
- data/doc/Dynamoid/Adapter/AwsSdk.html +1561 -0
- data/doc/Dynamoid/Adapter/Local.html +1487 -0
- data/doc/Dynamoid/Associations.html +131 -0
- data/doc/Dynamoid/Associations/Association.html +1706 -0
- data/doc/Dynamoid/Associations/BelongsTo.html +339 -0
- data/doc/Dynamoid/Associations/ClassMethods.html +723 -0
- data/doc/Dynamoid/Associations/HasAndBelongsToMany.html +339 -0
- data/doc/Dynamoid/Associations/HasMany.html +339 -0
- data/doc/Dynamoid/Associations/HasOne.html +339 -0
- data/doc/Dynamoid/Components.html +202 -0
- data/doc/Dynamoid/Config.html +395 -0
- data/doc/Dynamoid/Config/Options.html +609 -0
- data/doc/Dynamoid/Criteria.html +131 -0
- data/doc/Dynamoid/Criteria/Chain.html +759 -0
- data/doc/Dynamoid/Criteria/ClassMethods.html +98 -0
- data/doc/Dynamoid/Document.html +512 -0
- data/doc/Dynamoid/Document/ClassMethods.html +581 -0
- data/doc/Dynamoid/Errors.html +118 -0
- data/doc/Dynamoid/Errors/DocumentNotValid.html +210 -0
- data/doc/Dynamoid/Errors/Error.html +130 -0
- data/doc/Dynamoid/Errors/InvalidField.html +133 -0
- data/doc/Dynamoid/Errors/MissingRangeKey.html +133 -0
- data/doc/Dynamoid/Fields.html +649 -0
- data/doc/Dynamoid/Fields/ClassMethods.html +264 -0
- data/doc/Dynamoid/Finders.html +128 -0
- data/doc/Dynamoid/Finders/ClassMethods.html +502 -0
- data/doc/Dynamoid/Indexes.html +308 -0
- data/doc/Dynamoid/Indexes/ClassMethods.html +351 -0
- data/doc/Dynamoid/Indexes/Index.html +1089 -0
- data/doc/Dynamoid/Persistence.html +653 -0
- data/doc/Dynamoid/Persistence/ClassMethods.html +568 -0
- data/doc/Dynamoid/Validations.html +399 -0
- data/doc/_index.html +439 -0
- data/doc/class_list.html +47 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +55 -0
- data/doc/css/style.css +322 -0
- data/doc/file.LICENSE.html +66 -0
- data/doc/file.README.html +279 -0
- data/doc/file_list.html +52 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +279 -0
- data/doc/js/app.js +205 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +16 -0
- data/doc/method_list.html +1054 -0
- data/doc/top-level-namespace.html +105 -0
- data/lib/dynamoid.rb +2 -1
- data/lib/dynamoid/adapter.rb +77 -6
- data/lib/dynamoid/adapter/aws_sdk.rb +96 -16
- data/lib/dynamoid/adapter/local.rb +84 -15
- data/lib/dynamoid/associations.rb +53 -4
- data/lib/dynamoid/associations/association.rb +154 -26
- data/lib/dynamoid/associations/belongs_to.rb +32 -6
- data/lib/dynamoid/associations/has_and_belongs_to_many.rb +29 -3
- data/lib/dynamoid/associations/has_many.rb +30 -4
- data/lib/dynamoid/associations/has_one.rb +26 -3
- data/lib/dynamoid/components.rb +7 -5
- data/lib/dynamoid/config.rb +15 -2
- data/lib/dynamoid/config/options.rb +8 -0
- data/lib/dynamoid/criteria.rb +7 -2
- data/lib/dynamoid/criteria/chain.rb +55 -8
- data/lib/dynamoid/document.rb +68 -7
- data/lib/dynamoid/errors.rb +17 -2
- data/lib/dynamoid/fields.rb +44 -1
- data/lib/dynamoid/finders.rb +32 -6
- data/lib/dynamoid/indexes.rb +22 -2
- data/lib/dynamoid/indexes/index.rb +48 -7
- data/lib/dynamoid/persistence.rb +111 -51
- data/lib/dynamoid/validations.rb +36 -0
- data/spec/app/models/address.rb +2 -1
- data/spec/app/models/camel_case.rb +11 -0
- data/spec/app/models/magazine.rb +4 -1
- data/spec/app/models/sponsor.rb +3 -1
- data/spec/app/models/subscription.rb +5 -1
- data/spec/app/models/user.rb +10 -1
- data/spec/dynamoid/associations/association_spec.rb +67 -1
- data/spec/dynamoid/associations/belongs_to_spec.rb +16 -1
- data/spec/dynamoid/associations/has_and_belongs_to_many_spec.rb +7 -0
- data/spec/dynamoid/associations/has_many_spec.rb +14 -0
- data/spec/dynamoid/associations/has_one_spec.rb +10 -1
- data/spec/dynamoid/criteria_spec.rb +5 -1
- data/spec/dynamoid/document_spec.rb +23 -3
- data/spec/dynamoid/fields_spec.rb +10 -1
- data/spec/dynamoid/indexes/index_spec.rb +19 -0
- data/spec/dynamoid/persistence_spec.rb +24 -0
- data/spec/dynamoid/validations_spec.rb +36 -0
- metadata +105 -4
@@ -0,0 +1,339 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: Dynamoid::Associations::BelongsTo
|
8
|
+
|
9
|
+
— Documentation by YARD 0.7.5
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
relpath = '../..';
|
19
|
+
if (relpath != '') relpath += '/';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
25
|
+
|
26
|
+
|
27
|
+
</head>
|
28
|
+
<body>
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<div id="header">
|
34
|
+
<div id="menu">
|
35
|
+
|
36
|
+
<a href="../../_index.html">Index (B)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../../Dynamoid.html" title="Dynamoid (module)">Dynamoid</a></span></span> » <span class='title'><span class='object_link'><a href="../Associations.html" title="Dynamoid::Associations (module)">Associations</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">BelongsTo</span>
|
40
|
+
|
41
|
+
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div id="search">
|
46
|
+
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
48
|
+
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
50
|
+
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
<div class="clear"></div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<iframe id="search_frame"></iframe>
|
58
|
+
|
59
|
+
<div id="content"><h1>Class: Dynamoid::Associations::BelongsTo
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
<dt class="r1">Inherits:</dt>
|
68
|
+
<dd class="r1">
|
69
|
+
<span class="inheritName">Object</span>
|
70
|
+
|
71
|
+
<ul class="fullTree">
|
72
|
+
<li>Object</li>
|
73
|
+
|
74
|
+
<li class="next">Dynamoid::Associations::BelongsTo</li>
|
75
|
+
|
76
|
+
</ul>
|
77
|
+
<a href="#" class="inheritanceTree">show all</a>
|
78
|
+
|
79
|
+
</dd>
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
<dt class="r2">Includes:</dt>
|
87
|
+
<dd class="r2"><span class='object_link'><a href="Association.html" title="Dynamoid::Associations::Association (module)">Association</a></span></dd>
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
<dt class="r1 last">Defined in:</dt>
|
94
|
+
<dd class="r1 last">lib/dynamoid/associations/belongs_to.rb</dd>
|
95
|
+
|
96
|
+
</dl>
|
97
|
+
<div class="clear"></div>
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
<h2>Instance Attribute Summary</h2>
|
106
|
+
|
107
|
+
<h3 class="inherited">Attributes included from <span class='object_link'><a href="Association.html" title="Dynamoid::Associations::Association (module)">Association</a></span></h3>
|
108
|
+
<p class="inherited"><span class='object_link'><a href="Association.html#name-instance_method" title="Dynamoid::Associations::Association#name (method)">#name</a></span>, <span class='object_link'><a href="Association.html#options-instance_method" title="Dynamoid::Associations::Association#options (method)">#options</a></span>, <span class='object_link'><a href="Association.html#query-instance_method" title="Dynamoid::Associations::Association#query (method)">#query</a></span>, <span class='object_link'><a href="Association.html#source-instance_method" title="Dynamoid::Associations::Association#source (method)">#source</a></span></p>
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
<h2>
|
113
|
+
Instance Method Summary
|
114
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
115
|
+
</h2>
|
116
|
+
|
117
|
+
<ul class="summary">
|
118
|
+
|
119
|
+
<li class="public ">
|
120
|
+
<span class="summary_signature">
|
121
|
+
|
122
|
+
<a href="#%3D%3D-instance_method" title="#== (instance method)">- (Boolean) <strong>==</strong>(other) </a>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
</span>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
<span class="summary_desc"><div class='inline'><p>Is this object equal to the association's target?.</p>
|
136
|
+
</div></span>
|
137
|
+
|
138
|
+
</li>
|
139
|
+
|
140
|
+
|
141
|
+
<li class="public ">
|
142
|
+
<span class="summary_signature">
|
143
|
+
|
144
|
+
<a href="#method_missing-instance_method" title="#method_missing (instance method)">- (Object) <strong>method_missing</strong>(method, *args) </a>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
</span>
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
<span class="summary_desc"><div class='inline'><p>Delegate methods we don't find directly to the target.</p>
|
158
|
+
</div></span>
|
159
|
+
|
160
|
+
</li>
|
161
|
+
|
162
|
+
|
163
|
+
</ul>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="Association.html" title="Dynamoid::Associations::Association (module)">Association</a></span></h3>
|
175
|
+
<p class="inherited"><span class='object_link'><a href="Association.html#%3C%3C-instance_method" title="Dynamoid::Associations::Association#<< (method)">#<<</a></span>, <span class='object_link'><a href="Association.html#create-instance_method" title="Dynamoid::Associations::Association#create (method)">#create</a></span>, <span class='object_link'><a href="Association.html#create%21-instance_method" title="Dynamoid::Associations::Association#create! (method)">#create!</a></span>, <span class='object_link'><a href="Association.html#delete-instance_method" title="Dynamoid::Associations::Association#delete (method)">#delete</a></span>, <span class='object_link'><a href="Association.html#delete_all-instance_method" title="Dynamoid::Associations::Association#delete_all (method)">#delete_all</a></span>, <span class='object_link'><a href="Association.html#destroy_all-instance_method" title="Dynamoid::Associations::Association#destroy_all (method)">#destroy_all</a></span>, <span class='object_link'><a href="Association.html#each-instance_method" title="Dynamoid::Associations::Association#each (method)">#each</a></span>, <span class='object_link'><a href="Association.html#include%3F-instance_method" title="Dynamoid::Associations::Association#include? (method)">#include?</a></span>, <span class='object_link'><a href="Association.html#initialize-instance_method" title="Dynamoid::Associations::Association#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Association.html#records-instance_method" title="Dynamoid::Associations::Association#records (method)">#records</a></span>, <span class='object_link'><a href="Association.html#setter-instance_method" title="Dynamoid::Associations::Association#setter (method)">#setter</a></span>, <span class='object_link'><a href="Association.html#where-instance_method" title="Dynamoid::Associations::Association#where (method)">#where</a></span></p>
|
176
|
+
|
177
|
+
<div id="constructor_details" class="method_details_list">
|
178
|
+
<h2>Constructor Details</h2>
|
179
|
+
|
180
|
+
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Association.html#initialize-instance_method" title="Dynamoid::Associations::Association#initialize (method)">Dynamoid::Associations::Association</a></span></p>
|
181
|
+
|
182
|
+
</div>
|
183
|
+
<div id="method_missing_details" class="method_details_list">
|
184
|
+
<h2>Dynamic Method Handling</h2>
|
185
|
+
<p class="notice this">
|
186
|
+
This class handles dynamic methods through the <tt>method_missing</tt> method
|
187
|
+
|
188
|
+
</p>
|
189
|
+
|
190
|
+
<div class="method_details first">
|
191
|
+
<p class="signature first" id="method_missing-instance_method">
|
192
|
+
|
193
|
+
- (<tt>Object</tt>) <strong>method_missing</strong>(method, *args)
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
</p><div class="docstring">
|
198
|
+
<div class="discussion">
|
199
|
+
<p>Delegate methods we don't find directly to the target.</p>
|
200
|
+
|
201
|
+
|
202
|
+
</div>
|
203
|
+
</div>
|
204
|
+
<div class="tags">
|
205
|
+
|
206
|
+
<h3>Since:</h3>
|
207
|
+
<ul class="since">
|
208
|
+
|
209
|
+
<li>
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
<div class='inline'><p>0.2.0</p>
|
216
|
+
</div>
|
217
|
+
|
218
|
+
</li>
|
219
|
+
|
220
|
+
</ul>
|
221
|
+
|
222
|
+
</div><table class="source_code">
|
223
|
+
<tr>
|
224
|
+
<td>
|
225
|
+
<pre class="lines">
|
226
|
+
|
227
|
+
|
228
|
+
22
|
229
|
+
23
|
230
|
+
24
|
231
|
+
25
|
232
|
+
26
|
233
|
+
27
|
234
|
+
28</pre>
|
235
|
+
</td>
|
236
|
+
<td>
|
237
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/associations/belongs_to.rb', line 22</span>
|
238
|
+
|
239
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_method_missing'>method_missing</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
240
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span>
|
241
|
+
<span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
242
|
+
<span class='kw'>else</span>
|
243
|
+
<span class='kw'>super</span>
|
244
|
+
<span class='kw'>end</span>
|
245
|
+
<span class='kw'>end</span></pre>
|
246
|
+
</td>
|
247
|
+
</tr>
|
248
|
+
</table>
|
249
|
+
</div>
|
250
|
+
|
251
|
+
</div>
|
252
|
+
|
253
|
+
|
254
|
+
<div id="instance_method_details" class="method_details_list">
|
255
|
+
<h2>Instance Method Details</h2>
|
256
|
+
|
257
|
+
|
258
|
+
<div class="method_details first">
|
259
|
+
<p class="signature first" id="==-instance_method">
|
260
|
+
|
261
|
+
- (<tt>Boolean</tt>) <strong>==</strong>(other)
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
</p><div class="docstring">
|
266
|
+
<div class="discussion">
|
267
|
+
<p>Is this object equal to the association's target?</p>
|
268
|
+
|
269
|
+
|
270
|
+
</div>
|
271
|
+
</div>
|
272
|
+
<div class="tags">
|
273
|
+
|
274
|
+
<h3>Returns:</h3>
|
275
|
+
<ul class="return">
|
276
|
+
|
277
|
+
<li>
|
278
|
+
|
279
|
+
|
280
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
—
|
285
|
+
<div class='inline'><p>true/false</p>
|
286
|
+
</div>
|
287
|
+
|
288
|
+
</li>
|
289
|
+
|
290
|
+
</ul>
|
291
|
+
<h3>Since:</h3>
|
292
|
+
<ul class="since">
|
293
|
+
|
294
|
+
<li>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
<div class='inline'><p>0.2.0</p>
|
301
|
+
</div>
|
302
|
+
|
303
|
+
</li>
|
304
|
+
|
305
|
+
</ul>
|
306
|
+
|
307
|
+
</div><table class="source_code">
|
308
|
+
<tr>
|
309
|
+
<td>
|
310
|
+
<pre class="lines">
|
311
|
+
|
312
|
+
|
313
|
+
15
|
314
|
+
16
|
315
|
+
17</pre>
|
316
|
+
</td>
|
317
|
+
<td>
|
318
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/associations/belongs_to.rb', line 15</span>
|
319
|
+
|
320
|
+
<span class='kw'>def</span> <span class='op'>==</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
|
321
|
+
<span class='id identifier rubyid_target'>target</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span>
|
322
|
+
<span class='kw'>end</span></pre>
|
323
|
+
</td>
|
324
|
+
</tr>
|
325
|
+
</table>
|
326
|
+
</div>
|
327
|
+
|
328
|
+
</div>
|
329
|
+
|
330
|
+
</div>
|
331
|
+
|
332
|
+
<div id="footer">
|
333
|
+
Generated on Tue Mar 27 17:53:07 2012 by
|
334
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
335
|
+
0.7.5 (ruby-1.9.3).
|
336
|
+
</div>
|
337
|
+
|
338
|
+
</body>
|
339
|
+
</html>
|
@@ -0,0 +1,723 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Dynamoid::Associations::ClassMethods
|
8
|
+
|
9
|
+
— Documentation by YARD 0.7.5
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
relpath = '../..';
|
19
|
+
if (relpath != '') relpath += '/';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
25
|
+
|
26
|
+
|
27
|
+
</head>
|
28
|
+
<body>
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<div id="header">
|
34
|
+
<div id="menu">
|
35
|
+
|
36
|
+
<a href="../../_index.html">Index (C)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../../Dynamoid.html" title="Dynamoid (module)">Dynamoid</a></span></span> » <span class='title'><span class='object_link'><a href="../Associations.html" title="Dynamoid::Associations (module)">Associations</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">ClassMethods</span>
|
40
|
+
|
41
|
+
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div id="search">
|
46
|
+
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
48
|
+
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
50
|
+
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
<div class="clear"></div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<iframe id="search_frame"></iframe>
|
58
|
+
|
59
|
+
<div id="content"><h1>Module: Dynamoid::Associations::ClassMethods
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
<dt class="r1 last">Defined in:</dt>
|
75
|
+
<dd class="r1 last">lib/dynamoid/associations.rb</dd>
|
76
|
+
|
77
|
+
</dl>
|
78
|
+
<div class="clear"></div>
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
<h2>
|
89
|
+
Instance Method Summary
|
90
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
91
|
+
</h2>
|
92
|
+
|
93
|
+
<ul class="summary">
|
94
|
+
|
95
|
+
<li class="public ">
|
96
|
+
<span class="summary_signature">
|
97
|
+
|
98
|
+
<a href="#belongs_to-instance_method" title="#belongs_to (instance method)">- (Object) <strong>belongs_to</strong>(name, options = {}) </a>
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
</span>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
<span class="summary_desc"><div class='inline'><p>create a belongs_to association for this document.</p>
|
112
|
+
</div></span>
|
113
|
+
|
114
|
+
</li>
|
115
|
+
|
116
|
+
|
117
|
+
<li class="public ">
|
118
|
+
<span class="summary_signature">
|
119
|
+
|
120
|
+
<a href="#has_and_belongs_to_many-instance_method" title="#has_and_belongs_to_many (instance method)">- (Object) <strong>has_and_belongs_to_many</strong>(name, options = {}) </a>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
</span>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<span class="summary_desc"><div class='inline'><p>create a has_and_belongs_to_many association for this document.</p>
|
134
|
+
</div></span>
|
135
|
+
|
136
|
+
</li>
|
137
|
+
|
138
|
+
|
139
|
+
<li class="public ">
|
140
|
+
<span class="summary_signature">
|
141
|
+
|
142
|
+
<a href="#has_many-instance_method" title="#has_many (instance method)">- (Object) <strong>has_many</strong>(name, options = {}) </a>
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
</span>
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
<span class="summary_desc"><div class='inline'><p>create a has_many association for this document.</p>
|
156
|
+
</div></span>
|
157
|
+
|
158
|
+
</li>
|
159
|
+
|
160
|
+
|
161
|
+
<li class="public ">
|
162
|
+
<span class="summary_signature">
|
163
|
+
|
164
|
+
<a href="#has_one-instance_method" title="#has_one (instance method)">- (Object) <strong>has_one</strong>(name, options = {}) </a>
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
</span>
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
<span class="summary_desc"><div class='inline'><p>create a has_one association for this document.</p>
|
178
|
+
</div></span>
|
179
|
+
|
180
|
+
</li>
|
181
|
+
|
182
|
+
|
183
|
+
</ul>
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
<div id="instance_method_details" class="method_details_list">
|
189
|
+
<h2>Instance Method Details</h2>
|
190
|
+
|
191
|
+
|
192
|
+
<div class="method_details first">
|
193
|
+
<p class="signature first" id="belongs_to-instance_method">
|
194
|
+
|
195
|
+
- (<tt>Object</tt>) <strong>belongs_to</strong>(name, options = {})
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
</p><div class="docstring">
|
200
|
+
<div class="discussion">
|
201
|
+
<p>create a belongs_to association for this document.</p>
|
202
|
+
|
203
|
+
|
204
|
+
</div>
|
205
|
+
</div>
|
206
|
+
<div class="tags">
|
207
|
+
<h3>Parameters:</h3>
|
208
|
+
<ul class="param">
|
209
|
+
|
210
|
+
<li>
|
211
|
+
|
212
|
+
<span class='name'>name</span>
|
213
|
+
|
214
|
+
|
215
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
—
|
220
|
+
<div class='inline'><p>the name of the association</p>
|
221
|
+
</div>
|
222
|
+
|
223
|
+
</li>
|
224
|
+
|
225
|
+
<li>
|
226
|
+
|
227
|
+
<span class='name'>options</span>
|
228
|
+
|
229
|
+
|
230
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
231
|
+
|
232
|
+
|
233
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
234
|
+
|
235
|
+
|
236
|
+
—
|
237
|
+
<div class='inline'><p>options to pass to the association constructor</p>
|
238
|
+
</div>
|
239
|
+
|
240
|
+
</li>
|
241
|
+
|
242
|
+
</ul>
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
<h3>Options Hash (<tt>options</tt>):</h3>
|
250
|
+
<ul class="option">
|
251
|
+
|
252
|
+
<li>
|
253
|
+
<span class="name">:class</span>
|
254
|
+
<span class="type">(<tt>Class</tt>)</span>
|
255
|
+
<span class="default">
|
256
|
+
|
257
|
+
</span>
|
258
|
+
— <div class='inline'><p>the target class of the has_one association; that is, the has_many or has_one class</p>
|
259
|
+
</div>
|
260
|
+
</li>
|
261
|
+
|
262
|
+
<li>
|
263
|
+
<span class="name">:class_name</span>
|
264
|
+
<span class="type">(<tt>Symbol</tt>)</span>
|
265
|
+
<span class="default">
|
266
|
+
|
267
|
+
</span>
|
268
|
+
— <div class='inline'><p>the name of the target class of the association; that is, the name of the has_many or has_one class</p>
|
269
|
+
</div>
|
270
|
+
</li>
|
271
|
+
|
272
|
+
<li>
|
273
|
+
<span class="name">:inverse_of</span>
|
274
|
+
<span class="type">(<tt>Symbol</tt>)</span>
|
275
|
+
<span class="default">
|
276
|
+
|
277
|
+
</span>
|
278
|
+
— <div class='inline'><p>the name of the association on the target class; that is, if the class has a has_many or has_one association, the name of that association</p>
|
279
|
+
</div>
|
280
|
+
</li>
|
281
|
+
|
282
|
+
</ul>
|
283
|
+
|
284
|
+
|
285
|
+
<h3>Since:</h3>
|
286
|
+
<ul class="since">
|
287
|
+
|
288
|
+
<li>
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
<div class='inline'><p>0.2.0</p>
|
295
|
+
</div>
|
296
|
+
|
297
|
+
</li>
|
298
|
+
|
299
|
+
</ul>
|
300
|
+
|
301
|
+
</div><table class="source_code">
|
302
|
+
<tr>
|
303
|
+
<td>
|
304
|
+
<pre class="lines">
|
305
|
+
|
306
|
+
|
307
|
+
62
|
308
|
+
63
|
309
|
+
64</pre>
|
310
|
+
</td>
|
311
|
+
<td>
|
312
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/associations.rb', line 62</span>
|
313
|
+
|
314
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_belongs_to'>belongs_to</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
315
|
+
<span class='id identifier rubyid_association'>association</span><span class='lparen'>(</span><span class='symbol'>:belongs_to</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
316
|
+
<span class='kw'>end</span></pre>
|
317
|
+
</td>
|
318
|
+
</tr>
|
319
|
+
</table>
|
320
|
+
</div>
|
321
|
+
|
322
|
+
<div class="method_details ">
|
323
|
+
<p class="signature " id="has_and_belongs_to_many-instance_method">
|
324
|
+
|
325
|
+
- (<tt>Object</tt>) <strong>has_and_belongs_to_many</strong>(name, options = {})
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
</p><div class="docstring">
|
330
|
+
<div class="discussion">
|
331
|
+
<p>create a has_and_belongs_to_many association for this document.</p>
|
332
|
+
|
333
|
+
|
334
|
+
</div>
|
335
|
+
</div>
|
336
|
+
<div class="tags">
|
337
|
+
<h3>Parameters:</h3>
|
338
|
+
<ul class="param">
|
339
|
+
|
340
|
+
<li>
|
341
|
+
|
342
|
+
<span class='name'>name</span>
|
343
|
+
|
344
|
+
|
345
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
—
|
350
|
+
<div class='inline'><p>the name of the association</p>
|
351
|
+
</div>
|
352
|
+
|
353
|
+
</li>
|
354
|
+
|
355
|
+
<li>
|
356
|
+
|
357
|
+
<span class='name'>options</span>
|
358
|
+
|
359
|
+
|
360
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
361
|
+
|
362
|
+
|
363
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
364
|
+
|
365
|
+
|
366
|
+
—
|
367
|
+
<div class='inline'><p>options to pass to the association constructor</p>
|
368
|
+
</div>
|
369
|
+
|
370
|
+
</li>
|
371
|
+
|
372
|
+
</ul>
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
<h3>Options Hash (<tt>options</tt>):</h3>
|
380
|
+
<ul class="option">
|
381
|
+
|
382
|
+
<li>
|
383
|
+
<span class="name">:class</span>
|
384
|
+
<span class="type">(<tt>Class</tt>)</span>
|
385
|
+
<span class="default">
|
386
|
+
|
387
|
+
</span>
|
388
|
+
— <div class='inline'><p>the target class of the has_and_belongs_to_many association; that is, the belongs_to class</p>
|
389
|
+
</div>
|
390
|
+
</li>
|
391
|
+
|
392
|
+
<li>
|
393
|
+
<span class="name">:class_name</span>
|
394
|
+
<span class="type">(<tt>Symbol</tt>)</span>
|
395
|
+
<span class="default">
|
396
|
+
|
397
|
+
</span>
|
398
|
+
— <div class='inline'><p>the name of the target class of the association; that is, the name of the belongs_to class</p>
|
399
|
+
</div>
|
400
|
+
</li>
|
401
|
+
|
402
|
+
<li>
|
403
|
+
<span class="name">:inverse_of</span>
|
404
|
+
<span class="type">(<tt>Symbol</tt>)</span>
|
405
|
+
<span class="default">
|
406
|
+
|
407
|
+
</span>
|
408
|
+
— <div class='inline'><p>the name of the association on the target class; that is, if the class has a belongs_to association, the name of that association</p>
|
409
|
+
</div>
|
410
|
+
</li>
|
411
|
+
|
412
|
+
</ul>
|
413
|
+
|
414
|
+
|
415
|
+
<h3>Since:</h3>
|
416
|
+
<ul class="since">
|
417
|
+
|
418
|
+
<li>
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
<div class='inline'><p>0.2.0</p>
|
425
|
+
</div>
|
426
|
+
|
427
|
+
</li>
|
428
|
+
|
429
|
+
</ul>
|
430
|
+
|
431
|
+
</div><table class="source_code">
|
432
|
+
<tr>
|
433
|
+
<td>
|
434
|
+
<pre class="lines">
|
435
|
+
|
436
|
+
|
437
|
+
75
|
438
|
+
76
|
439
|
+
77</pre>
|
440
|
+
</td>
|
441
|
+
<td>
|
442
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/associations.rb', line 75</span>
|
443
|
+
|
444
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_has_and_belongs_to_many'>has_and_belongs_to_many</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
445
|
+
<span class='id identifier rubyid_association'>association</span><span class='lparen'>(</span><span class='symbol'>:has_and_belongs_to_many</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
446
|
+
<span class='kw'>end</span></pre>
|
447
|
+
</td>
|
448
|
+
</tr>
|
449
|
+
</table>
|
450
|
+
</div>
|
451
|
+
|
452
|
+
<div class="method_details ">
|
453
|
+
<p class="signature " id="has_many-instance_method">
|
454
|
+
|
455
|
+
- (<tt>Object</tt>) <strong>has_many</strong>(name, options = {})
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
</p><div class="docstring">
|
460
|
+
<div class="discussion">
|
461
|
+
<p>create a has_many association for this document.</p>
|
462
|
+
|
463
|
+
|
464
|
+
</div>
|
465
|
+
</div>
|
466
|
+
<div class="tags">
|
467
|
+
<h3>Parameters:</h3>
|
468
|
+
<ul class="param">
|
469
|
+
|
470
|
+
<li>
|
471
|
+
|
472
|
+
<span class='name'>name</span>
|
473
|
+
|
474
|
+
|
475
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
—
|
480
|
+
<div class='inline'><p>the name of the association</p>
|
481
|
+
</div>
|
482
|
+
|
483
|
+
</li>
|
484
|
+
|
485
|
+
<li>
|
486
|
+
|
487
|
+
<span class='name'>options</span>
|
488
|
+
|
489
|
+
|
490
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
491
|
+
|
492
|
+
|
493
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
494
|
+
|
495
|
+
|
496
|
+
—
|
497
|
+
<div class='inline'><p>options to pass to the association constructor</p>
|
498
|
+
</div>
|
499
|
+
|
500
|
+
</li>
|
501
|
+
|
502
|
+
</ul>
|
503
|
+
|
504
|
+
|
505
|
+
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
<h3>Options Hash (<tt>options</tt>):</h3>
|
510
|
+
<ul class="option">
|
511
|
+
|
512
|
+
<li>
|
513
|
+
<span class="name">:class</span>
|
514
|
+
<span class="type">(<tt>Class</tt>)</span>
|
515
|
+
<span class="default">
|
516
|
+
|
517
|
+
</span>
|
518
|
+
— <div class='inline'><p>the target class of the has_many association; that is, the belongs_to class</p>
|
519
|
+
</div>
|
520
|
+
</li>
|
521
|
+
|
522
|
+
<li>
|
523
|
+
<span class="name">:class_name</span>
|
524
|
+
<span class="type">(<tt>Symbol</tt>)</span>
|
525
|
+
<span class="default">
|
526
|
+
|
527
|
+
</span>
|
528
|
+
— <div class='inline'><p>the name of the target class of the association; that is, the name of the belongs_to class</p>
|
529
|
+
</div>
|
530
|
+
</li>
|
531
|
+
|
532
|
+
<li>
|
533
|
+
<span class="name">:inverse_of</span>
|
534
|
+
<span class="type">(<tt>Symbol</tt>)</span>
|
535
|
+
<span class="default">
|
536
|
+
|
537
|
+
</span>
|
538
|
+
— <div class='inline'><p>the name of the association on the target class; that is, if the class has a belongs_to association, the name of that association</p>
|
539
|
+
</div>
|
540
|
+
</li>
|
541
|
+
|
542
|
+
</ul>
|
543
|
+
|
544
|
+
|
545
|
+
<h3>Since:</h3>
|
546
|
+
<ul class="since">
|
547
|
+
|
548
|
+
<li>
|
549
|
+
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
|
554
|
+
<div class='inline'><p>0.2.0</p>
|
555
|
+
</div>
|
556
|
+
|
557
|
+
</li>
|
558
|
+
|
559
|
+
</ul>
|
560
|
+
|
561
|
+
</div><table class="source_code">
|
562
|
+
<tr>
|
563
|
+
<td>
|
564
|
+
<pre class="lines">
|
565
|
+
|
566
|
+
|
567
|
+
36
|
568
|
+
37
|
569
|
+
38</pre>
|
570
|
+
</td>
|
571
|
+
<td>
|
572
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/associations.rb', line 36</span>
|
573
|
+
|
574
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_has_many'>has_many</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
575
|
+
<span class='id identifier rubyid_association'>association</span><span class='lparen'>(</span><span class='symbol'>:has_many</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
576
|
+
<span class='kw'>end</span></pre>
|
577
|
+
</td>
|
578
|
+
</tr>
|
579
|
+
</table>
|
580
|
+
</div>
|
581
|
+
|
582
|
+
<div class="method_details ">
|
583
|
+
<p class="signature " id="has_one-instance_method">
|
584
|
+
|
585
|
+
- (<tt>Object</tt>) <strong>has_one</strong>(name, options = {})
|
586
|
+
|
587
|
+
|
588
|
+
|
589
|
+
</p><div class="docstring">
|
590
|
+
<div class="discussion">
|
591
|
+
<p>create a has_one association for this document.</p>
|
592
|
+
|
593
|
+
|
594
|
+
</div>
|
595
|
+
</div>
|
596
|
+
<div class="tags">
|
597
|
+
<h3>Parameters:</h3>
|
598
|
+
<ul class="param">
|
599
|
+
|
600
|
+
<li>
|
601
|
+
|
602
|
+
<span class='name'>name</span>
|
603
|
+
|
604
|
+
|
605
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
606
|
+
|
607
|
+
|
608
|
+
|
609
|
+
—
|
610
|
+
<div class='inline'><p>the name of the association</p>
|
611
|
+
</div>
|
612
|
+
|
613
|
+
</li>
|
614
|
+
|
615
|
+
<li>
|
616
|
+
|
617
|
+
<span class='name'>options</span>
|
618
|
+
|
619
|
+
|
620
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
621
|
+
|
622
|
+
|
623
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
624
|
+
|
625
|
+
|
626
|
+
—
|
627
|
+
<div class='inline'><p>options to pass to the association constructor</p>
|
628
|
+
</div>
|
629
|
+
|
630
|
+
</li>
|
631
|
+
|
632
|
+
</ul>
|
633
|
+
|
634
|
+
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
<h3>Options Hash (<tt>options</tt>):</h3>
|
640
|
+
<ul class="option">
|
641
|
+
|
642
|
+
<li>
|
643
|
+
<span class="name">:class</span>
|
644
|
+
<span class="type">(<tt>Class</tt>)</span>
|
645
|
+
<span class="default">
|
646
|
+
|
647
|
+
</span>
|
648
|
+
— <div class='inline'><p>the target class of the has_one association; that is, the belongs_to class</p>
|
649
|
+
</div>
|
650
|
+
</li>
|
651
|
+
|
652
|
+
<li>
|
653
|
+
<span class="name">:class_name</span>
|
654
|
+
<span class="type">(<tt>Symbol</tt>)</span>
|
655
|
+
<span class="default">
|
656
|
+
|
657
|
+
</span>
|
658
|
+
— <div class='inline'><p>the name of the target class of the association; that is, the name of the belongs_to class</p>
|
659
|
+
</div>
|
660
|
+
</li>
|
661
|
+
|
662
|
+
<li>
|
663
|
+
<span class="name">:inverse_of</span>
|
664
|
+
<span class="type">(<tt>Symbol</tt>)</span>
|
665
|
+
<span class="default">
|
666
|
+
|
667
|
+
</span>
|
668
|
+
— <div class='inline'><p>the name of the association on the target class; that is, if the class has a belongs_to association, the name of that association</p>
|
669
|
+
</div>
|
670
|
+
</li>
|
671
|
+
|
672
|
+
</ul>
|
673
|
+
|
674
|
+
|
675
|
+
<h3>Since:</h3>
|
676
|
+
<ul class="since">
|
677
|
+
|
678
|
+
<li>
|
679
|
+
|
680
|
+
|
681
|
+
|
682
|
+
|
683
|
+
|
684
|
+
<div class='inline'><p>0.2.0</p>
|
685
|
+
</div>
|
686
|
+
|
687
|
+
</li>
|
688
|
+
|
689
|
+
</ul>
|
690
|
+
|
691
|
+
</div><table class="source_code">
|
692
|
+
<tr>
|
693
|
+
<td>
|
694
|
+
<pre class="lines">
|
695
|
+
|
696
|
+
|
697
|
+
49
|
698
|
+
50
|
699
|
+
51</pre>
|
700
|
+
</td>
|
701
|
+
<td>
|
702
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/associations.rb', line 49</span>
|
703
|
+
|
704
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_has_one'>has_one</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
705
|
+
<span class='id identifier rubyid_association'>association</span><span class='lparen'>(</span><span class='symbol'>:has_one</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
706
|
+
<span class='kw'>end</span></pre>
|
707
|
+
</td>
|
708
|
+
</tr>
|
709
|
+
</table>
|
710
|
+
</div>
|
711
|
+
|
712
|
+
</div>
|
713
|
+
|
714
|
+
</div>
|
715
|
+
|
716
|
+
<div id="footer">
|
717
|
+
Generated on Tue Mar 27 17:53:07 2012 by
|
718
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
719
|
+
0.7.5 (ruby-1.9.3).
|
720
|
+
</div>
|
721
|
+
|
722
|
+
</body>
|
723
|
+
</html>
|