Commit graph

890 commits

Author SHA1 Message Date
Sam Lown 18cd16acb8 Ugh, date 2011-04-20 16:47:47 +02:00
Sam Lown 2cc119b3b3 Fixing issues with dirty tracking on nested models and related improvements 2011-04-20 16:44:49 +02:00
Sam Lown 8c4505d191 Adding 2moro's benchmarks for dirty tracking 2011-04-20 12:33:30 +02:00
Sam Lown b3e8fbadc6 Refinements to dirty tracking so always enabled unless loading from the database 2011-04-20 12:31:46 +02:00
Sam Lown 1bced3b207 Merge branch 'master' of https://github.com/2moro/couchrest_model into 2moro-dirty
Conflicts:
	.gitignore
	lib/couchrest/model/base.rb
	lib/couchrest/model/configuration.rb
	lib/couchrest_model.rb
2011-04-20 10:47:36 +02:00
Sam Lown bc4c8719d0 Setting default model type name to 'model' 2011-04-18 22:29:25 +02:00
Sam Lown 3764d1cd5c Fixing URI issue for design docs 2011-04-17 20:55:28 +02:00
Sam Lown 5805f6e27b Refactoring design doc manipulation for a much simpler and more reliable approach 2011-04-17 02:46:33 +02:00
Sam Lown 2eed3581af Adding support for start and end key swapping with descending 2011-04-15 19:24:06 +02:00
Sam Lown cacc320235 Resetting skip and limit when trying to get total count 2011-04-15 16:24:52 +02:00
Sam Lown 00a4cc7f3b Finalizing support for including hash codes in Design documents 2011-04-14 00:19:10 +02:00
Sam Lown 706880fceb Adding missing spec 2011-04-13 22:46:11 +02:00
Sam Lown da93fda815 Working on getting tests to work for new design doc checkcodes 2011-04-13 19:04:09 +02:00
Sam Lown 221e5a5470 Working on adding checksum support to design documents to handle updates 2011-04-13 15:42:28 +02:00
Sam Lown a6becd7305 Fixing issues with Ruby 1.8.7 2011-04-08 22:34:25 +02:00
Sam Lown 33b844b596 History update 2011-04-08 15:42:30 +02:00
Sam Lown 1d37f12982 Adding support for scopes on unique validation 2011-04-08 14:36:29 +02:00
Sam Lown 760d855845 Fixing and testing proxyable with associations and validation 2011-04-05 20:41:24 +02:00
Sam Lown 8fa7e87019 working on proxy association and handling 2011-04-04 01:10:31 +02:00
Sam Lown 363461fc9d Merge branch 'master' of https://github.com/kanterov/couchrest_model into kanterov 2011-04-01 19:52:05 +02:00
Sam Lown 38257f4909 Time handling improved to ensure UTC always used 2011-04-01 19:45:13 +02:00
Sam Lown 3a3fc3c41d Quick example for proxy 2011-03-13 20:42:53 +01:00
Sam Lown 0e51dcfb9a Merge branch 'master' of github.com:couchrest/couchrest_model
Conflicts:
	history.txt
