dynamoid 0.6.1 → 0.7.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.
Files changed (92) hide show
  1. data/.travis.yml +4 -0
  2. data/Gemfile +3 -2
  3. data/Gemfile.lock +40 -45
  4. data/README.markdown +55 -25
  5. data/Rakefile +31 -0
  6. data/VERSION +1 -1
  7. data/doc/Dynamoid.html +58 -42
  8. data/doc/Dynamoid/Adapter.html +666 -179
  9. data/doc/Dynamoid/Adapter/AwsSdk.html +752 -236
  10. data/doc/Dynamoid/Associations.html +28 -21
  11. data/doc/Dynamoid/Associations/Association.html +102 -49
  12. data/doc/Dynamoid/Associations/BelongsTo.html +28 -25
  13. data/doc/Dynamoid/Associations/ClassMethods.html +95 -52
  14. data/doc/Dynamoid/Associations/HasAndBelongsToMany.html +28 -25
  15. data/doc/Dynamoid/Associations/HasMany.html +28 -25
  16. data/doc/Dynamoid/Associations/HasOne.html +28 -25
  17. data/doc/Dynamoid/Associations/ManyAssociation.html +138 -94
  18. data/doc/Dynamoid/Associations/SingleAssociation.html +67 -38
  19. data/doc/Dynamoid/Components.html +60 -22
  20. data/doc/Dynamoid/Config.html +61 -44
  21. data/doc/Dynamoid/Config/Options.html +90 -61
  22. data/doc/Dynamoid/Criteria.html +28 -21
  23. data/doc/Dynamoid/Criteria/Chain.html +508 -100
  24. data/doc/Dynamoid/Criteria/ClassMethods.html +26 -19
  25. data/doc/Dynamoid/Dirty.html +424 -0
  26. data/doc/Dynamoid/Dirty/ClassMethods.html +174 -0
  27. data/doc/Dynamoid/Document.html +451 -84
  28. data/doc/Dynamoid/Document/ClassMethods.html +281 -102
  29. data/doc/Dynamoid/Errors.html +29 -22
  30. data/doc/Dynamoid/Errors/ConditionalCheckFailedException.html +141 -0
  31. data/doc/Dynamoid/Errors/DocumentNotValid.html +36 -25
  32. data/doc/Dynamoid/Errors/Error.html +27 -20
  33. data/doc/Dynamoid/Errors/InvalidField.html +27 -19
  34. data/doc/Dynamoid/Errors/InvalidQuery.html +131 -0
  35. data/doc/Dynamoid/Errors/MissingRangeKey.html +27 -19
  36. data/doc/Dynamoid/Fields.html +94 -77
  37. data/doc/Dynamoid/Fields/ClassMethods.html +166 -37
  38. data/doc/Dynamoid/Finders.html +28 -21
  39. data/doc/Dynamoid/Finders/ClassMethods.html +505 -78
  40. data/doc/Dynamoid/IdentityMap.html +492 -0
  41. data/doc/Dynamoid/IdentityMap/ClassMethods.html +534 -0
  42. data/doc/Dynamoid/Indexes.html +41 -28
  43. data/doc/Dynamoid/Indexes/ClassMethods.html +45 -29
  44. data/doc/Dynamoid/Indexes/Index.html +100 -62
  45. data/doc/Dynamoid/Middleware.html +115 -0
  46. data/doc/Dynamoid/Middleware/IdentityMap.html +264 -0
  47. data/doc/Dynamoid/Persistence.html +326 -85
  48. data/doc/Dynamoid/Persistence/ClassMethods.html +275 -109
  49. data/doc/Dynamoid/Validations.html +47 -31
  50. data/doc/_index.html +116 -71
  51. data/doc/class_list.html +13 -7
  52. data/doc/css/full_list.css +4 -2
  53. data/doc/css/style.css +60 -44
  54. data/doc/file.LICENSE.html +26 -19
  55. data/doc/file.README.html +152 -48
  56. data/doc/file_list.html +14 -8
  57. data/doc/frames.html +20 -5
  58. data/doc/index.html +152 -48
  59. data/doc/js/app.js +52 -43
  60. data/doc/js/full_list.js +14 -9
  61. data/doc/js/jquery.js +4 -16
  62. data/doc/method_list.html +446 -540
  63. data/doc/top-level-namespace.html +27 -20
  64. data/{Dynamoid.gemspec → dynamoid.gemspec} +21 -8
  65. data/lib/dynamoid/adapter.rb +11 -10
  66. data/lib/dynamoid/adapter/aws_sdk.rb +40 -19
  67. data/lib/dynamoid/components.rb +2 -1
  68. data/lib/dynamoid/criteria/chain.rb +29 -11
  69. data/lib/dynamoid/dirty.rb +6 -0
  70. data/lib/dynamoid/document.rb +34 -19
  71. data/lib/dynamoid/fields.rb +36 -30
  72. data/lib/dynamoid/finders.rb +7 -5
  73. data/lib/dynamoid/persistence.rb +37 -10
  74. data/spec/app/models/address.rb +2 -0
  75. data/spec/app/models/camel_case.rb +10 -0
  76. data/spec/app/models/car.rb +6 -0
  77. data/spec/app/models/nuclear_submarine.rb +5 -0
  78. data/spec/app/models/subscription.rb +2 -2
  79. data/spec/app/models/vehicle.rb +7 -0
  80. data/spec/dynamoid/adapter/aws_sdk_spec.rb +20 -11
  81. data/spec/dynamoid/adapter_spec.rb +67 -82
  82. data/spec/dynamoid/associations/association_spec.rb +30 -30
  83. data/spec/dynamoid/criteria/chain_spec.rb +56 -9
  84. data/spec/dynamoid/criteria_spec.rb +3 -0
  85. data/spec/dynamoid/dirty_spec.rb +8 -0
  86. data/spec/dynamoid/document_spec.rb +109 -47
  87. data/spec/dynamoid/fields_spec.rb +32 -3
  88. data/spec/dynamoid/finders_spec.rb +12 -0
  89. data/spec/dynamoid/persistence_spec.rb +73 -8
  90. data/spec/spec_helper.rb +1 -0
  91. data/spec/support/with_partitioning.rb +15 -0
  92. metadata +22 -9
