couch_potato 1.6.5 → 1.10.0

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