restly 0.0.1.alpha.4 → 0.0.1.alpha.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/lib/restly/associations/base/builders.rb +27 -0
  2. data/lib/restly/associations/base/conditionals.rb +23 -0
  3. data/lib/restly/associations/base/loaders.rb +41 -0
  4. data/lib/restly/associations/base/modifiers.rb +24 -0
  5. data/lib/restly/associations/base/stubs.rb +21 -0
  6. data/lib/restly/associations/base.rb +13 -89
  7. data/lib/restly/associations/belongs_to.rb +2 -14
  8. data/lib/restly/associations/class_methods.rb +62 -0
  9. data/lib/restly/associations/has_one.rb +0 -4
  10. data/lib/restly/associations.rb +26 -83
  11. data/lib/restly/base/fields.rb +4 -0
  12. data/lib/restly/base/generic_methods.rb +1 -1
  13. data/lib/restly/base/instance/actions.rb +8 -5
  14. data/lib/restly/base/instance/attributes.rb +47 -14
  15. data/lib/restly/base/instance/persistence.rb +12 -1
  16. data/lib/restly/base/instance/write_callbacks.rb +9 -1
  17. data/lib/restly/base/instance.rb +28 -21
  18. data/lib/restly/base/resource/batch_actions.rb +15 -0
  19. data/lib/restly/base/resource/finders.rb +1 -1
  20. data/lib/restly/base/resource.rb +9 -0
  21. data/lib/restly/base.rb +9 -5
  22. data/lib/restly/collection.rb +46 -13
  23. data/lib/restly/configuration.rb +6 -4
  24. data/lib/restly/controller_methods.rb +5 -10
  25. data/lib/restly/embedded_associations/base.rb +7 -0
  26. data/lib/restly/{associations/embeddable_resources.rb → embedded_associations/class_methods.rb} +14 -5
  27. data/lib/restly/embedded_associations/embedded_in.rb +7 -0
  28. data/lib/restly/embedded_associations/embeds_many.rb +7 -0
  29. data/lib/restly/embedded_associations/embeds_one.rb +3 -0
  30. data/lib/restly/embedded_associations.rb +12 -0
  31. data/lib/restly/error.rb +1 -1
  32. data/lib/restly/nested_attributes.rb +2 -0
  33. data/lib/restly/proxies/associations/collection.rb +5 -4
  34. data/lib/restly/proxies/associations/instance.rb +2 -2
  35. data/lib/restly/proxies/base.rb +5 -0
  36. data/lib/restly/proxies/with_path.rb +2 -0
  37. data/lib/restly/version.rb +1 -1
  38. data/lib/restly.rb +2 -1
  39. data/spec/dummy/app/controllers/api/other_objects_controller.rb +45 -0
  40. data/spec/dummy/app/controllers/api/sample_objects_controller.rb +4 -4
  41. data/spec/dummy/app/models/other_object.rb +3 -0
  42. data/spec/dummy/app/models/sample_object.rb +2 -0
  43. data/spec/dummy/config/routes.rb +4 -1
  44. data/spec/restly/{associations/embeddable_resources → embeddable_resources}/embeds_many_spec.rb +0 -0
  45. data/spec/restly/{associations/embeddable_resources → embeddable_resources}/embeds_one_spec.rb +0 -0
  46. data/spec/restly/{associations/embeddable_resources_spec.rb → embeddable_resources_spec.rb} +0 -0
  47. metadata +23 -11
  48. data/lib/restly/associations/embeddable_resources/embeds_many.rb +0 -11
  49. data/lib/restly/associations/embeddable_resources/embeds_one.rb +0 -11
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha.4
4
+ version: 0.0.1.alpha.6
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-01 00:00:00.000000000 Z
12
+ date: 2012-11-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oauth2
@@ -127,10 +127,13 @@ files:
127
127
  - lib/restly.rb
128
128
  - lib/restly/associations.rb
129
129
  - lib/restly/associations/base.rb
130
+ - lib/restly/associations/base/builders.rb
131
+ - lib/restly/associations/base/conditionals.rb
132
+ - lib/restly/associations/base/loaders.rb
133
+ - lib/restly/associations/base/modifiers.rb
134
+ - lib/restly/associations/base/stubs.rb
130
135
  - lib/restly/associations/belongs_to.rb
131
- - lib/restly/associations/embeddable_resources.rb
132
- - lib/restly/associations/embeddable_resources/embeds_many.rb
133
- - lib/restly/associations/embeddable_resources/embeds_one.rb
136
+ - lib/restly/associations/class_methods.rb
134
137
  - lib/restly/associations/has_many.rb
135
138
  - lib/restly/associations/has_one.rb
136
139
  - lib/restly/base.rb
@@ -144,6 +147,7 @@ files:
144
147
  - lib/restly/base/instance/write_callbacks.rb
145
148
  - lib/restly/base/mass_assignment_security.rb
146
149
  - lib/restly/base/resource.rb
150
+ - lib/restly/base/resource/batch_actions.rb
147
151
  - lib/restly/base/resource/finders.rb
148
152
  - lib/restly/client.rb