@@ -6,19 +6,21 @@
6
6
  <title>
7
7
  Module: Dynamoid::Associations
8
8
 
9
- &mdash; Documentation by YARD 0.7.5
9
+ &mdash; Documentation by YARD 0.8.6.1
10
10
 
11
11
  </title>
12
12
 
13
- <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
14
 
15
- <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
16
 
17
17
  <script type="text/javascript" charset="utf-8">
18
- relpath = '..';
19
- if (relpath != '') relpath += '/';
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!" + escape(window.location.href);
20
21
  </script>
21
22
 
23
+
22
24
  <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
23
25
 
24
26
  <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
@@ -26,36 +28,41 @@
26
28
 
27
29
  </head>
28
30
  <body>
29
- <script type="text/javascript" charset="utf-8">
30
- if (window.top.frames.main) document.body.className = 'frames';
31
- </script>
32
-
33
31
  <div id="header">
34
32
  <div id="menu">
35
33
 
36
- <a href="../_index.html">Index (A)</a> &raquo;
34
+ <a href="../_index.html">Index (A)</a> &raquo;
37
35
  <span class='title'><span class='object_link'><a href="../Dynamoid.html" title="Dynamoid (module)">Dynamoid</a></span></span>
38
36
  &raquo;
39
37
  <span class="title">Associations</span>
40
38
 
41
-
39
+
42
40
  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
41
  </div>
44
42
 
45
43
  <div id="search">
46
44
 
47
- <a id="class_list_link" href="#">Class List</a>
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
48
49
 
49
- <a id="method_list_link" href="#">Method List</a>
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
50
54
 
51
- <a id="file_list_link" href="#">File List</a>
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
52
59
 
53
60
  </div>
54
61
  <div class="clear"></div>
55
62
  </div>
56
-
63
+
57
64
  <iframe id="search_frame"></iframe>
58
-
65
+
59
66
  <div id="content"><h1>Module: Dynamoid::Associations
60
67
 
61
68
 
@@ -99,11 +106,11 @@
99
106
 
100
107
  </div><h2>Defined Under Namespace</h2>
101
108
  <p class="children">
102
-
109
+
103
110
 
104
111
  <strong class="modules">Modules:</strong> <span class='object_link'><a href="Associations/Association.html" title="Dynamoid::Associations::Association (module)">Association</a></span>, <span class='object_link'><a href="Associations/ClassMethods.html" title="Dynamoid::Associations::ClassMethods (module)">ClassMethods</a></span>, <span class='object_link'><a href="Associations/ManyAssociation.html" title="Dynamoid::Associations::ManyAssociation (module)">ManyAssociation</a></span>, <span class='object_link'><a href="Associations/SingleAssociation.html" title="Dynamoid::Associations::SingleAssociation (module)">SingleAssociation</a></span>
105
112
 
106
-
113
+
107
114
 
