couch_potato 1.7.0 → 1.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/ruby.yml +50 -0
  3. data/.gitignore +3 -0
  4. data/CHANGES.md +180 -130
  5. data/Gemfile +4 -0
  6. data/README.md +61 -85
  7. data/Rakefile +11 -10
  8. data/couch_potato-rspec.gemspec +2 -1
  9. data/couch_potato.gemspec +9 -7
  10. data/gemfiles/active_support_5_0 +6 -0
  11. data/gemfiles/active_support_5_1 +7 -0
  12. data/gemfiles/active_support_5_2 +6 -0
  13. data/gemfiles/active_support_6_0 +6 -0
  14. data/gemfiles/active_support_6_1 +6 -0
  15. data/gemfiles/active_support_7_0 +6 -0
  16. data/lib/couch_potato/database.rb +170 -71
  17. data/lib/couch_potato/persistence/dirty_attributes.rb +3 -21
  18. data/lib/couch_potato/persistence/magic_timestamps.rb +3 -3
  19. data/lib/couch_potato/persistence/properties.rb +15 -10
  20. data/lib/couch_potato/persistence/simple_property.rb +0 -4
  21. data/lib/couch_potato/persistence/type_caster.rb +11 -6
  22. data/lib/couch_potato/persistence.rb +0 -1
  23. data/lib/couch_potato/railtie.rb +6 -11
  24. data/lib/couch_potato/validation.rb +8 -0
  25. data/lib/couch_potato/version.rb +2 -2
  26. data/lib/couch_potato/view/base_view_spec.rb +8 -32
  27. data/lib/couch_potato/view/custom_views.rb +4 -3
  28. data/lib/couch_potato/view/flex_view_spec.rb +121 -0
  29. data/lib/couch_potato/view/view_parameters.rb +34 -0
  30. data/lib/couch_potato.rb +37 -16
  31. data/spec/callbacks_spec.rb +45 -19
  32. data/spec/conflict_handling_spec.rb +1 -2
  33. data/spec/property_spec.rb +12 -3
  34. data/spec/railtie_spec.rb +10 -0
  35. data/spec/spec_helper.rb +4 -3
  36. data/spec/unit/active_model_compliance_spec.rb +7 -3
  37. data/spec/unit/attributes_spec.rb +54 -1
  38. data/spec/unit/caching_spec.rb +105 -0
  39. data/spec/unit/couch_potato_spec.rb +70 -5
  40. data/spec/unit/create_spec.rb +5 -4
  41. data/spec/unit/database_spec.rb +239 -135
  42. data/spec/unit/dirty_attributes_spec.rb +5 -26
  43. data/spec/unit/flex_view_spec_spec.rb +17 -0
  44. data/spec/unit/model_view_spec_spec.rb +1 -1
  45. data/spec/unit/rspec_stub_db_spec.rb +31 -0
  46. data/spec/unit/validation_spec.rb +42 -2
  47. data/spec/unit/view_query_spec.rb +12 -7
  48. data/spec/views_spec.rb +214 -103
  49. data/vendor/pouchdb-collate/LICENSE +202 -0
  50. data/vendor/pouchdb-collate/pouchdb-collate.js +430 -0
  51. metadata +47 -36
  52. data/.ruby-version +0 -1
  53. data/.travis.yml +0 -21
  54. data/gemfiles/active_support_4_0 +0 -11
  55. data/gemfiles/active_support_4_1 +0 -11
  56. data/gemfiles/active_support_4_2 +0 -11
  57. data/lib/couch_potato/persistence/deep_dirty_attributes.rb +0 -180
  58. data/spec/unit/deep_dirty_attributes_spec.rb +0 -434
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 30f6ff4ae48fa386a7c210a840f7bc2e5504e812
4
- data.tar.gz: e3cc6d272dab7679b7766bb96a0b9cdf557ad2b3
2
+ SHA256:
3
+ metadata.gz: 7e0a3143ad59fbb9f3391e381841412de37afda869b90c3b105b3efe41859fa2
4
+ data.tar.gz: 452e6d3cc546b0d45feb5ea94ea81779400adf6474e22580e6637d15f58858bb
5
5
  SHA512:
