mongo_mapper-unstable 2010.3.8 → 2010.06.23
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +4 -8
- data/bin/mmconsole +1 -1
- data/examples/keys.rb +37 -0
- data/examples/plugins.rb +41 -0
- data/examples/querying.rb +35 -0
- data/examples/scopes.rb +52 -0
- data/lib/mongo_mapper/connection.rb +83 -0
- data/lib/mongo_mapper/document.rb +11 -329
- data/lib/mongo_mapper/embedded_document.rb +9 -38
- data/lib/mongo_mapper/exceptions.rb +30 -0
- data/lib/mongo_mapper/extensions/array.rb +19 -0
- data/lib/mongo_mapper/extensions/binary.rb +22 -0
- data/lib/mongo_mapper/extensions/boolean.rb +44 -0
- data/lib/mongo_mapper/extensions/date.rb +25 -0
- data/lib/mongo_mapper/extensions/float.rb +14 -0
- data/lib/mongo_mapper/extensions/hash.rb +14 -0
- data/lib/mongo_mapper/extensions/integer.rb +19 -0
- data/lib/mongo_mapper/extensions/kernel.rb +9 -0
- data/lib/mongo_mapper/extensions/nil_class.rb +18 -0
- data/lib/mongo_mapper/extensions/object.rb +27 -0
- data/lib/mongo_mapper/extensions/object_id.rb +30 -0
- data/lib/mongo_mapper/extensions/set.rb +20 -0
- data/lib/mongo_mapper/extensions/string.rb +18 -0
- data/lib/mongo_mapper/extensions/time.rb +29 -0
- data/lib/mongo_mapper/plugins/accessible.rb +44 -0
- data/lib/mongo_mapper/plugins/associations/base.rb +7 -6
- data/lib/mongo_mapper/plugins/associations/belongs_to_polymorphic_proxy.rb +5 -6
- data/lib/mongo_mapper/plugins/associations/belongs_to_proxy.rb +5 -6
- data/lib/mongo_mapper/plugins/associations/collection.rb +1 -0
- data/lib/mongo_mapper/plugins/associations/embedded_collection.rb +2 -1
- data/lib/mongo_mapper/plugins/associations/in_array_proxy.rb +25 -39
- data/lib/mongo_mapper/plugins/associations/many_documents_as_proxy.rb +4 -4
- data/lib/mongo_mapper/plugins/associations/many_documents_proxy.rb +36 -46
- data/lib/mongo_mapper/plugins/associations/many_embedded_polymorphic_proxy.rb +1 -0
- data/lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb +5 -4
- data/lib/mongo_mapper/plugins/associations/many_polymorphic_proxy.rb +1 -0
- data/lib/mongo_mapper/plugins/associations/one_embedded_proxy.rb +40 -0
- data/lib/mongo_mapper/plugins/associations/one_proxy.rb +7 -7
- data/lib/mongo_mapper/plugins/associations/proxy.rb +16 -8
- data/lib/mongo_mapper/plugins/associations.rb +14 -22
- data/lib/mongo_mapper/plugins/caching.rb +21 -0
- data/lib/mongo_mapper/plugins/callbacks.rb +17 -5
- data/lib/mongo_mapper/plugins/clone.rb +10 -4
- data/lib/mongo_mapper/plugins/descendants.rb +3 -2
- data/lib/mongo_mapper/plugins/dirty.rb +1 -0
- data/lib/mongo_mapper/plugins/document.rb +41 -0
- data/lib/mongo_mapper/{support/find.rb → plugins/dynamic_querying/dynamic_finder.rb} +3 -36
- data/lib/mongo_mapper/plugins/dynamic_querying.rb +43 -0
- data/lib/mongo_mapper/plugins/embedded_document.rb +49 -0
- data/lib/mongo_mapper/plugins/equality.rb +4 -10
- data/lib/mongo_mapper/plugins/identity_map.rb +29 -23
- data/lib/mongo_mapper/plugins/indexes.rb +12 -0
- data/lib/mongo_mapper/plugins/inspect.rb +1 -0
- data/lib/mongo_mapper/plugins/keys/key.rb +55 -0
- data/lib/mongo_mapper/plugins/keys.rb +85 -110
- data/lib/mongo_mapper/plugins/logger.rb +1 -0
- data/lib/mongo_mapper/plugins/modifiers.rb +41 -16
- data/lib/mongo_mapper/plugins/pagination.rb +5 -15
- data/lib/mongo_mapper/plugins/persistence.rb +69 -0
- data/lib/mongo_mapper/plugins/protected.rb +9 -1
- data/lib/mongo_mapper/plugins/querying/decorator.rb +46 -0
- data/lib/mongo_mapper/plugins/querying/plucky_methods.rb +15 -0
- data/lib/mongo_mapper/plugins/querying.rb +176 -0
- data/lib/mongo_mapper/plugins/rails.rb +6 -1
- data/lib/mongo_mapper/plugins/safe.rb +28 -0
- data/lib/mongo_mapper/plugins/sci.rb +32 -0
- data/lib/mongo_mapper/plugins/scopes.rb +21 -0
- data/lib/mongo_mapper/plugins/serialization.rb +5 -4
- data/lib/mongo_mapper/plugins/timestamps.rb +2 -1
- data/lib/mongo_mapper/plugins/userstamps.rb +1 -0
- data/lib/mongo_mapper/plugins/validations.rb +9 -5
- data/lib/mongo_mapper/plugins.rb +1 -20
- data/lib/mongo_mapper/support/descendant_appends.rb +5 -6
- data/lib/mongo_mapper/version.rb +4 -0
- data/lib/mongo_mapper.rb +71 -128
- data/test/{NOTE_ON_TESTING → _NOTE_ON_TESTING} +0 -0
- data/test/functional/associations/test_belongs_to_polymorphic_proxy.rb +5 -5
- data/test/functional/associations/test_belongs_to_proxy.rb +13 -21
- data/test/functional/associations/test_in_array_proxy.rb +7 -9
- data/test/functional/associations/test_many_documents_as_proxy.rb +5 -5
- data/test/functional/associations/test_many_documents_proxy.rb +186 -64
- data/test/functional/associations/test_many_embedded_polymorphic_proxy.rb +22 -22
- data/test/functional/associations/test_many_embedded_proxy.rb +32 -32
- data/test/functional/associations/test_many_polymorphic_proxy.rb +47 -47
- data/test/functional/associations/test_one_embedded_proxy.rb +67 -0
- data/test/functional/associations/test_one_proxy.rb +70 -49
- data/test/functional/test_accessible.rb +168 -0
- data/test/functional/test_associations.rb +11 -11
- data/test/functional/test_binary.rb +5 -5
- data/test/functional/test_caching.rb +76 -0
- data/test/functional/test_callbacks.rb +104 -34
- data/test/functional/test_dirty.rb +16 -16
- data/test/functional/test_document.rb +12 -924
- data/test/functional/test_dynamic_querying.rb +75 -0
- data/test/functional/test_embedded_document.rb +88 -8
- data/test/functional/test_identity_map.rb +41 -43
- data/test/functional/{test_indexing.rb → test_indexes.rb} +3 -5
- data/test/functional/test_logger.rb +1 -1
- data/test/functional/test_modifiers.rb +275 -181
- data/test/functional/test_pagination.rb +13 -15
- data/test/functional/test_protected.rb +25 -11
- data/test/functional/test_querying.rb +873 -0
- data/test/functional/test_safe.rb +76 -0
- data/test/functional/test_sci.rb +230 -0
- data/test/functional/test_scopes.rb +171 -0
- data/test/functional/test_string_id_compatibility.rb +11 -11
- data/test/functional/test_timestamps.rb +0 -2
- data/test/functional/test_userstamps.rb +0 -1
- data/test/functional/test_validations.rb +44 -31
- data/test/models.rb +18 -17
- data/test/{active_model_lint_test.rb → test_active_model_lint.rb} +3 -1
- data/test/test_helper.rb +59 -16
- data/test/unit/associations/test_base.rb +47 -42
- data/test/unit/associations/test_proxy.rb +15 -15
- data/test/unit/serializers/test_json_serializer.rb +29 -29
- data/test/unit/test_clone.rb +69 -0
- data/test/unit/test_descendant_appends.rb +3 -3
- data/test/unit/test_document.rb +49 -67
- data/test/unit/test_dynamic_finder.rb +53 -51
- data/test/unit/test_embedded_document.rb +19 -38
- data/test/unit/{test_support.rb → test_extensions.rb} +136 -122
- data/test/unit/test_key.rb +185 -0
- data/test/unit/test_keys.rb +29 -147
- data/test/unit/test_mongo_mapper.rb +3 -48
- data/test/unit/test_pagination.rb +1 -150
- data/test/unit/test_rails.rb +77 -19
- data/test/unit/test_rails_compatibility.rb +12 -12
- data/test/unit/test_serialization.rb +5 -5
- data/test/unit/test_time_zones.rb +9 -9
- data/test/unit/test_validations.rb +46 -46
- metadata +157 -155
- data/.gitignore +0 -10
- data/Rakefile +0 -55
- data/VERSION +0 -1
- data/lib/mongo_mapper/plugins/pagination/proxy.rb +0 -72
- data/lib/mongo_mapper/query.rb +0 -130
- data/lib/mongo_mapper/support.rb +0 -215
- data/mongo_mapper.gemspec +0 -196
- data/performance/read_write.rb +0 -52
- data/specs.watchr +0 -51
- data/test/support/custom_matchers.rb +0 -55
- data/test/support/timing.rb +0 -16
- data/test/unit/test_query.rb +0 -340
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 2010
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 2010.
|
7
|
+
- 6
|
8
|
+
- 23
|
9
|
+
version: 2010.06.23
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- John Nunemaker
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-06-23 00:00:00 -05:00
|
18
18
|
default_executable: mmconsole
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -27,43 +27,58 @@ dependencies:
|
|
27
27
|
segments:
|
28
28
|
- 2
|
29
29
|
- 3
|
30
|
-
|
30
|
+
- 4
|
31
|
+
version: 2.3.4
|
31
32
|
type: :runtime
|
32
33
|
version_requirements: *id001
|
33
34
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
35
|
+
name: jnunemaker-validatable
|
35
36
|
prerelease: false
|
36
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
37
38
|
requirements:
|
38
|
-
- -
|
39
|
+
- - ~>
|
39
40
|
- !ruby/object:Gem::Version
|
40
41
|
segments:
|
41
|
-
- 0
|
42
|
-
- 19
|
43
42
|
- 1
|
44
|
-
|
43
|
+
- 8
|
44
|
+
- 4
|
45
|
+
version: 1.8.4
|
45
46
|
type: :runtime
|
46
47
|
version_requirements: *id002
|
47
48
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
49
|
+
name: plucky
|
49
50
|
prerelease: false
|
50
51
|
requirement: &id003 !ruby/object:Gem::Requirement
|
51
52
|
requirements:
|
52
|
-
- -
|
53
|
+
- - ~>
|
53
54
|
- !ruby/object:Gem::Version
|
54
55
|
segments:
|
55
|
-
-
|
56
|
-
- 8
|
56
|
+
- 0
|
57
57
|
- 3
|
58
|
-
|
58
|
+
- 1
|
59
|
+
version: 0.3.1
|
59
60
|
type: :runtime
|
60
61
|
version_requirements: *id003
|
61
62
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
63
|
+
name: json
|
63
64
|
prerelease: false
|
64
65
|
requirement: &id004 !ruby/object:Gem::Requirement
|
65
66
|
requirements:
|
66
|
-
- -
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
segments:
|
70
|
+
- 1
|
71
|
+
- 2
|
72
|
+
- 3
|
73
|
+
version: 1.2.3
|
74
|
+
type: :development
|
75
|
+
version_requirements: *id004
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
name: jnunemaker-matchy
|
78
|
+
prerelease: false
|
79
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ~>
|
67
82
|
- !ruby/object:Gem::Version
|
68
83
|
segments:
|
69
84
|
- 0
|
@@ -71,13 +86,13 @@ dependencies:
|
|
71
86
|
- 0
|
72
87
|
version: 0.4.0
|
73
88
|
type: :development
|
74
|
-
version_requirements: *
|
89
|
+
version_requirements: *id005
|
75
90
|
- !ruby/object:Gem::Dependency
|
76
91
|
name: shoulda
|
77
92
|
prerelease: false
|
78
|
-
requirement: &
|
93
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
79
94
|
requirements:
|
80
|
-
- -
|
95
|
+
- - ~>
|
81
96
|
- !ruby/object:Gem::Version
|
82
97
|
segments:
|
83
98
|
- 2
|
@@ -85,13 +100,13 @@ dependencies:
|
|
85
100
|
- 2
|
86
101
|
version: 2.10.2
|
87
102
|
type: :development
|
88
|
-
version_requirements: *
|
103
|
+
version_requirements: *id006
|
89
104
|
- !ruby/object:Gem::Dependency
|
90
105
|
name: timecop
|
91
106
|
prerelease: false
|
92
|
-
requirement: &
|
107
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
93
108
|
requirements:
|
94
|
-
- -
|
109
|
+
- - ~>
|
95
110
|
- !ruby/object:Gem::Version
|
96
111
|
segments:
|
97
112
|
- 0
|
@@ -99,13 +114,13 @@ dependencies:
|
|
99
114
|
- 1
|
100
115
|
version: 0.3.1
|
101
116
|
type: :development
|
102
|
-
version_requirements: *
|
117
|
+
version_requirements: *id007
|
103
118
|
- !ruby/object:Gem::Dependency
|
104
119
|
name: mocha
|
105
120
|
prerelease: false
|
106
|
-
requirement: &
|
121
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
107
122
|
requirements:
|
108
|
-
- -
|
123
|
+
- - ~>
|
109
124
|
- !ruby/object:Gem::Version
|
110
125
|
segments:
|
111
126
|
- 0
|
@@ -113,177 +128,126 @@ dependencies:
|
|
113
128
|
- 8
|
114
129
|
version: 0.9.8
|
115
130
|
type: :development
|
116
|
-
version_requirements: *
|
131
|
+
version_requirements: *id008
|
117
132
|
description:
|
118
|
-
email:
|
133
|
+
email:
|
134
|
+
- nunemaker@gmail.com
|
119
135
|
executables:
|
120
136
|
- mmconsole
|
121
137
|
extensions: []
|
122
138
|
|
123
|
-
extra_rdoc_files:
|
124
|
-
|
125
|
-
- README.rdoc
|
139
|
+
extra_rdoc_files: []
|
140
|
+
|
126
141
|
files:
|
127
|
-
- .gitignore
|
128
|
-
- LICENSE
|
129
|
-
- README.rdoc
|
130
|
-
- Rakefile
|
131
|
-
- VERSION
|
132
142
|
- bin/mmconsole
|
133
|
-
-
|
134
|
-
-
|
135
|
-
-
|
136
|
-
-
|
143
|
+
- examples/keys.rb
|
144
|
+
- examples/scopes.rb
|
145
|
+
- examples/querying.rb
|
146
|
+
- examples/plugins.rb
|
147
|
+
- lib/mongo_mapper/connection.rb
|
148
|
+
- lib/mongo_mapper/plugins/serialization.rb
|
149
|
+
- lib/mongo_mapper/plugins/keys.rb
|
150
|
+
- lib/mongo_mapper/plugins/dirty.rb
|
151
|
+
- lib/mongo_mapper/plugins/logger.rb
|
152
|
+
- lib/mongo_mapper/plugins/caching.rb
|
153
|
+
- lib/mongo_mapper/plugins/pagination.rb
|
154
|
+
- lib/mongo_mapper/plugins/validations.rb
|
155
|
+
- lib/mongo_mapper/plugins/document.rb
|
156
|
+
- lib/mongo_mapper/plugins/accessible.rb
|
137
157
|
- lib/mongo_mapper/plugins/associations.rb
|
138
|
-
- lib/mongo_mapper/plugins/
|
139
|
-
- lib/mongo_mapper/plugins/
|
140
|
-
- lib/mongo_mapper/plugins/
|
158
|
+
- lib/mongo_mapper/plugins/safe.rb
|
159
|
+
- lib/mongo_mapper/plugins/scopes.rb
|
160
|
+
- lib/mongo_mapper/plugins/clone.rb
|
161
|
+
- lib/mongo_mapper/plugins/indexes.rb
|
162
|
+
- lib/mongo_mapper/plugins/rails.rb
|
163
|
+
- lib/mongo_mapper/plugins/callbacks.rb
|
141
164
|
- lib/mongo_mapper/plugins/associations/collection.rb
|
142
|
-
- lib/mongo_mapper/plugins/associations/
|
143
|
-
- lib/mongo_mapper/plugins/associations/
|
144
|
-
- lib/mongo_mapper/plugins/associations/many_documents_as_proxy.rb
|
145
|
-
- lib/mongo_mapper/plugins/associations/many_documents_proxy.rb
|
146
|
-
- lib/mongo_mapper/plugins/associations/many_embedded_polymorphic_proxy.rb
|
165
|
+
- lib/mongo_mapper/plugins/associations/one_proxy.rb
|
166
|
+
- lib/mongo_mapper/plugins/associations/one_embedded_proxy.rb
|
147
167
|
- lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
|
148
168
|
- lib/mongo_mapper/plugins/associations/many_polymorphic_proxy.rb
|
149
|
-
- lib/mongo_mapper/plugins/associations/
|
169
|
+
- lib/mongo_mapper/plugins/associations/belongs_to_proxy.rb
|
170
|
+
- lib/mongo_mapper/plugins/associations/base.rb
|
171
|
+
- lib/mongo_mapper/plugins/associations/in_array_proxy.rb
|
172
|
+
- lib/mongo_mapper/plugins/associations/many_documents_proxy.rb
|
150
173
|
- lib/mongo_mapper/plugins/associations/proxy.rb
|
151
|
-
- lib/mongo_mapper/plugins/
|
152
|
-
- lib/mongo_mapper/plugins/
|
153
|
-
- lib/mongo_mapper/plugins/
|
154
|
-
- lib/mongo_mapper/plugins/
|
174
|
+
- lib/mongo_mapper/plugins/associations/embedded_collection.rb
|
175
|
+
- lib/mongo_mapper/plugins/associations/many_embedded_polymorphic_proxy.rb
|
176
|
+
- lib/mongo_mapper/plugins/associations/many_documents_as_proxy.rb
|
177
|
+
- lib/mongo_mapper/plugins/associations/belongs_to_polymorphic_proxy.rb
|
178
|
+
- lib/mongo_mapper/plugins/querying/plucky_methods.rb
|
179
|
+
- lib/mongo_mapper/plugins/querying/decorator.rb
|
180
|
+
- lib/mongo_mapper/plugins/userstamps.rb
|
155
181
|
- lib/mongo_mapper/plugins/equality.rb
|
182
|
+
- lib/mongo_mapper/plugins/modifiers.rb
|
156
183
|
- lib/mongo_mapper/plugins/identity_map.rb
|
184
|
+
- lib/mongo_mapper/plugins/querying.rb
|
185
|
+
- lib/mongo_mapper/plugins/persistence.rb
|
186
|
+
- lib/mongo_mapper/plugins/dynamic_querying/dynamic_finder.rb
|
157
187
|
- lib/mongo_mapper/plugins/inspect.rb
|
158
|
-
- lib/mongo_mapper/plugins/
|
159
|
-
- lib/mongo_mapper/plugins/
|
160
|
-
- lib/mongo_mapper/plugins/
|
161
|
-
- lib/mongo_mapper/plugins/pagination.rb
|
162
|
-
- lib/mongo_mapper/plugins/pagination/proxy.rb
|
163
|
-
- lib/mongo_mapper/plugins/protected.rb
|
164
|
-
- lib/mongo_mapper/plugins/rails.rb
|
165
|
-
- lib/mongo_mapper/plugins/serialization.rb
|
188
|
+
- lib/mongo_mapper/plugins/descendants.rb
|
189
|
+
- lib/mongo_mapper/plugins/sci.rb
|
190
|
+
- lib/mongo_mapper/plugins/dynamic_querying.rb
|
166
191
|
- lib/mongo_mapper/plugins/timestamps.rb
|
167
|
-
- lib/mongo_mapper/plugins/
|
168
|
-
- lib/mongo_mapper/plugins/
|
169
|
-
- lib/mongo_mapper/
|
170
|
-
- lib/mongo_mapper/
|
192
|
+
- lib/mongo_mapper/plugins/embedded_document.rb
|
193
|
+
- lib/mongo_mapper/plugins/protected.rb
|
194
|
+
- lib/mongo_mapper/plugins/keys/key.rb
|
195
|
+
- lib/mongo_mapper/exceptions.rb
|
196
|
+
- lib/mongo_mapper/document.rb
|
171
197
|
- lib/mongo_mapper/support/descendant_appends.rb
|
172
|
-
- lib/mongo_mapper/
|
173
|
-
- mongo_mapper.
|
174
|
-
-
|
175
|
-
-
|
176
|
-
-
|
177
|
-
-
|
178
|
-
-
|
179
|
-
-
|
180
|
-
-
|
181
|
-
-
|
182
|
-
-
|
183
|
-
-
|
184
|
-
-
|
185
|
-
-
|
186
|
-
-
|
187
|
-
-
|
188
|
-
-
|
189
|
-
-
|
190
|
-
- test/
|
191
|
-
- test/functional/test_document.rb
|
192
|
-
- test/functional/test_embedded_document.rb
|
193
|
-
- test/functional/test_identity_map.rb
|
194
|
-
- test/functional/test_indexing.rb
|
195
|
-
- test/functional/test_logger.rb
|
196
|
-
- test/functional/test_modifiers.rb
|
197
|
-
- test/functional/test_pagination.rb
|
198
|
-
- test/functional/test_protected.rb
|
199
|
-
- test/functional/test_string_id_compatibility.rb
|
200
|
-
- test/functional/test_timestamps.rb
|
201
|
-
- test/functional/test_userstamps.rb
|
202
|
-
- test/functional/test_validations.rb
|
203
|
-
- test/models.rb
|
204
|
-
- test/support/custom_matchers.rb
|
205
|
-
- test/support/timing.rb
|
206
|
-
- test/test_helper.rb
|
207
|
-
- test/unit/associations/test_base.rb
|
208
|
-
- test/unit/associations/test_proxy.rb
|
209
|
-
- test/unit/serializers/test_json_serializer.rb
|
210
|
-
- test/unit/test_descendant_appends.rb
|
211
|
-
- test/unit/test_document.rb
|
212
|
-
- test/unit/test_dynamic_finder.rb
|
213
|
-
- test/unit/test_embedded_document.rb
|
214
|
-
- test/unit/test_keys.rb
|
215
|
-
- test/unit/test_mongo_mapper.rb
|
216
|
-
- test/unit/test_pagination.rb
|
217
|
-
- test/unit/test_plugins.rb
|
218
|
-
- test/unit/test_query.rb
|
219
|
-
- test/unit/test_rails.rb
|
220
|
-
- test/unit/test_rails_compatibility.rb
|
221
|
-
- test/unit/test_serialization.rb
|
222
|
-
- test/unit/test_support.rb
|
223
|
-
- test/unit/test_time_zones.rb
|
224
|
-
- test/unit/test_validations.rb
|
225
|
-
has_rdoc: true
|
226
|
-
homepage: http://github.com/jnunemaker/mongomapper
|
227
|
-
licenses: []
|
228
|
-
|
229
|
-
post_install_message:
|
230
|
-
rdoc_options:
|
231
|
-
- --charset=UTF-8
|
232
|
-
require_paths:
|
233
|
-
- lib
|
234
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
235
|
-
requirements:
|
236
|
-
- - ">="
|
237
|
-
- !ruby/object:Gem::Version
|
238
|
-
segments:
|
239
|
-
- 0
|
240
|
-
version: "0"
|
241
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
242
|
-
requirements:
|
243
|
-
- - ">="
|
244
|
-
- !ruby/object:Gem::Version
|
245
|
-
segments:
|
246
|
-
- 0
|
247
|
-
version: "0"
|
248
|
-
requirements: []
|
249
|
-
|
250
|
-
rubyforge_project:
|
251
|
-
rubygems_version: 1.3.6
|
252
|
-
signing_key:
|
253
|
-
specification_version: 3
|
254
|
-
summary: A Ruby Object Mapper for Mongo
|
255
|
-
test_files:
|
198
|
+
- lib/mongo_mapper/extensions/object.rb
|
199
|
+
- lib/mongo_mapper/extensions/kernel.rb
|
200
|
+
- lib/mongo_mapper/extensions/array.rb
|
201
|
+
- lib/mongo_mapper/extensions/string.rb
|
202
|
+
- lib/mongo_mapper/extensions/float.rb
|
203
|
+
- lib/mongo_mapper/extensions/boolean.rb
|
204
|
+
- lib/mongo_mapper/extensions/hash.rb
|
205
|
+
- lib/mongo_mapper/extensions/integer.rb
|
206
|
+
- lib/mongo_mapper/extensions/nil_class.rb
|
207
|
+
- lib/mongo_mapper/extensions/time.rb
|
208
|
+
- lib/mongo_mapper/extensions/object_id.rb
|
209
|
+
- lib/mongo_mapper/extensions/date.rb
|
210
|
+
- lib/mongo_mapper/extensions/binary.rb
|
211
|
+
- lib/mongo_mapper/extensions/set.rb
|
212
|
+
- lib/mongo_mapper/embedded_document.rb
|
213
|
+
- lib/mongo_mapper/version.rb
|
214
|
+
- lib/mongo_mapper/plugins.rb
|
215
|
+
- lib/mongo_mapper.rb
|
216
|
+
- test/_NOTE_ON_TESTING
|
256
217
|
- test/unit/test_embedded_document.rb
|
218
|
+
- test/unit/test_key.rb
|
257
219
|
- test/unit/test_dynamic_finder.rb
|
258
220
|
- test/unit/serializers/test_json_serializer.rb
|
259
|
-
- test/unit/test_support.rb
|
260
221
|
- test/unit/test_keys.rb
|
261
222
|
- test/unit/associations/test_proxy.rb
|
262
223
|
- test/unit/associations/test_base.rb
|
263
224
|
- test/unit/test_time_zones.rb
|
264
225
|
- test/unit/test_serialization.rb
|
226
|
+
- test/unit/test_extensions.rb
|
265
227
|
- test/unit/test_rails.rb
|
266
|
-
- test/unit/test_query.rb
|
267
228
|
- test/unit/test_rails_compatibility.rb
|
268
229
|
- test/unit/test_validations.rb
|
269
230
|
- test/unit/test_mongo_mapper.rb
|
270
231
|
- test/unit/test_descendant_appends.rb
|
232
|
+
- test/unit/test_clone.rb
|
271
233
|
- test/unit/test_plugins.rb
|
272
234
|
- test/unit/test_document.rb
|
273
235
|
- test/unit/test_pagination.rb
|
274
236
|
- test/test_helper.rb
|
275
|
-
- test/support/custom_matchers.rb
|
276
|
-
- test/support/timing.rb
|
277
237
|
- test/functional/test_timestamps.rb
|
238
|
+
- test/functional/test_accessible.rb
|
239
|
+
- test/functional/test_safe.rb
|
278
240
|
- test/functional/test_modifiers.rb
|
241
|
+
- test/functional/test_querying.rb
|
279
242
|
- test/functional/test_embedded_document.rb
|
280
243
|
- test/functional/test_protected.rb
|
281
244
|
- test/functional/test_string_id_compatibility.rb
|
282
|
-
- test/functional/test_indexing.rb
|
283
245
|
- test/functional/test_associations.rb
|
246
|
+
- test/functional/test_dynamic_querying.rb
|
284
247
|
- test/functional/associations/test_belongs_to_proxy.rb
|
285
248
|
- test/functional/associations/test_in_array_proxy.rb
|
286
249
|
- test/functional/associations/test_many_documents_proxy.rb
|
250
|
+
- test/functional/associations/test_one_embedded_proxy.rb
|
287
251
|
- test/functional/associations/test_many_embedded_proxy.rb
|
288
252
|
- test/functional/associations/test_many_documents_as_proxy.rb
|
289
253
|
- test/functional/associations/test_many_embedded_polymorphic_proxy.rb
|
@@ -291,13 +255,51 @@ test_files:
|
|
291
255
|
- test/functional/associations/test_belongs_to_polymorphic_proxy.rb
|
292
256
|
- test/functional/associations/test_one_proxy.rb
|
293
257
|
- test/functional/test_identity_map.rb
|
258
|
+
- test/functional/test_scopes.rb
|
259
|
+
- test/functional/test_indexes.rb
|
294
260
|
- test/functional/test_binary.rb
|
295
261
|
- test/functional/test_dirty.rb
|
296
262
|
- test/functional/test_callbacks.rb
|
297
263
|
- test/functional/test_userstamps.rb
|
298
264
|
- test/functional/test_validations.rb
|
265
|
+
- test/functional/test_sci.rb
|
299
266
|
- test/functional/test_logger.rb
|
300
267
|
- test/functional/test_document.rb
|
301
268
|
- test/functional/test_pagination.rb
|
269
|
+
- test/functional/test_caching.rb
|
302
270
|
- test/models.rb
|
303
|
-
- test/
|
271
|
+
- test/test_active_model_lint.rb
|
272
|
+
- LICENSE
|
273
|
+
- README.rdoc
|
274
|
+
has_rdoc: true
|
275
|
+
homepage: http://github.com/jnunemaker/mongomapper
|
276
|
+
licenses: []
|
277
|
+
|
278
|
+
post_install_message:
|
279
|
+
rdoc_options: []
|
280
|
+
|
281
|
+
require_paths:
|
282
|
+
- lib
|
283
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
284
|
+
requirements:
|
285
|
+
- - ">="
|
286
|
+
- !ruby/object:Gem::Version
|
287
|
+
segments:
|
288
|
+
- 0
|
289
|
+
version: "0"
|
290
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
291
|
+
requirements:
|
292
|
+
- - ">="
|
293
|
+
- !ruby/object:Gem::Version
|
294
|
+
segments:
|
295
|
+
- 0
|
296
|
+
version: "0"
|
297
|
+
requirements: []
|
298
|
+
|
299
|
+
rubyforge_project:
|
300
|
+
rubygems_version: 1.3.6
|
301
|
+
signing_key:
|
302
|
+
specification_version: 3
|
303
|
+
summary: A Ruby Object Mapper for Mongo
|
304
|
+
test_files: []
|
305
|
+
|
data/.gitignore
DELETED
data/Rakefile
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake'
|
3
|
-
require 'jeweler'
|
4
|
-
require 'yard'
|
5
|
-
require 'yard/rake/yardoc_task'
|
6
|
-
|
7
|
-
Jeweler::Tasks.new do |gem|
|
8
|
-
gem.name = "mongo_mapper"
|
9
|
-
gem.summary = %Q{A Ruby Object Mapper for Mongo}
|
10
|
-
gem.email = "nunemaker@gmail.com"
|
11
|
-
gem.homepage = "http://github.com/jnunemaker/mongomapper"
|
12
|
-
gem.authors = ["John Nunemaker"]
|
13
|
-
|
14
|
-
gem.add_dependency('activesupport', '>= 2.3')
|
15
|
-
gem.add_dependency('mongo', '0.19.1')
|
16
|
-
gem.add_dependency('jnunemaker-validatable', '1.8.3')
|
17
|
-
|
18
|
-
gem.add_development_dependency('jnunemaker-matchy', '0.4.0')
|
19
|
-
gem.add_development_dependency('shoulda', '2.10.2')
|
20
|
-
gem.add_development_dependency('timecop', '0.3.1')
|
21
|
-
gem.add_development_dependency('mocha', '0.9.8')
|
22
|
-
end
|
23
|
-
|
24
|
-
Jeweler::GemcutterTasks.new
|
25
|
-
|
26
|
-
require 'rake/testtask'
|
27
|
-
Rake::TestTask.new(:test) do |test|
|
28
|
-
test.libs << 'test'
|
29
|
-
test.ruby_opts << '-rubygems'
|
30
|
-
test.pattern = 'test/**/test_*.rb'
|
31
|
-
test.verbose = true
|
32
|
-
end
|
33
|
-
|
34
|
-
namespace :test do
|
35
|
-
Rake::TestTask.new(:units) do |test|
|
36
|
-
test.libs << 'test'
|
37
|
-
test.ruby_opts << '-rubygems'
|
38
|
-
test.pattern = 'test/unit/**/test_*.rb'
|
39
|
-
test.verbose = true
|
40
|
-
end
|
41
|
-
|
42
|
-
Rake::TestTask.new(:functionals) do |test|
|
43
|
-
test.libs << 'test'
|
44
|
-
test.ruby_opts << '-rubygems'
|
45
|
-
test.pattern = 'test/functional/**/test_*.rb'
|
46
|
-
test.verbose = true
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
task :default => :test
|
51
|
-
task :test => :check_dependencies
|
52
|
-
|
53
|
-
YARD::Rake::YardocTask.new(:doc) do |t|
|
54
|
-
t.options = ["--legacy"] if RUBY_VERSION < "1.9.0"
|
55
|
-
end
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2010.03.08
|
@@ -1,72 +0,0 @@
|
|
1
|
-
module MongoMapper
|
2
|
-
module Plugins
|
3
|
-
module Pagination
|
4
|
-
class Proxy
|
5
|
-
instance_methods.each { |m| undef_method m unless m =~ /(^__|^nil\?$|^send$|respond_to\?|proxy_|^object_id$)/ }
|
6
|
-
|
7
|
-
attr_accessor :subject
|
8
|
-
attr_reader :total_entries, :per_page, :current_page
|
9
|
-
alias limit per_page
|
10
|
-
|
11
|
-
def initialize(total_entries, current_page, per_page=nil)
|
12
|
-
@total_entries = total_entries.to_i
|
13
|
-
self.per_page = per_page
|
14
|
-
self.current_page = current_page
|
15
|
-
end
|
16
|
-
|
17
|
-
def total_pages
|
18
|
-
(total_entries / per_page.to_f).ceil
|
19
|
-
end
|
20
|
-
|
21
|
-
def out_of_bounds?
|
22
|
-
current_page > total_pages
|
23
|
-
end
|
24
|
-
|
25
|
-
def previous_page
|
26
|
-
current_page > 1 ? (current_page - 1) : nil
|
27
|
-
end
|
28
|
-
|
29
|
-
def next_page
|
30
|
-
current_page < total_pages ? (current_page + 1) : nil
|
31
|
-
end
|
32
|
-
|
33
|
-
def skip
|
34
|
-
(current_page - 1) * per_page
|
35
|
-
end
|
36
|
-
alias offset skip # for will paginate support
|
37
|
-
|
38
|
-
def send(method, *args, &block)
|
39
|
-
if respond_to?(method)
|
40
|
-
super
|
41
|
-
else
|
42
|
-
subject.send(method, *args, &block)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def ===(other)
|
47
|
-
other === subject
|
48
|
-
end
|
49
|
-
|
50
|
-
def method_missing(name, *args, &block)
|
51
|
-
@subject.send(name, *args, &block)
|
52
|
-
end
|
53
|
-
|
54
|
-
def respond_to?(name, *args, &block)
|
55
|
-
super || @subject.respond_to?(name, *args, &block)
|
56
|
-
end
|
57
|
-
|
58
|
-
private
|
59
|
-
def per_page=(value)
|
60
|
-
value = 25 if value.blank?
|
61
|
-
@per_page = value.to_i
|
62
|
-
end
|
63
|
-
|
64
|
-
def current_page=(value)
|
65
|
-
value = value.to_i
|
66
|
-
value = 1 if value < 1
|
67
|
-
@current_page = value
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|