108
115
  <strong class="classes">Classes:</strong> <span class='object_link'><a href="Associations/BelongsTo.html" title="Dynamoid::Associations::BelongsTo (class)">BelongsTo</a></span>, <span class='object_link'><a href="Associations/HasAndBelongsToMany.html" title="Dynamoid::Associations::HasAndBelongsToMany (class)">HasAndBelongsToMany</a></span>, <span class='object_link'><a href="Associations/HasMany.html" title="Dynamoid::Associations::HasMany (class)">HasMany</a></span>, <span class='object_link'><a href="Associations/HasOne.html" title="Dynamoid::Associations::HasOne (class)">HasOne</a></span>
109
116
 
@@ -120,11 +127,11 @@
120
127
 
121
128
 
122
129
  </div>
123
-
130
+
124
131
  <div id="footer">
125
- Generated on Thu Apr 26 01:26:25 2012 by
132
+ Generated on Thu Jun 27 21:59:13 2013 by
126
133
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
127
- 0.7.5 (ruby-1.9.3).
134
+ 0.8.6.1 (ruby-1.9.3).
128
135
  </div>
129
136
 
130
137
  </body>
@@ -6,19 +6,21 @@
6
6
  <title>
7
7
  Module: Dynamoid::Associations::Association
8
8
 
9
- &mdash; Documentation by YARD 0.7.5
9
+ &mdash; Documentation by YARD 0.8.6.1
10
10
 
11
11
  </title>
12
12
 
13
- <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
14
14
 
15
- <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
16
16
 
17
17
  <script type="text/javascript" charset="utf-8">
18
- relpath = '../..';
19
- if (relpath != '') relpath += '/';
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../';
20
+ framesUrl = "../../frames.html#!" + escape(window.location.href);
20
21
  </script>
21
22
 
23
+
22
24
  <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
23
25
 
24
26
  <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
@@ -26,36 +28,41 @@
26
28
 
27
29
  </head>
28
30
  <body>
29
- <script type="text/javascript" charset="utf-8">
30
- if (window.top.frames.main) document.body.className = 'frames';
31
- </script>
32
-
33
31
  <div id="header">
34
32
  <div id="menu">
35
33
 
36
- <a href="../../_index.html">Index (A)</a> &raquo;
34
+ <a href="../../_index.html">Index (A)</a> &raquo;
37
35
  <span class='title'><span class='object_link'><a href="../../Dynamoid.html" title="Dynamoid (module)">Dynamoid</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Associations.html" title="Dynamoid::Associations (module)">Associations</a></span></span>
38
36
  &raquo;
39
37
  <span class="title">Association</span>
40
38
 
41
-
39
+
42
40
  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
41
  </div>
44
42
 
45
43
  <div id="search">
46
44
 
47
- <a id="class_list_link" href="#">Class List</a>
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../../class_list.html">
47
+ Class List
48
+ </a>
48
49
 
49
- <a id="method_list_link" href="#">Method List</a>
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../../method_list.html">
52
+ Method List
53
+ </a>
50
54
 
51
- <a id="file_list_link" href="#">File List</a>
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../../file_list.html">
57
+ File List
58
+ </a>
52
59
 
53
60
  </div>
54
61
  <div class="clear"></div>
55
62
  </div>
56
-
63
+
57
64
  <iframe id="search_frame"></iframe>
58
-
65
+
59
66
  <div id="content"><h1>Module: Dynamoid::Associations::Association
60
67
 
61
68
 
@@ -98,6 +105,7 @@
98
105
  </span>
99
106
 
100
107
 
108
+
101
109
 
102
110
 
103
111
 
@@ -123,6 +131,7 @@
123
131
  </span>
124
132
 
125
133
 
134
+
126
135
 
127
136
 
128
137
 
@@ -148,6 +157,7 @@
148
157
  </span>
149
158
 
150
159
 
160
+
151
161
 
152
162
 
153
163
 
@@ -173,6 +183,7 @@
173
183
  </span>
174
184
 
175
185
 
186
+
176
187
 
177
188
 
178
189
 
@@ -215,6 +226,7 @@
215
226
 
216
227
 
217
228
 
229
+
218
230
 
219
231
 
220
232
  <span class="summary_desc"><div class='inline'></div></span>
@@ -236,6 +248,7 @@
236
248
 
237
249
 
238
250
 
251
+
239
252
 
240
253
 
241
254
  <span class="summary_desc"><div class='inline'><p>Create a new association.</p>
@@ -258,6 +271,7 @@
258
271
 
259
272
 
260
273
 
274
+
261
275
 
262
276
 