6
- metadata.gz: d8ec9aba049750bc2d18053ba05633d4a593d6fd7e44f002746dd629d2fd8c4ad6297228f549b9653d60ad9a54e410ad6334aa6356c1d3a2d6825b102241cb43
7
- data.tar.gz: 1b9106d793d8874f32345492ad25aac13a1a3817df7af885d3f084117c7c9a8a34f7fbcd3eca834ee0b62cb4f2d20c9b86fbcdb015979e20712475dd0b9f383e
6
+ metadata.gz: f517b4ecfaf2c57eceade400298c68ef2d189f1274709c95f7bd54d97721b9131b79430956e5c517cd2fbd3781149ff9fe54c4640eaea8e82b940e97c696fd04
7
+ data.tar.gz: a668623b7cd70ab1acb86aff299f8729f8645625b560f3b45247447117c9ac69d5aa335d57ff9dacaa980cd021d2f01f5e21c0a88f5faa45d5add8045e016e21
@@ -0,0 +1,50 @@
1
+ name: Ruby CI
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ - 1.x
7
+ pull_request:
8
+ branches:
9
+ - master
10
+ - 1.x
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
15
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ ruby: [2.7, '3.0', "jruby"]
20
+ gemfile:
21
+ - "active_support_5_0"
22
+ - "active_support_5_1"
23
+ - "active_support_5_2"
24
+ - "active_support_6_0"
25
+ - "active_support_6_1"
26
+ - "active_support_7_0"
27
+ exclude:
28
+ - ruby: "jruby"
29
+ gemfile: "active_support_7_0"
30
+ - ruby: "3.0"
31
+ gemfile: "active_support_5_0"
32
+ - ruby: "3.0"
33
+ gemfile: "active_support_5_1"
34
+ - ruby: "3.0"
35
+ gemfile: "active_support_5_2"
36
+ - ruby: "3.0"
37
+ gemfile: "active_support_6_0"
38
+ steps:
39
+ - uses: actions/checkout@v2
40
+ - name: Set up CouchDB
41
+ uses: cobot/couchdb-action@v4
42
+ with:
43
+ couchdb version: "2.3.1"
44
+ - name: Set up Ruby
45
+ uses: ruby/setup-ruby@v1
46
+ with:
47
+ ruby-version: ${{ matrix.ruby }}
48
+ bundler-cache: true
49
+ - name: Run tests
50
+ run: bundle exec rake spec_ci
data/.gitignore CHANGED
@@ -4,3 +4,6 @@ pkg
4
4
  .rvmrc
5
5
  *.swp
6
6
  *.lock
7
+
8
+ .ruby-version
9
+ .tool-versions
data/CHANGES.md CHANGED
@@ -1,266 +1,316 @@
1
1
  ## Changes
2
2
 
3
+ ### 1.10.1
4
+
5
+ - support passing an empty array to CouchPotato::Database#load
6
+
7
+ ### 1.10.0
8
+
9
+ - add spec/support for Rails 7
10
+
11
+ ### 1.9.0
12
+
13
+ - add spec/support for Rails 6.1
14
+ - add caching Couchrest connections to reduce total number created
15
+
16
+ ### 1.8.0
17
+
18
+ - remove not saving model if it is not dirty. this could lead to missed document updates if the document has been updated in a different process in-between being loaded and saved in the current process.
19
+
20
+ - remove deep dirty tracking
21
+
22
+ ### 1.7.1
23
+
24
+ - added support for properties of type Integer
25
+
3
26
  ### 1.7.0
4
27
 
5
- * added `_revisions` method that returns all available revisions of a document.
28
+ - added `_revisions` method that returns all available revisions of a document.
6
29
 