2011-03-13 19:53:52 +01:00
Sam Lown ef546688dc Merge branch 'class_proxy_spec' of https://github.com/gsterndale/couchrest_model into adv_design 2011-03-13 19:35:18 +01:00
Sam Lown 9e1f4282f6 Demoting collection support, using latest couchrest, ensuring reduce always included when needed 2011-03-13 19:34:25 +01:00
Gleb Kanterov 2c091f5970 Test and fix for issue with belongs_to in CastedModel 2011-03-13 19:06:38 +06:00
Sam Lown d1baf99324 Checking for block given and ensuring proyxable finds classes in root namespace 2011-03-13 13:39:26 +01:00
Andrew Williams 634813858e removed use_dirty config option (runs faster) 2011-03-06 13:11:37 +10:30
Andrew Williams 3ad4e1e979 optimisations, and some fixes for ruby 1.8.7 2011-03-06 09:58:54 +10:30
Andrew Williams 2a9305ebd3 implemented some missing dirty functionality for casted_array and casted_hash. improved dirty spec test 2011-03-03 23:22:19 +10:30
Andrew Williams dcf43e3641 some speed optimisations. added 'use_dirty' configuration variable 2011-03-03 17:58:57 +10:30
Marcos Tapajós 498ebf1599 I'm using a shell script to run all specs in Ruby 1.9.2, MRI 1.8.7 and ree 1.8.7 and I need this change to help me. 2011-03-01 23:30:06 -03:00
Marcos Tapajós a37ca4c37b Updating Readme 2011-03-01 22:54:16 -03:00
Christopher Durtschi 755a0c813f Numeric types can be casted from strings with leading or trailing whitespace
Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
2011-03-01 22:53:02 -03:00
Andrew Williams ce2e2fc9a6 some optimisations 2011-03-01 22:06:42 +10:30
Andrew Williams 4e8e5ee0d1 benchmark script 2011-03-01 20:17:52 +10:30
Andrew Williams 270537e95f fixed comment/whitespace 2011-03-01 01:36:38 +10:30
Andrew Williams 4dbf694e51 now using ActiveModel::Dirty. only writes to database if model.changed? 2011-03-01 01:30:41 +10:30
Sam Lown f58482553c Merge branch 'master' of github.com:couchrest/couchrest_model into adv_design 2011-02-27 20:19:09 +01:00
Sam Lown 0a35be7167 Docs for pagination, not including docs in reduce and raising errors when cannot include docs 2011-02-27 20:18:19 +01:00
Sam Lown 6723564969 Adding initial pagination support based on kaminari 2011-02-27 19:06:37 +01:00
Marcos Tapajós 53b052f631 Update History 2011-02-25 00:05:32 -03:00
SengMing Tan 491d057035 fixes typos in README
Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
2011-02-24 23:48:06 -03:00
Simone Carletti 6b66e7f23e Whitespaces. 2011-02-24 23:44:17 -03:00
Simone Carletti 608869be45 Fixed typo 2011-02-24 23:43:25 -03:00
Simone Carletti 2c24702765 Add Base#reload (closes #12)
Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
2011-02-24 23:42:28 -03:00
Simone Carletti 73c1b3d47b Validations spec are never executed due to an invalid filename pattern.
Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
2011-02-24 23:39:53 -03:00
Simone Carletti f75893b927 Fixed UniquenessValidator error
1) Validations Uniqueness should not validate a non-unique document
     Failure/Error: @obj.errors[:title].should eql(['is already taken'])

     expected ["is already taken"]
          got ["translation missing: en.activemodel.errors.models.with_unique_validation.attributes.title.taken"]

     (compared using eql?)

     Diff:
     @@ -1,2 +1,2 @@
     -["is already taken"]
     +["translation missing: en.activemodel.errors.models.with_unique_validation.attributes.title.taken"]
     # ./spec/couchrest/validations_spec.rb:28:in `block (3 levels) in <top (required)>'

Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
2011-02-24 23:39:34 -03:00
Simone Carletti 44b56d3d03 Change Uniqueness validator message to follow ActiveRecord and other ORM behavior. Keeping the same message allows tools like Shoulda to work out of the box.
Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
2011-02-24 23:39:05 -03:00
Simone Carletti f76517d0fa Narrow the rescued exception to avoid catching class evaluation errors that has nothing to to with the association.
Example:

    /Users/weppos/.rvm/gems/ruby-1.8.7-p330/gems/couchrest_model-1.0.0/lib/couchrest/model/associations.rb:29:in `belongs_to': Unable to convert class name into Constant for Document#dossier (RuntimeError)

although the real error is

    /Users/weppos/Projects/working/.../app/models/user.rb:56: undefined method `validates_uniqueness_of' for User:Class (NoMethodError)
2011-02-24 23:38:39 -03:00