263
277
  <span class="summary_desc"><div class='inline'></div></span>
@@ -279,6 +293,7 @@
279
293
 
280
294
 
281
295
 
296
+
282
297
 
283
298
 
284
299
  <span class="summary_desc"><div class='inline'></div></span>
@@ -300,6 +315,7 @@
300
315
 
301
316
 
302
317
 
318
+
303
319
 
304
320
 
305
321
  <span class="summary_desc"><div class='inline'></div></span>
@@ -316,15 +332,16 @@
316
332
 
317
333
 
318
334
  <span id="loaded=-instance_method"></span>
319
- <span id="loaded-instance_method"></span>
320
335
  <div class="method_details first">
321
- <p class="signature first" id="loaded-instance_method">
336
+ <h3 class="signature first" id="loaded-instance_method">
322
337
 
323
338
  - (<tt>Object</tt>) <strong>loaded</strong>
324
339
 
325
340
 
326
341
 
327
- </p><div class="docstring">
342
+
343
+
344
+ </h3><div class="docstring">
328
345
  <div class="discussion">
329
346
  <p>Returns the value of attribute loaded</p>
330
347
 
@@ -357,15 +374,16 @@
357
374
 
358
375
 
359
376
  <span id="name=-instance_method"></span>
360
- <span id="name-instance_method"></span>
361
377
  <div class="method_details ">
362
- <p class="signature " id="name-instance_method">
378
+ <h3 class="signature " id="name-instance_method">
363
379
 
364
380
  - (<tt>Object</tt>) <strong>name</strong>
365
381
 
366
382
 
367
383
 
368
- </p><div class="docstring">
384
+
385
+
386
+ </h3><div class="docstring">
369
387
  <div class="discussion">
370
388
  <p>Returns the value of attribute name</p>
371
389
 
@@ -398,15 +416,16 @@
398
416
 
399
417
 
400
418
  <span id="options=-instance_method"></span>
401
- <span id="options-instance_method"></span>
402
419
  <div class="method_details ">
403
- <p class="signature " id="options-instance_method">
420
+ <h3 class="signature " id="options-instance_method">
404
421
 
405
422
  - (<tt>Object</tt>) <strong>options</strong>
406
423
 
407
424
 
408
425
 
409
- </p><div class="docstring">
426
+
427
+
428
+ </h3><div class="docstring">
410
429
  <div class="discussion">
411
430
  <p>Returns the value of attribute options</p>
412
431
 
@@ -439,15 +458,16 @@
439
458
 
440
459
 
441
460
  <span id="source=-instance_method"></span>
442
- <span id="source-instance_method"></span>
443
461
  <div class="method_details ">
444
- <p class="signature " id="source-instance_method">
462
+ <h3 class="signature " id="source-instance_method">
445
463
 
446
464
  - (<tt>Object</tt>) <strong>source</strong>
447
465
 
448
466
 
449
467
 
450
- </p><div class="docstring">
468
+
469
+
470
+ </h3><div class="docstring">
451
471
  <div class="discussion">
452
472
  <p>Returns the value of attribute source</p>
453
473
 
@@ -483,16 +503,18 @@
483
503
 
484
504
  <div id="instance_method_details" class="method_details_list">
485
505
  <h2>Instance Method Details</h2>
486
-
506
+
487
507
 
488
508
  <div class="method_details first">
489
- <p class="signature first" id="find_target-instance_method">
509
+ <h3 class="signature first" id="find_target-instance_method">
490
510
 
491
511
  - (<tt>Object</tt>) <strong>find_target</strong>
492
512
 
493
513
 
494
514
 
495
- </p><table class="source_code">
515
+
516
+
517
+ </h3><table class="source_code">
496
518
  <tr>
497
519
  <td>
498
520
  <pre class="lines">
@@ -512,13 +534,15 @@
512
534
  </div>
513
535
 
514
536
  <div class="method_details ">
515
- <p class="signature " id="initialize-instance_method">
537
+ <h3 class="signature " id="initialize-instance_method">
516
538
 
517
539
  - (<tt>Dynamoid::Association</tt>) <strong>initialize</strong>(source, name, options)
518
540
 
519
541
 
520
542
 
521
- </p><div class="docstring">
543
+
544
+
545
+ </h3><div class="docstring">
522
546
  <div class="discussion">
523
547
  <p>Create a new association.</p>
524
548
 
@@ -526,7 +550,7 @@
526
550
  </div>
527
551
  </div>
528
552
  <div class="tags">
529
- <h3>Parameters:</h3>
553
+ <p class="tag_title">Parameters:</p>
530
554
  <ul class="param">