7
30
  ### 1.6.4
8
31
 
9
- * bug fix for accessing inherited properties (Alexander Lang)
32
+ - bug fix for accessing inherited properties (Alexander Lang)
10
33
 
11
34
  ### 1.6.3
12
35
 
13
- * added ActiveSupport instrumentation (Alexander Lang)
36
+ - added ActiveSupport instrumentation (Alexander Lang)
14
37
 
15
38
  ### 1.6.2
16
39
 
17
- * view digest bugfix (Alexander Lang)
40
+ - view digest bugfix (Alexander Lang)
18
41
 
19
42
  ### 1.6.1
20
43
 
21
- * added option to add digests to a single view (Alexander Lang)
44
+ - added option to add digests to a single view (Alexander Lang)
22
45
 
23
46
  ### 1.6.0
24
47
 
25
- * added global option to add digests to view names (Alexander Lang)
48
+ - added global option to add digests to view names (Alexander Lang)
26
49
 
27
50
  ### 1.5.1
28
51
 
29
- * updated CouchRest to 2.0.0.rc3 in order to re-use http connections. Performance improvements. (Thilo Utke)
30
- * added passing params to lists (Alexander Lang)
52
+ - updated CouchRest to 2.0.0.rc3 in order to re-use http connections. Performance improvements. (Thilo Utke)
53
+ - added passing params to lists (Alexander Lang)
31
54
 
32
55
  ### 1.5.0
33
56
 
34
- * Moved RSpec matchers into couch_potato-rspec gem. This way, people not using RSpec don't need to install the helpers, plus we can release separate matchers for RSpec 2 and 3.
57
+ - Moved RSpec matchers into couch_potato-rspec gem. This way, people not using RSpec don't need to install the helpers, plus we can release separate matchers for RSpec 2 and 3.
35
58
 
36
59
  ### 1.4.0
37
60
 
38
- * Added support for passing the model to blocks for computing the default value of a property (Alexander Lang)
61
+ - Added support for passing the model to blocks for computing the default value of a property (Alexander Lang)
39
62
 
40
63
  ### 1.3.0
41
64
 
42
- * Add support for built-in couchdb reduce functions in map reduce specs (Andy Morris)
43
- * Make specs handle CommonJS modules via module.exports as well as exports (Andy Morris)
44
- * Changed #attributes to return a HashWithIndifferentAccess (Owen Davies)
65
+ - Add support for built-in couchdb reduce functions in map reduce specs (Andy Morris)
66
+ - Make specs handle CommonJS modules via module.exports as well as exports (Andy Morris)
67
+ - Changed #attributes to return a HashWithIndifferentAccess (Owen Davies)
45
68
 
46
69
  ### 1.2.0
47
70
 
48
- * adds optional deep dirty tracking (andymorris)
49
- * fixes an exception when deleting an already deleted document (Alexander Lang)
71
+ - adds optional deep dirty tracking (andymorris)
72
+ - fixes an exception when deleting an already deleted document (Alexander Lang)
50
73
 
51
74
  ### 1.1.4
52
75
 
53
- * Removes the dependency to json/add/core (cstettner)
76
+ - Removes the dependency to json/add/core (cstettner)
54
77
 
55
78
  ### 1.1.3
56
79
 
57
- * removes check if database exists to avoid lots of additional requests (Alexander Lang)
80
+ - removes check if database exists to avoid lots of additional requests (Alexander Lang)
58
81
 
59
82
  ### 1.1.2
60
83
 
61
- * fixes `CouchPotato.models` did not include subclasses
62
- * adds `CouchPotato.use` (Daniel Lohse)
63
- * fixes MapReduceToMatcher when reduce uses `sum` (Daniel Lohse)
64
- * adds `CouchPotato::Config.database_host` for using multiple databases in a project (Daniel Lohse)
65
- * makes `cast_native` cast floats with no leading digits (wrshawn)
84
+ - fixes `CouchPotato.models` did not include subclasses
85
+ - adds `CouchPotato.use` (Daniel Lohse)
86
+ - fixes MapReduceToMatcher when reduce uses `sum` (Daniel Lohse)
87
+ - adds `CouchPotato::Config.database_host` for using multiple databases in a project (Daniel Lohse)
88
+ - makes `cast_native` cast floats with no leading digits (wrshawn)
66
89
 
