couchrest_model 1.1.0.rc1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/README.md +4 -0
  2. data/VERSION +1 -1
  3. data/couchrest_model.gemspec +1 -1
  4. data/history.md +13 -1
  5. data/lib/couchrest/model/associations.rb +4 -4
  6. data/lib/couchrest/model/base.rb +25 -7
  7. data/lib/couchrest/model/callbacks.rb +13 -11
  8. data/lib/couchrest/model/{casted_model.rb → embeddable.rb} +22 -17
  9. data/lib/couchrest/model/persistence.rb +6 -1
  10. data/lib/couchrest/model/properties.rb +22 -34
  11. data/lib/couchrest/model/property.rb +1 -1
  12. data/lib/couchrest/model/validations.rb +19 -8
  13. data/lib/couchrest/railtie.rb +6 -3
  14. data/lib/couchrest_model.rb +2 -3
  15. data/lib/rails/generators/couchrest_model/config/config_generator.rb +18 -0
  16. data/lib/rails/generators/couchrest_model/config/templates/couchdb.yml +21 -0
  17. data/spec/fixtures/{more → models}/article.rb +0 -0
  18. data/spec/fixtures/{base.rb → models/base.rb} +11 -0
  19. data/spec/fixtures/{more → models}/card.rb +2 -0
  20. data/spec/fixtures/{more → models}/cat.rb +2 -2
  21. data/spec/fixtures/{more → models}/client.rb +0 -0
  22. data/spec/fixtures/{more → models}/course.rb +2 -2
  23. data/spec/fixtures/{more → models}/event.rb +0 -0
  24. data/spec/fixtures/{more → models}/invoice.rb +2 -2
  25. data/spec/fixtures/{more → models}/key_chain.rb +0 -0
  26. data/spec/fixtures/models/membership.rb +4 -0
  27. data/spec/fixtures/{more → models}/person.rb +4 -2
  28. data/spec/fixtures/models/project.rb +6 -0
  29. data/spec/fixtures/models/question.rb +7 -0
  30. data/spec/fixtures/{more → models}/sale_entry.rb +0 -0
  31. data/spec/fixtures/{more → models}/sale_invoice.rb +5 -4
  32. data/spec/fixtures/{more → models}/service.rb +0 -0
  33. data/spec/fixtures/{more → models}/user.rb +0 -0
  34. data/spec/functional/validations_spec.rb +8 -0
  35. data/spec/spec_helper.rb +23 -14
  36. data/spec/unit/active_model_lint_spec.rb +30 -0
  37. data/spec/{couchrest → unit}/assocations_spec.rb +1 -3
  38. data/spec/{couchrest → unit}/attachment_spec.rb +1 -1
  39. data/spec/{couchrest → unit}/base_spec.rb +59 -10
  40. data/spec/{couchrest → unit}/casted_spec.rb +1 -4
  41. data/spec/{couchrest → unit}/class_proxy_spec.rb +1 -1
  42. data/spec/{couchrest → unit}/collection_spec.rb +1 -2
  43. data/spec/{couchrest → unit}/configuration_spec.rb +2 -3
  44. data/spec/{couchrest → unit}/connection_spec.rb +2 -2
  45. data/spec/{couchrest → unit}/core_extensions/time_parsing.rb +0 -0
  46. data/spec/{couchrest → unit}/design_doc_spec.rb +2 -5
  47. data/spec/{couchrest → unit}/designs/view_spec.rb +0 -0
  48. data/spec/{couchrest → unit}/designs_spec.rb +2 -3
  49. data/spec/{couchrest → unit}/dirty_spec.rb +2 -8
  50. data/spec/{couchrest/casted_model_spec.rb → unit/embeddable_spec.rb} +49 -26
  51. data/spec/{couchrest → unit}/inherited_spec.rb +1 -1
  52. data/spec/{couchrest → unit}/persistence_spec.rb +23 -8
  53. data/spec/{couchrest → unit}/property_protection_spec.rb +1 -1
  54. data/spec/{couchrest → unit}/property_spec.rb +3 -14
  55. data/spec/{couchrest → unit}/proxyable_spec.rb +2 -4
  56. data/spec/{couchrest → unit}/subclass_spec.rb +1 -5
  57. data/spec/{couchrest → unit}/typecast_spec.rb +1 -4
  58. data/spec/{couchrest → unit}/validations_spec.rb +2 -10
  59. data/spec/{couchrest → unit}/view_spec.rb +2 -7
  60. metadata +49 -91
  61. data/spec/fixtures/more/question.rb +0 -7
metadata CHANGED
@@ -1,14 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couchrest_model
3
3
  version: !ruby/object:Gem::Version
4
- hash: 977940566
5
- prerelease: true
6
- segments:
7
- - 1
8
- - 1
9
- - 0
10
- - rc1
11
- version: 1.1.0.rc1
4
+ prerelease:
5
+ version: 1.1.0
12
6
  platform: ruby
13
7
  authors:
14
8
  - J. Chris Anderson