149
153
  - lib/restly/collection.rb
@@ -152,6 +156,12 @@ files:
152
156
  - lib/restly/configuration.rb
153
157
  - lib/restly/connection.rb
154
158
  - lib/restly/controller_methods.rb
159
+ - lib/restly/embedded_associations.rb
160
+ - lib/restly/embedded_associations/base.rb
161
+ - lib/restly/embedded_associations/class_methods.rb
162
+ - lib/restly/embedded_associations/embedded_in.rb
163
+ - lib/restly/embedded_associations/embeds_many.rb
164
+ - lib/restly/embedded_associations/embeds_one.rb
155
165
  - lib/restly/error.rb
156
166
  - lib/restly/middleware.rb
157
167
  - lib/restly/nested_attributes.rb
@@ -176,6 +186,7 @@ files:
176
186
  - spec/dummy/app/assets/stylesheets/api/sample_objects.css
177
187
  - spec/dummy/app/assets/stylesheets/application.css
178
188
  - spec/dummy/app/assets/stylesheets/sample_objects.css
189
+ - spec/dummy/app/controllers/api/other_objects_controller.rb
179
190
  - spec/dummy/app/controllers/api/sample_objects_controller.rb
180
191
  - spec/dummy/app/controllers/application_controller.rb
181
192
  - spec/dummy/app/controllers/sample_objects_controller.rb
@@ -231,9 +242,6 @@ files:
231
242
  - spec/dummy/vendor/plugins/.gitkeep
232
243
  - spec/restly/associations/base_spec.rb
233
244
  - spec/restly/associations/belongs_to_spec.rb
234
- - spec/restly/associations/embeddable_resources/embeds_many_spec.rb
235
- - spec/restly/associations/embeddable_resources/embeds_one_spec.rb
236
- - spec/restly/associations/embeddable_resources_spec.rb
237
245
  - spec/restly/associations/has_many_spec.rb
238
246
  - spec/restly/associations/has_one_spec.rb
239
247
  - spec/restly/associations_spec.rb
@@ -256,6 +264,9 @@ files:
256
264
  - spec/restly/configuration_spec.rb
257
265
  - spec/restly/connection_spec.rb
258
266
  - spec/restly/controller_methods_spec.rb
267
+ - spec/restly/embeddable_resources/embeds_many_spec.rb
268
+ - spec/restly/embeddable_resources/embeds_one_spec.rb
269
+ - spec/restly/embeddable_resources_spec.rb
259
270
  - spec/restly/middleware_spec.rb
260
271
  - spec/restly/nested_attributes_spec.rb
261
272
  - spec/restly/proxies/associations/collection_spec.rb
@@ -300,6 +311,7 @@ test_files:
300
311
  - spec/dummy/app/assets/stylesheets/api/sample_objects.css
301
312
  - spec/dummy/app/assets/stylesheets/application.css
302
313
  - spec/dummy/app/assets/stylesheets/sample_objects.css
314
+ - spec/dummy/app/controllers/api/other_objects_controller.rb
303
315
  - spec/dummy/app/controllers/api/sample_objects_controller.rb
304
316
  - spec/dummy/app/controllers/application_controller.rb
305
317
  - spec/dummy/app/controllers/sample_objects_controller.rb
@@ -355,9 +367,6 @@ test_files:
355
367
  - spec/dummy/vendor/plugins/.gitkeep
356
368
  - spec/restly/associations/base_spec.rb
357
369
  - spec/restly/associations/belongs_to_spec.rb
358
- - spec/restly/associations/embeddable_resources/embeds_many_spec.rb
359
- - spec/restly/associations/embeddable_resources/embeds_one_spec.rb
360
- - spec/restly/associations/embeddable_resources_spec.rb
361
370
  - spec/restly/associations/has_many_spec.rb
362
371
  - spec/restly/associations/has_one_spec.rb
363
372
  - spec/restly/associations_spec.rb
@@ -380,6 +389,9 @@ test_files:
380
389
  - spec/restly/configuration_spec.rb
381
390
  - spec/restly/connection_spec.rb
382
391
  - spec/restly/controller_methods_spec.rb
392
+ - spec/restly/embeddable_resources/embeds_many_spec.rb
393
+ - spec/restly/embeddable_resources/embeds_one_spec.rb
394
+ - spec/restly/embeddable_resources_spec.rb
383
395
  - spec/restly/middleware_spec.rb
384
396
  - spec/restly/nested_attributes_spec.rb
385
397
  - spec/restly/proxies/associations/collection_spec.rb
@@ -1,11 +0,0 @@
1
- class Restly::Associations::EmbeddableResources::EmbedsMany < Restly::Associations::Base
2
-
3
- def collection?
4
- true
5
- end
6
-
7
- def embedded?
8
- true
9
- end
10
-
11
- end
@@ -1,11 +0,0 @@
1
- class Restly::Associations::EmbeddableResources::EmbedsOne < Restly::Associations::Base
2
-
3
- def collection?
4
- false
5
- end
6
-
7
- def embedded?
8
- true
9
- end
10
-
11
- end