couchrest_model 1.1.0.beta2 → 1.1.0.beta3

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 (42) hide show
  1. data/.gitignore +2 -1
  2. data/README.md +50 -3
  3. data/VERSION +1 -1
  4. data/benchmarks/dirty.rb +118 -0
  5. data/couchrest_model.gemspec +1 -0
  6. data/history.txt +12 -0
  7. data/lib/couchrest/model/base.rb +15 -23
  8. data/lib/couchrest/model/casted_array.rb +26 -1
  9. data/lib/couchrest/model/casted_by.rb +23 -0
  10. data/lib/couchrest/model/casted_hash.rb +76 -0
  11. data/lib/couchrest/model/casted_model.rb +9 -6
  12. data/lib/couchrest/model/collection.rb +10 -1
  13. data/lib/couchrest/model/configuration.rb +4 -4
  14. data/lib/couchrest/model/design_doc.rb +65 -71
  15. data/lib/couchrest/model/designs/view.rb +26 -19
  16. data/lib/couchrest/model/designs.rb +0 -2
  17. data/lib/couchrest/model/dirty.rb +49 -0
  18. data/lib/couchrest/model/extended_attachments.rb +7 -1
  19. data/lib/couchrest/model/persistence.rb +15 -4
  20. data/lib/couchrest/model/properties.rb +50 -9
  21. data/lib/couchrest/model/property.rb +6 -2
  22. data/lib/couchrest/model/proxyable.rb +13 -19
  23. data/lib/couchrest/model/support/couchrest_design.rb +33 -0
  24. data/lib/couchrest/model/views.rb +4 -18
  25. data/lib/couchrest_model.rb +8 -3
  26. data/spec/couchrest/base_spec.rb +1 -28
  27. data/spec/couchrest/casted_model_spec.rb +1 -1
  28. data/spec/couchrest/collection_spec.rb +0 -1
  29. data/spec/couchrest/design_doc_spec.rb +211 -0
  30. data/spec/couchrest/designs/view_spec.rb +41 -17
  31. data/spec/couchrest/designs_spec.rb +0 -5
  32. data/spec/couchrest/dirty_spec.rb +355 -0
  33. data/spec/couchrest/property_spec.rb +5 -2
  34. data/spec/couchrest/proxyable_spec.rb +0 -11
  35. data/spec/couchrest/subclass_spec.rb +6 -16
  36. data/spec/couchrest/view_spec.rb +6 -50
  37. data/spec/fixtures/base.rb +1 -1
  38. data/spec/fixtures/more/card.rb +2 -2
  39. data/spec/spec_helper.rb +2 -0
  40. metadata +9 -4
  41. data/Gemfile.lock +0 -76
  42. data/lib/couchrest/model/support/couchrest.rb +0 -19
data/Gemfile.lock DELETED
@@ -1,76 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- couchrest_model (1.1.0.beta2)
5
- activemodel (~> 3.0.0)
6
- couchrest (= 1.1.0.pre2)
7
- mime-types (~> 1.15)
8
- railties (~> 3.0.0)
9
- tzinfo (~> 0.3.22)
10
-
11
- GEM
12
- remote: http://rubygems.org/
13
- specs:
14
- abstract (1.0.0)
15
- actionpack (3.0.5)
16
- activemodel (= 3.0.5)
17
- activesupport (= 3.0.5)
18
- builder (~> 2.1.2)
19
- erubis (~> 2.6.6)
20
- i18n (~> 0.4)
21
- rack (~> 1.2.1)
22
- rack-mount (~> 0.6.13)
23
- rack-test (~> 0.5.7)
24
- tzinfo (~> 0.3.23)
25
- activemodel (3.0.5)
26
- activesupport (= 3.0.5)
27
- builder (~> 2.1.2)
28
- i18n (~> 0.4)
29
- activesupport (3.0.5)
30
- builder (2.1.2)
31
- couchrest (1.1.0.pre2)
32
- json (~> 1.5.1)
33
- mime-types (~> 1.15)
34
- rest-client (~> 1.6.1)
35
- diff-lcs (1.1.2)
36
- erubis (2.6.6)
37
- abstract (>= 1.0.0)
38
- i18n (0.5.0)
39
- json (1.5.1)
40
- mime-types (1.16)
41
- rack (1.2.1)
42
- rack-mount (0.6.14)
43
- rack (>= 1.0.0)
44
- rack-test (0.5.7)
45
- rack (>= 1.0)
46
- railties (3.0.5)
47
- actionpack (= 3.0.5)
48
- activesupport (= 3.0.5)
49
- rake (>= 0.8.7)
50
- thor (~> 0.14.4)
51
- rake (0.8.7)
52
- rest-client (1.6.1)
53
- mime-types (>= 1.16)
54
- rspec (2.2.0)
55
- rspec-core (~> 2.2)
56
- rspec-expectations (~> 2.2)
57
- rspec-mocks (~> 2.2)
58
- rspec-core (2.3.0)
59
- rspec-expectations (2.3.0)
60
- diff-lcs (~> 1.1.2)
61
- rspec-mocks (2.3.0)
62
- thor (0.14.6)
63
- tzinfo (0.3.26)
64
-
65
- PLATFORMS
66
- ruby
67
-
68
- DEPENDENCIES
69
- activemodel (~> 3.0.0)
70
- couchrest (= 1.1.0.pre2)
71
- couchrest_model!
72
- mime-types (~> 1.15)
73
- rack-test (>= 0.5.7)
74
- railties (~> 3.0.0)
75
- rspec (>= 2.0.0)
76
- tzinfo (~> 0.3.22)
@@ -1,19 +0,0 @@
1
-
2
- module CouchRest
3
-
4
- class Database
5
-
6
- alias :delete_orig! :delete!
7
- def delete!
8
- clear_model_fresh_cache
9
- delete_orig!
10
- end
11
-
12
- # If the database is deleted, ensure that the design docs will be refreshed.
13
- def clear_model_fresh_cache
14
- ::CouchRest::Model::Base.subclasses.each{|klass| klass.req_design_doc_refresh if klass.respond_to?(:req_design_doc_refresh)}
15
- end
16
-
17
- end
18
-
19
- end