Commit graph

511 commits

Author SHA1 Message Date
Sam Lown ca932df5ba Merge pull request #90 from kostia/validates_on
Should be able to set contextual validations
2011-06-08 16:06:04 -07:00
Kostiantyn Kahanskyi 1b5c431053 Should be able to set contextual validations
Contextual validations are active __only__ within
an appropriate context: either ”create" or ”update”.

validates(:name, :presence => true, :on => :create)

validates(:name, :presence => {:on => :update})

See http://edgeguides.rubyonrails.org/active_record_validations_callbacks.html#on

Should fix https://github.com/couchrest/couchrest_model/pull/90
2011-06-08 22:54:35 +02:00
Sam Lown ea4325f5bf Fixing assiging hashes to casted arrays properties 2011-06-08 19:14:01 +02:00
Sam Lown 7e054fd948 Merge branch 'master' of github.com:couchrest/couchrest_model
Conflicts:
	history.md
	lib/couchrest/model/property.rb
2011-06-08 18:37:00 +02:00
Sam Lown 7c7ee2c2b1 Upgrading to use CouchRest 1.1.0.pre3 and new Hash-less design 2011-06-08 18:22:35 +02:00
Kostiantyn Kahanskyi 0bb00860d1 Casted array should notify changes on deletion
Otherwise there is no direct way to delete particular elements.

Workaround with assigning to another array without those elements
is pretty ugly.

* Should notify on deletion at a particular index (Array#delete_at)
* Should notify on deletion of a particular element (Array#delete)

Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
2011-06-07 20:59:14 -03:00
Kostiantyn Kahanskyi d50d47c32a Should be able to assign a casted hash to a hash property
Fixes https://github.com/couchrest/couchrest_model/issues/68

Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
2011-06-07 20:57:48 -03:00
Kostiantyn Kahanskyi 5cee1734da Should always include docs when paginating by Model##paginate
Fixes https://github.com/couchrest/couchrest_model/issues/81
2011-06-06 12:51:02 +02:00
Sam Lown f5be6c7679 Fixing problem with reloading models and dirty tracking 2011-06-06 01:53:36 +02:00
Sam Lown 634fdf8b2f Merge branch 'master' of github.com:couchrest/couchrest_model 2011-06-05 11:21:12 +02:00
Sam Lown 36157a01d3 Destroy method now freezes instead of removing ids 2011-06-05 11:21:01 +02:00
Peter Williams 53bc7637e2 tests for #create and #create! init blocks 2011-05-31 16:31:37 -06:00
Peter Williams 2b9a5193b4 add init block support to #create and #create! 2011-05-31 16:03:08 -06:00
Peter Williams 9b8564d9a8 Implement #get! and #find! class methods
Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
2011-05-30 21:57:28 -03:00
Sam Lown fcd9e2ba8e Adding property build support to enable CastedArray#build 2011-05-21 14:16:39 +02:00
Sam Lown d56179aa6b Views for unique validations created on loading, not execution 2011-05-20 12:21:42 +02:00
Sam Lown 938bf2cf2c Fixing dirty tracking on collection_of association type 2011-05-20 02:15:18 +02:00
Sam Lown fba1e53e20 Overriding couchrest's database delete method to ensure design cache is deleted 2011-05-19 00:37:17 +02:00
Sam Lown 9754f4633c Merge branch 'master' of github.com:couchrest/couchrest_model
Conflicts:
	lib/couchrest/model/properties.rb
2011-05-19 00:10:18 +02:00
Sam Lown 1ef25c5015 Fixing as_json to always use a simple Hash and remove nils. History updates. 2011-05-19 00:08:58 +02:00
Peter Williams c9d2611bb7 Support providing an initialization block when creating new models 2011-05-11 13:53:28 -06:00
Peter Williams 2669de9511 Use class_attribute rather than extlib_inheritable_attribute (which is removed in rails 3.1) 2011-05-09 09:47:27 -06:00
Sam Lown e8e1722241 Changing model_type_key one last time to 'type'. General doc refinements for 1.1.0.beta5 release 2011-04-30 13:13:38 +02:00
Sam Lown da3e524020 Fixing issues with proxying and new database code 2011-04-30 01:04:04 +02:00
Sam Lown 814e38f75f Fixing issues when loading with rails 2011-04-30 00:34:12 +02:00
Sam Lown 85109b4b22 Finalizing support for automatic configuration 2011-04-29 23:06:31 +02:00
Sam Lown f3dd4ae06e Working on adding automated configuration support 2011-04-29 21:40:36 +02:00
Sam Lown 37c021a6b9 Started initial idea for automated database configuration 2011-04-29 17:24:11 +02:00
Sam Lown d62c2d1439 Adding filter support to design docs 2011-04-27 13:30:08 +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 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 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 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 0e51dcfb9a Merge branch 'master' of github.com:couchrest/couchrest_model
Conflicts:
	history.txt
2011-03-13 19:53:52 +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