@@ -31,13 +25,7 @@ dependencies:
31
25
  requirements:
32
26
  - - "="
33
27
  - !ruby/object:Gem::Version
34
- hash: -1876988186
35
- segments:
36
- - 1
37
- - 1
38
- - 0
39
- - pre3
40
- version: 1.1.0.pre3
28
+ version: 1.1.0
41
29
  type: :runtime
42
30
  version_requirements: *id001
43
31
  - !ruby/object:Gem::Dependency
@@ -48,10 +36,6 @@ dependencies:
48
36
  requirements:
49
37
  - - ~>
50
38
  - !ruby/object:Gem::Version
51
- hash: 17
52
- segments:
53
- - 1
54
- - 15
55
39
  version: "1.15"
56
40
  type: :runtime
57
41
  version_requirements: *id002
@@ -63,10 +47,6 @@ dependencies:
63
47
  requirements:
64
48
  - - ~>
65
49
  - !ruby/object:Gem::Version
66
- hash: 7
67
- segments:
68
- - 3
69
- - 0
70
50
  version: "3.0"
71
51
  type: :runtime
72
52
  version_requirements: *id003
@@ -78,11 +58,6 @@ dependencies:
78
58
  requirements:
79
59
  - - ~>
80
60
  - !ruby/object:Gem::Version
81
- hash: 63
82
- segments:
83
- - 0
84
- - 3
85
- - 22
86
61
  version: 0.3.22
87
62
  type: :runtime
88
63
  version_requirements: *id004
@@ -94,11 +69,6 @@ dependencies:
94
69
  requirements:
95
70
  - - ~>
96
71
  - !ruby/object:Gem::Version
97
- hash: 23
98
- segments:
99
- - 2
100
- - 6
101
- - 0
102
72
  version: 2.6.0
103
73
  type: :development
104
74
  version_requirements: *id005
@@ -110,11 +80,6 @@ dependencies:
110
80
  requirements:
111
81
  - - ~>
112
82
  - !ruby/object:Gem::Version
113
- hash: 1
114
- segments:
115
- - 1
116
- - 5
117
- - 1
118
83
  version: 1.5.1
119
84
  type: :development
120
85
  version_requirements: *id006
@@ -126,11 +91,6 @@ dependencies:
126
91
  requirements:
127
92
  - - ">="
128
93
  - !ruby/object:Gem::Version
129
- hash: 5
130
- segments:
131
- - 0
132
- - 5
133
- - 7
134
94
  version: 0.5.7
135
95
  type: :development
136
96
  version_requirements: *id007
@@ -164,7 +124,6 @@ files:
164
124
  - lib/couchrest/model/casted_array.rb
165
125
  - lib/couchrest/model/casted_by.rb
166
126
  - lib/couchrest/model/casted_hash.rb
167
- - lib/couchrest/model/casted_model.rb
168
127
  - lib/couchrest/model/class_proxy.rb
169
128
  - lib/couchrest/model/collection.rb
170
129
  - lib/couchrest/model/configuration.rb
@@ -176,6 +135,7 @@ files:
176
135
  - lib/couchrest/model/designs/view.rb
177
136
  - lib/couchrest/model/dirty.rb
178
137
  - lib/couchrest/model/document_queries.rb
138
+ - lib/couchrest/model/embeddable.rb
179
139
  - lib/couchrest/model/errors.rb
180
140
  - lib/couchrest/model/extended_attachments.rb
181
141
  - lib/couchrest/model/persistence.rb
@@ -194,57 +154,63 @@ files:
194
154
  - lib/couchrest/railtie.rb
195
155
  - lib/couchrest_model.rb
196
156
  - lib/rails/generators/couchrest_model.rb
157
+ - lib/rails/generators/couchrest_model/config/config_generator.rb
158
+ - lib/rails/generators/couchrest_model/config/templates/couchdb.yml
197
159
  - lib/rails/generators/couchrest_model/model/model_generator.rb
198
160
  - lib/rails/generators/couchrest_model/model/templates/model.rb
199
161
  - spec/.gitignore
200
- - spec/couchrest/assocations_spec.rb
201
- - spec/couchrest/attachment_spec.rb
202
- - spec/couchrest/base_spec.rb
203
- - spec/couchrest/casted_model_spec.rb
204
- - spec/couchrest/casted_spec.rb
205
- - spec/couchrest/class_proxy_spec.rb
206
- - spec/couchrest/collection_spec.rb
207
- - spec/couchrest/configuration_spec.rb
208
- - spec/couchrest/connection_spec.rb
209
- - spec/couchrest/core_extensions/time_parsing.rb
210
- - spec/couchrest/design_doc_spec.rb
211
- - spec/couchrest/designs/view_spec.rb
212
- - spec/couchrest/designs_spec.rb
213
- - spec/couchrest/dirty_spec.rb
214
- - spec/couchrest/inherited_spec.rb
215
- - spec/couchrest/persistence_spec.rb
216
- - spec/couchrest/property_protection_spec.rb
217
- - spec/couchrest/property_spec.rb
218
- - spec/couchrest/proxyable_spec.rb
219
- - spec/couchrest/subclass_spec.rb
220
- - spec/couchrest/typecast_spec.rb
221
- - spec/couchrest/validations_spec.rb
222
- - spec/couchrest/view_spec.rb
223
162
  - spec/fixtures/attachments/README