67
90
  ### 1.1.1
68
91
 
69
- * fixes properties were leaked to sibling classes (Alexander Lang)
92
+ - fixes properties were leaked to sibling classes (Alexander Lang)
70
93
 
71
94
  ### 1.1.0
72
95
 
73
- * adds conflict handling for Database#save/destroy (Alexander Lang)
96
+ - adds conflict handling for Database#save/destroy (Alexander Lang)
74
97
 
75
98
  ### 1.0.1
76
99
 
77
- * fixes error when bulk loaded document does not respond to database= (Alexander Lang)
100
+ - fixes error when bulk loaded document does not respond to database= (Alexander Lang)
78
101
 
79
102
  ### 1.0.0
80
103
 
81
- * adds `reload` method (Alexander Lang)
82
- * removes `total_rows` from database results (Alexander Lang)
83
- * changes `==` to use ids instead of comparing all attributes (orders of magnitude faster) ([Jochen Kramer](https://github.com/freetwix))
84
- * fixes decoding JSON objects for newer versions of the JSON gem (Alexander Lang)
85
- * adds support for testing map/reduce/rereduce (Andy Morris)
86
- * fixes serializing dates in map/reduce specs (Andy Morris)
87
- * adds support for Rails4 forbidden attributes protection (Alexander Lang)
88
- * adds Rails4, drops 3.0/3.1 support (Alexander Lang)
89
- * adds property default values returned by Procs (Andy Morris)
90
- * adds suppot for BigDecimal properties (Fredrik Rubensson)
91
- * adds support for 2.0, Rubinius, 1.9.3, drops Ruby 1.8, 1.9.2
104
+ - adds `reload` method (Alexander Lang)
105
+ - removes `total_rows` from database results (Alexander Lang)
106
+ - changes `==` to use ids instead of comparing all attributes (orders of magnitude faster) ([Jochen Kramer](https://github.com/freetwix))
107
+ - fixes decoding JSON objects for newer versions of the JSON gem (Alexander Lang)
108
+ - adds support for testing map/reduce/rereduce (Andy Morris)
109
+ - fixes serializing dates in map/reduce specs (Andy Morris)
110
+ - adds support for Rails4 forbidden attributes protection (Alexander Lang)
111
+ - adds Rails4, drops 3.0/3.1 support (Alexander Lang)
112
+ - adds property default values returned by Procs (Andy Morris)
113
+ - adds suppot for BigDecimal properties (Fredrik Rubensson)
114
+ - adds support for 2.0, Rubinius, 1.9.3, drops Ruby 1.8, 1.9.2
92
115
 
93
116
  ### 0.7.1
94
117
 
95
- * fixes a bug when trying to bulk-load non-existant documents
118
+ - fixes a bug when trying to bulk-load non-existant documents
96
119
 
97
120
  ### 0.7.0
98
121
 
99
- * ActiveSupport/Rails 3.2 compatibility (Alexander Lang)
100
- * removed Object#try, String#blank? as they are part of ActiveSupport - ActiveSupport's try behaves differently than the couch potato implementation so this change might break your app (now calling a non-existant method on a non-nil raises a NoMethodError, before it did not) (Alexander Lang)
101
- * bulk document loading (Matthias Jakel)
102
- * multi db support (Peter Schröder)
103
- * hash-style access to attributes (Peter Schröder)
104
- * support for properties of type Array, e.g. :type => [User] (Peter Schröder)
105
- * improve compatibility with state_machine (Alexander Lang)
106
- * allow false as default value for properties (Matthias Jakel)
107
- * support for Erlang views (Alexander Lang)
108
- * don't crash, only warn if couchdb.yml is missing (Alexander Lang)
109
- * use the therubyracer gem to run view specs instead of relying on a `js` executable (Alexander Lang)
122
+ - ActiveSupport/Rails 3.2 compatibility (Alexander Lang)
123
+ - removed Object#try, String#blank? as they are part of ActiveSupport - ActiveSupport's try behaves differently than the couch potato implementation so this change might break your app (now calling a non-existant method on a non-nil raises a NoMethodError, before it did not) (Alexander Lang)
124
+ - bulk document loading (Matthias Jakel)
125
+ - multi db support (Peter Schröder)
126
+ - hash-style access to attributes (Peter Schröder)
127
+ - support for properties of type Array, e.g. :type => [User] (Peter Schröder)
128
+ - improve compatibility with state_machine (Alexander Lang)
129
+ - allow false as default value for properties (Matthias Jakel)
130
+ - support for Erlang views (Alexander Lang)
131
+ - don't crash, only warn if couchdb.yml is missing (Alexander Lang)
132
+ - use the therubyracer gem to run view specs instead of relying on a `js` executable (Alexander Lang)
110
133
 
111
134
  ### 0.6.0
112
135
 
113
- * ActiveSupport/Rails 3.1 compatibility (Maximilian Mack)
114
- * fix no such file to load with json/add/rails (Simone Carletti)
136
+ - ActiveSupport/Rails 3.1 compatibility (Maximilian Mack)
137
+ - fix no such file to load with json/add/rails (Simone Carletti)
115
138
 
116
139
  ### 0.5.7
117
140
 
118
- * support CouchPotato::Database#first/#first! calls when using `stub_db` from tests (langalex)
119
- * support RSpec2 block syntax in `stub_db` (langalex)
141
+ - support CouchPotato::Database#first/#first! calls when using `stub_db` from tests (langalex)
142
+ - support RSpec2 block syntax in `stub_db` (langalex)
120
143
 
121
144
  ### 0.5.6
122
145
 
123
- * remove the stale parameter from a view query if it's nil, as couchdb only allows stale to be ok or update\_after (langalex)
146
+ - remove the stale parameter from a view query if it's nil, as couchdb only allows stale to be ok or update_after (langalex)
124
147
 
125
148
  ### 0.5.5
126
149
 
127
- * support for split_design_documents_per_view (jweiss)
128
- * errors now returns a Hash instead of an Array (bterkuile)
129
- * support passing in list names as symbols in view specs (langalex)
150
+ - support for split_design_documents_per_view (jweiss)
151
+ - errors now returns a Hash instead of an Array (bterkuile)
152
+ - support passing in list names as symbols in view specs (langalex)
130
153
 
131
154
  ### 0.5.4
132
- * cast 'false' to false for boolean properties (langalex)
155
+
156
+ - cast 'false' to false for boolean properties (langalex)
133
157
 
134
158
  ### 0.5.3
135
- * added CouchPotato::Database.load! (langalex)
159
+
160
+ - added CouchPotato::Database.load! (langalex)
136
161
 
137
162
  ### 0.5.2
138
- * added CouchPotato::Database#first and #first! methods (langalex)
139
- * added workaround for BigCouch/Cloudant to not add null reduce functions to views (langalex)
140
- * don't add _attachments if there are none (langalex)
163
+
164
+ - added CouchPotato::Database#first and #first! methods (langalex)
165
+ - added workaround for BigCouch/Cloudant to not add null reduce functions to views (langalex)
166
+ - don't add \_attachments if there are none (langalex)
141
167
 
142
168
  ### 0.5.1
143
- * fixed issues with tzinfo gem (Bernd Ahlers)
169
+
170
+ - fixed issues with tzinfo gem (Bernd Ahlers)
144
171
 
145
172
  ### 0.5.0
146
- * time zone support (Time properties are now converted to current Time.zone) (langalex)
147
- * lazy property initialization (performance!) (langalex)
148
- * active_model is now the default validation framework (langalex)
173
+
174
+ - time zone support (Time properties are now converted to current Time.zone) (langalex)
175
+ - lazy property initialization (performance!) (langalex)
176
+ - active_model is now the default validation framework (langalex)
149
177
 
150
178
  ### 0.4.0
151
- * ruby 1.9.2 compatibility (langalex)
152
- * couch potato objects now behave correctly when used as keys in Hashes (langalex)
153
- * use as\_json instead of to\_s(:json), which is the rails way
154
- * use ActiveModel dirty tracking (langalex) - this means no more "deep tracking", e.g. `user.tags << 'new_tag'; user.dirty? # false`
179
+
180
+ - ruby 1.9.2 compatibility (langalex)
181
+ - couch potato objects now behave correctly when used as keys in Hashes (langalex)
182
+ - use as_json instead of to_s(:json), which is the rails way
183
+ - use ActiveModel dirty tracking (langalex) - this means no more "deep tracking", e.g. `user.tags << 'new_tag'; user.dirty? # false`
155
184
 
156
185
  ### 0.3.2
157
- * support yielding to blocks on #initialize (martinrehfeld)
158
- * support for negative numbers in Fixnum/Float properties (langalex)
186
+
187
+ - support yielding to blocks on #initialize (martinrehfeld)
188
+ - support for negative numbers in Fixnum/Float properties (langalex)
159
189
 
160
190
  ### 0.3.1
161
- * ActiveModel callbacks (kazjote)
162
- * do not use Rails.env in initializer as it will free Rails.env for all times and in Rails 2.3.x apps it will be called too early thus always beeing development (jweiss)
163
- * ruby 1.9.2 compatibility (langalex)
164
- * can configure validation framework in couchdb.yml, process couchdb.yml with erb (langalex)
191
+
192
+ - ActiveModel callbacks (kazjote)
193
+ - do not use Rails.env in initializer as it will free Rails.env for all times and in Rails 2.3.x apps it will be called too early thus always beeing development (jweiss)
194
+ - ruby 1.9.2 compatibility (langalex)
195
+ - can configure validation framework in couchdb.yml, process couchdb.yml with erb (langalex)
165
196
 
166
197
  ### 0.3.0
167
- * support for lists (langalex)
198
+
199
+ - support for lists (langalex)
168
200
 
169
201
  ### 0.2.32
170
- * added persisted? and to_key for proper ActiveModel compliance (thilo)
171
- * id setter (jhohertz-work)
172
- * load document ids if include\_documents is false (jweiss)
173
- * persist given created\_at/updated\_at instead of Time.now (langalex)
202
+
203
+ - added persisted? and to_key for proper ActiveModel compliance (thilo)
204
+ - id setter (jhohertz-work)
205
+ - load document ids if include_documents is false (jweiss)
206
+ - persist given created_at/updated_at instead of Time.now (langalex)
174
207
 
175
208
  ### 0.2.31
176
- * Removed requirement for validatable gem. Allows for using more uptodate versions of the library, or doesn't install it when you're using ActiveModel. (mattmatt)
177
- * fixed callbacks of super classes were not run (langalex)
209
+
210
+ - Removed requirement for validatable gem. Allows for using more uptodate versions of the library, or doesn't install it when you're using ActiveModel. (mattmatt)
211
+ - fixed callbacks of super classes were not run (langalex)
178
212
 
179
213
  ### 0.2.30
180
- * pass in multiple keys when querying a view (langalex)
214
+
215
+ - pass in multiple keys when querying a view (langalex)
181
216
 
182
217
  ### 0.2.29
183
- * nicer inspect() for models (mattmatt)
184
- * fixed (re)reduce for property views wasn't working (langalex)
218
+
219
+ - nicer inspect() for models (mattmatt)
220
+ - fixed (re)reduce for property views wasn't working (langalex)
185
221
 
186
222
  ### 0.2.28
187
- * fixed reloading nested classes (langalex)
188
- * fixed constant missing error when loading models with uninitialized classes via views (langalex)
189
- * added rspec helpers for stubbing out views (langalex)
190
- * fixed design document names for nested model classes (svenfuchs)
223
+
224
+ - fixed reloading nested classes (langalex)
225
+ - fixed constant missing error when loading models with uninitialized classes via views (langalex)
226
+ - added rspec helpers for stubbing out views (langalex)
227
+ - fixed design document names for nested model classes (svenfuchs)
191
228
 
192
229
  ### 0.2.27
193
- * workaround for Rails apps using bundler: database name was not initialized from couchdb.yml (langalex)
230
+
231
+ - workaround for Rails apps using bundler: database name was not initialized from couchdb.yml (langalex)
194
232
 
195
233
  ### 0.2.26
196
- * added to_s(:json) to Date and Time to be able to get properly formatted dates/times for searching with dates/times (langalex)
197
- * all times are now stored as UTC (langalex)
198
- * added support for Float attributes (arbovm)
199
234
 
235
+ - added to_s(:json) to Date and Time to be able to get properly formatted dates/times for searching with dates/times (langalex)
236
+ - all times are now stored as UTC (langalex)
237
+ - added support for Float attributes (arbovm)
200
238
 
201
239
  ### 0.2.25
202
- * automatic view updates: when you change the definition of a view couch potato will now update the design document in the database (langalex)
203
- * support for properties of type Date, better support for Time (langalex)
204
- * support for default reduce count methods in custom views (jweiss)
240
+
241
+ - automatic view updates: when you change the definition of a view couch potato will now update the design document in the database (langalex)
242
+ - support for properties of type Date, better support for Time (langalex)
243
+ - support for default reduce count methods in custom views (jweiss)
205
244
 
206
245
  ### 0.2.24
207
- * persistent instances can now be marked as dirty with #is_dirty (langalex)
246
+
247
+ - persistent instances can now be marked as dirty with #is_dirty (langalex)
208
248
 
209
249
  ### 0.2.23
210
- * Couch Potato models now conform to the ActiveModel interface when ActiveModel is installed, see http://yehudakatz.com/2010/01/10/activemodel-make-any-ruby-object-feel-like-activerecord/ (langalex)
211
- * fixed error with dirty tracking and BigDecimals (thilo)
212
- * added the ability to use ActiveModel validations instead of validatable (martinrehfeld)
250
+
251
+ - Couch Potato models now conform to the ActiveModel interface when ActiveModel is installed, see http://yehudakatz.com/2010/01/10/activemodel-make-any-ruby-object-feel-like-activerecord/ (langalex)
252
+ - fixed error with dirty tracking and BigDecimals (thilo)
253
+ - added the ability to use ActiveModel validations instead of validatable (martinrehfeld)
213
254
 
214
255
  ### 0.2.22
215
- * fixed properties with default values returned default when a blank value like '' or [] was set (langalex)
256
+
257
+ - fixed properties with default values returned default when a blank value like '' or [] was set (langalex)
216
258
 
217
259
  ### 0.2.21
218
- * automatically set a database instance on results of CouchPotato::Database#view (langalex)
219
- * improved auto loading of unloaded constants - can now load constants that have never been loaded before (langalex)
220
- * raise exception on invalid parameters passed to a couchdb view query (langalex)
221
- * when querying a view: pass in ranges as key instead of startkey/endkey, pass in plain value instead of hash with key (langalex)
260
+
261
+ - automatically set a database instance on results of CouchPotato::Database#view (langalex)
262
+ - improved auto loading of unloaded constants - can now load constants that have never been loaded before (langalex)
263
+ - raise exception on invalid parameters passed to a couchdb view query (langalex)
264
+ - when querying a view: pass in ranges as key instead of startkey/endkey, pass in plain value instead of hash with key (langalex)
222
265
 
223
266
  ### 0.2.20
224
- * support for :boolean properties (jweiss)
225
- * return the total_rows when querying a view (langalex)
267
+
268
+ - support for :boolean properties (jweiss)
269
+ - return the total_rows when querying a view (langalex)
226
270
 
227
271
  ### 0.2.19
228
- * added conditions to views (langalex)
272
+
273
+ - added conditions to views (langalex)
229
274
 
230
275
  ### 0.2.18
231
- * set Fixnum property to nil when given a blank string (langalex)
276
+
277
+ - set Fixnum property to nil when given a blank string (langalex)
232
278
 
233
279
  ### 0.2.17
234
- * fixed nil attributes were omitted in json (jweiss, mattmatt)
235
- * support for properties of type Fixnum (langalex)
280
+
281
+ - fixed nil attributes were omitted in json (jweiss, mattmatt)
282
+ - support for properties of type Fixnum (langalex)
236
283
 
237
284
  ### 0.2.16
238
- * fixed problem with classes being not loaded in rails development mode (langalex)
239
- * fixed persist boolean false value (bernd)
285
+
286
+ - fixed problem with classes being not loaded in rails development mode (langalex)
287
+ - fixed persist boolean false value (bernd)
240
288
 
241
289
  ### 0.2.15
242
- * ability to change the name of the attribute that stores the ruby class in the documents by setting JSON.create_id (lennart)
243
- * fixed double loading issue with bundler (jweiss)
244
- * fixed an issue with setting attachments (endor)
290
+
291
+ - ability to change the name of the attribute that stores the ruby class in the documents by setting JSON.create_id (lennart)
292
+ - fixed double loading issue with bundler (jweiss)
293
+ - fixed an issue with setting attachments (endor)
245
294
 
246
295
  ### 0.2.13
247
296
 
248
- * support adding errors in before_validation callbacks (mattmatt)
249
- * support for inheritance (mattmatt)
250
- * support for save without validations (mattmatt)
251
- * improved (de)serialization now supports deserializing nested objects (railsbros, specs by hagenburger)
252
- * RSpec matchers for testing map/reduce functions (langalex)
297
+ - support adding errors in before_validation callbacks (mattmatt)
298
+ - support for inheritance (mattmatt)
299
+ - support for save without validations (mattmatt)
300
+ - improved (de)serialization now supports deserializing nested objects (railsbros, specs by hagenburger)
301
+ - RSpec matchers for testing map/reduce functions (langalex)
253
302
 
254
303
  ### 0.2.10
255
- * fixed bug with hardcoded timezone
304
+
305
+ - fixed bug with hardcoded timezone
256
306
 
257
307
  ### 0.2.9
258
308
 
259
- * allow to overwrite attribute accessor of properties and use super to call the original accessors
260
- * allow read access to attributes that are present in the Couchdb document but not defined as properties
261
- * support default values for properties via the :default parameter
262
- * support attachments via the _attachments property
263
- * support for namespaces models
264
- * removed belongs_to macro for now
265
- * removed CouchPotato::Config.database_server, just set CouchPotato::Config.database_name to the full url if you are not using localhost:5984
266
- * Ruby 1.9 was broken and is now working again
309
+ - allow to overwrite attribute accessor of properties and use super to call the original accessors
310
+ - allow read access to attributes that are present in the Couchdb document but not defined as properties
311
+ - support default values for properties via the :default parameter
312
+ - support attachments via the \_attachments property
313
+ - support for namespaces models
314
+ - removed belongs_to macro for now
315
+ - removed CouchPotato::Config.database_server, just set CouchPotato::Config.database_name to the full url if you are not using localhost:5984
316
+ - Ruby 1.9 was broken and is now working again
data/Gemfile CHANGED
@@ -2,3 +2,7 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in couch_potato.gemspec
4
4
  gemspec name: 'couch_potato'
5
+
6
+ group :test do
7
+ gem 'execjs'
8
+ end