531
555
 
532
556
  <li>
@@ -583,7 +607,7 @@
583
607
 
584
608
 
585
609
 
586
- <h3>Options Hash (<tt>options</tt>):</h3>
610
+ <p class="tag_title">Options Hash (<tt>options</tt>):</p>
587
611
  <ul class="option">
588
612
 
589
613
  <li>
@@ -592,8 +616,10 @@
592
616
  <span class="default">
593
617
 
594
618
  </span>
595
- &mdash; <div class='inline'><p>the target class of the association; that is, the class to which the association objects belong</p>
619
+
620
+ &mdash; <div class='inline'><p>the target class of the association; that is, the class to which the association objects belong</p>
596
621
  </div>
622
+
597
623
  </li>
598
624
 
599
625
  <li>
@@ -602,8 +628,10 @@
602
628
  <span class="default">
603
629
 
604
630
  </span>
605
- &mdash; <div class='inline'><p>the name of the target class of the association; only this or Class is necessary</p>
631
+
632
+ &mdash; <div class='inline'><p>the name of the target class of the association; only this or Class is necessary</p>
606
633
  </div>
634
+
607
635
  </li>
608
636
 
609
637
  <li>
@@ -612,14 +640,33 @@
612
640
  <span class="default">
613
641
 
614
642
  </span>
615
- &mdash; <div class='inline'><p>the name of the association on the target class</p>
643
+
644
+ &mdash; <div class='inline'><p>the name of the association on the target class</p>
616
645
  </div>
646
+
617
647
  </li>
618
648
 
619
649
  </ul>
620
650
 
621
651
 
622
- <h3>Since:</h3>
652
+ <p class="tag_title">Returns:</p>
653
+ <ul class="return">
654
+
655
+ <li>
656
+
657
+
658
+ <span class='type'>(<tt>Dynamoid::Association</tt>)</span>
659
+
660
+
661
+
662
+ &mdash;
663
+ <div class='inline'><p>the actual association instance itself</p>
664
+ </div>
665
+
666
+ </li>
667
+
668
+ </ul>
669
+ <p class="tag_title">Since:</p>
623
670
  <ul class="since">
624
671
 
625
672
  <li>
@@ -663,13 +710,15 @@
663
710
  </div>
664
711
 
665
712
  <div class="method_details ">
666
- <p class="signature " id="loaded?-instance_method">
713
+ <h3 class="signature " id="loaded?-instance_method">
667
714
 
668
715
  - (<tt>Boolean</tt>) <strong>loaded?</strong>
669
716
 
670
717
 
671
718
 
672
- </p><div class="docstring">
719
+
720
+
721
+ </h3><div class="docstring">
673
722
  <div class="discussion">
674
723
 
675
724
 
@@ -677,7 +726,7 @@
677
726
  </div>
678
727
  <div class="tags">
679
728
 
680
- <h3>Returns:</h3>
729
+ <p class="tag_title">Returns:</p>
681
730
  <ul class="return">
682
731
 
683
732
  <li>
@@ -713,13 +762,15 @@
713
762
  </div>
714
763
 
715
764
  <div class="method_details ">
716
- <p class="signature " id="reset-instance_method">
765
+ <h3 class="signature " id="reset-instance_method">
717
766
 
718
767
  - (<tt>Object</tt>) <strong>reset</strong>
719
768
 
720
769
 
721
770
 
722
- </p><table class="source_code">
771
+
772
+
773
+ </h3><table class="source_code">
723
774
  <tr>
724
775
  <td>
725
776
  <pre class="lines">
@@ -743,13 +794,15 @@
743
794
  </div>
744
795
 
745
796
  <div class="method_details ">
746
- <p class="signature " id="target-instance_method">
797
+ <h3 class="signature " id="target-instance_method">
747
798
 
748
799
  - (<tt>Object</tt>) <strong>target</strong>
749
800
 
750
801
 
751
802
 
752
- </p><table class="source_code">
803
+
804
+
805
+ </h3><table class="source_code">
753
806
  <tr>
754
807
  <td>
755
808
  <pre class="lines">
@@ -783,11 +836,11 @@
783
836
  </div>
784
837
 
785
838
  </div>
786
-
839
+
787
840
  <div id="footer">
788
- Generated on Thu Apr 26 01:26:26 2012 by
841
+ Generated on Thu Jun 27 21:59:13 2013 by
789
842
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
790
- 0.7.5 (ruby-1.9.3).
843
+ 0.8.6.1 (ruby-1.9.3).
791
844
  </div>
792
845
 
793
846
  </body>