couch_potato 1.7.1 → 1.9.0

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