224
163
  - spec/fixtures/attachments/couchdb.png
225
164
  - spec/fixtures/attachments/test.html
226
- - spec/fixtures/base.rb
227
165
  - spec/fixtures/config/couchdb.yml
228
- - spec/fixtures/more/article.rb
229
- - spec/fixtures/more/card.rb
230
- - spec/fixtures/more/cat.rb
231
- - spec/fixtures/more/client.rb
232
- - spec/fixtures/more/course.rb
233
- - spec/fixtures/more/event.rb
234
- - spec/fixtures/more/invoice.rb
235
- - spec/fixtures/more/key_chain.rb
236
- - spec/fixtures/more/person.rb
237
- - spec/fixtures/more/question.rb
238
- - spec/fixtures/more/sale_entry.rb
239
- - spec/fixtures/more/sale_invoice.rb
240
- - spec/fixtures/more/service.rb
241
- - spec/fixtures/more/user.rb
166
+ - spec/fixtures/models/article.rb
167
+ - spec/fixtures/models/base.rb
168
+ - spec/fixtures/models/card.rb
169
+ - spec/fixtures/models/cat.rb
170
+ - spec/fixtures/models/client.rb
171
+ - spec/fixtures/models/course.rb
172
+ - spec/fixtures/models/event.rb
173
+ - spec/fixtures/models/invoice.rb
174
+ - spec/fixtures/models/key_chain.rb
175
+ - spec/fixtures/models/membership.rb
176
+ - spec/fixtures/models/person.rb
177
+ - spec/fixtures/models/project.rb
178
+ - spec/fixtures/models/question.rb
179
+ - spec/fixtures/models/sale_entry.rb
180
+ - spec/fixtures/models/sale_invoice.rb
181
+ - spec/fixtures/models/service.rb
182
+ - spec/fixtures/models/user.rb
242
183
  - spec/fixtures/views/lib.js
243
184
  - spec/fixtures/views/test_view/lib.js
244
185
  - spec/fixtures/views/test_view/only-map.js
245
186
  - spec/fixtures/views/test_view/test-map.js
246
187
  - spec/fixtures/views/test_view/test-reduce.js
188
+ - spec/functional/validations_spec.rb
247
189
  - spec/spec_helper.rb
190
+ - spec/unit/active_model_lint_spec.rb
191
+ - spec/unit/assocations_spec.rb
192
+ - spec/unit/attachment_spec.rb
193
+ - spec/unit/base_spec.rb
194
+ - spec/unit/casted_spec.rb
195
+ - spec/unit/class_proxy_spec.rb
196
+ - spec/unit/collection_spec.rb
197
+ - spec/unit/configuration_spec.rb
198
+ - spec/unit/connection_spec.rb
199
+ - spec/unit/core_extensions/time_parsing.rb
200
+ - spec/unit/design_doc_spec.rb
201
+ - spec/unit/designs/view_spec.rb
202
+ - spec/unit/designs_spec.rb
203
+ - spec/unit/dirty_spec.rb
204
+ - spec/unit/embeddable_spec.rb
205
+ - spec/unit/inherited_spec.rb
206
+ - spec/unit/persistence_spec.rb
207
+ - spec/unit/property_protection_spec.rb
208
+ - spec/unit/property_spec.rb
209
+ - spec/unit/proxyable_spec.rb
210
+ - spec/unit/subclass_spec.rb
211
+ - spec/unit/typecast_spec.rb
212
+ - spec/unit/validations_spec.rb
213
+ - spec/unit/view_spec.rb
248
214
  has_rdoc: true
249
215
  homepage: http://github.com/couchrest/couchrest_model
250
216
  licenses: []
@@ -259,25 +225,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
259
225
  requirements:
260
226
  - - ">="
261
227
  - !ruby/object:Gem::Version
262
- hash: 3
263
- segments:
264
- - 0
265
228
  version: "0"
266
229
  required_rubygems_version: !ruby/object:Gem::Requirement
267
230
  none: false
268
231
  requirements:
269
232
  - - ">"
270
233
  - !ruby/object:Gem::Version
271
- hash: 25
272
- segments:
273
- - 1
274
- - 3
275
- - 1
276
234
  version: 1.3.1
277
235
  requirements: []
278
236
 
279
237
  rubyforge_project:
280
- rubygems_version: 1.3.7
238
+ rubygems_version: 1.3.9.1
281
239
  signing_key:
282
240
  specification_version: 3
283
241
  summary: Extends the CouchRest Document for advanced modelling.
@@ -1,7 +0,0 @@
1
- class Question < Hash
2
- include ::CouchRest::Model::CastedModel
3
-
4
- property :q
5
- property :a
6
-
7
- end