Changeset [ceaf1b96a2ac9eb82250307029f36aed063326e0] by Ian White

September 13th, 2008 @ 08:35 PM

The reason for the reversion in c21f35c has been fixed. Thanks Jason Lee for the bug report.

The problem was that I had changed resource_saved?'s behaviour to not saving the model if it had already been saved. In the future resource_saved? will be deprecated, but not yet.

BTW. All of these changes to resource_saved? behaviour is aimed at making RC drop in compatible with rspec's generated controller specs (try rake spec:generate).

To do that I need the default update action to use :update_attributes. This meant that the old strategy of keeping track of saves by using save_resource wont work. Instead, we keep track by looking at the AR's state (see lib/ardes/active_record/saved.rb) which is a far better solution anyway.

Squashed commit of the following:

commit f8a589f9b3711140fa7e125a42681acc1ad97e10 Author: Ian White ian.w.white@gmail.com Date: Sun Sep 14 05:21:23 2008 +1000

Docfixes, CHANGELOG, SPECDOC

commit e670fd2e18678d94292bc684e57f8bf64a2e2dc9 Author: Ian White ian.w.white@gmail.com Date: Sun Sep 14 05:09:24 2008 +1000

Fixed logic error in AR.saved?

commit b3e2838e1515503820e49eaf7853099df33a0d8e Author: Ian White ian.w.white@gmail.com Date: Sun Sep 14 05:05:29 2008 +1000

Adding specs for AR.saved? and AR.validation_attempted?

commit 3e649c53d06a788b5e70878b2cb7e386571fce31 Author: Ian White ian.w.white@gmail.com Date: Sun Sep 14 04:56:56 2008 +1000

Fixed bug in init.rb

commit c72b1a917339b7ee94700d8eb6b6bd939ad7e4b2 Author: Ian White ian.w.white@gmail.com Date: Sun Sep 14 04:56:28 2008 +1000

Fixed bug in init.rb

commit d5702c06d8d54b80dd011f79ff3d2ac782ce902e Author: Ian White ian.w.white@gmail.com Date: Sun Sep 14 04:55:18 2008 +1000

Added AR.saved? & AR.validation_atempted? convenience methods.  Returned save_resource?'s behaviour to that of saving the record if it has not had save attempted

commit af11af7848811da5ca87efdd8eb678251c5bd6d5 Author: Ian White ian.w.white@gmail.com Date: Sat Sep 13 09:58:15 2008 +1000

Added resource_saved? specs, and removed .first and .last for BC in specs to 2.0.x

commit 5efb59f7c0fb8be72b12b5476291e59e6af658c0 Author: Ian White ian.w.white@gmail.com Date: Sat Sep 13 09:57:30 2008 +1000

Added resource_saved? specs, and removed .first and .last for BC in specs to 2.0.x

commit 8b73130de97ab87369ec395be4ee696de76e773a Author: Ian White ian.w.white@gmail.com Date: Sat Sep 13 09:46:52 2008 +1000

Small fix for comments_with_models spec

commit 3a2426cd00fa945d155d4f3ebff6ccc48a7b0cf2 Author: Ian White ian.w.white@gmail.com Date: Sat Sep 13 09:29:26 2008 +1000

Added specs for comments_controller which use real DB objects

commit 79a93132f6e49a556775e6508a5773686ccd6332 Author: Ian White ian.w.white@gmail.com Date: Sat Sep 13 06:27:51 2008 +1000

Fixing comments with models spec

commit 05f551f5755e6db41a83dde0c9b0db99a4e168d8 Author: Ian White ian.w.white@gmail.com Date: Sat Sep 13 06:24:19 2008 +1000

Added some controller specs with real models

commit 6163aba8c5315598d173cd205bc2d69286ae4271 Author: Ian White ian.w.white@gmail.com Date: Sat Sep 13 06:02:36 2008 +1000

Updated 2.1.x target

commit b3c6d13a77aff7d831e136221ead8b7fa7bed4e1 Author: Ian White ian.w.white@gmail.com Date: Sat Sep 13 04:54:40 2008 +1000

Add resource_saved stuff back in (2f49687, 7423cf1)

This reverts commit c21f35c35ef71576c99d412bc562ab10278c652b.

http://github.com/ianwhite/resou...

Committed by Ian White

  • M CHANGELOG
  • M README.rdoc
  • M Rakefile
  • M SPECDOC
  • M garlic_example.rb
  • M init.rb
  • M lib/ardes/active_record/saved.rb
  • M lib/ardes/resources_controller.rb
  • M lib/ardes/resources_controller/actions.rb
  • M spec/app.rb
  • M spec/controllers/addresses_controller_spec.rb
  • M spec/controllers/admin_forums_controller_spec.rb
  • M spec/controllers/comments_controller_spec.rb
  • M spec/controllers/comments_controller_with_models_spec.rb
  • M spec/controllers/forum_posts_controller_spec.rb
  • M spec/controllers/forums_controller_spec.rb
  • M spec/controllers/infos_controller_spec.rb
  • M spec/controllers/owners_controller_spec.rb
  • M spec/controllers/resource_saved_spec.rb
  • M spec/controllers/tags_controller_via_forum_post_comment_spec.rb
  • M spec/controllers/users_controller_spec.rb
  • M spec/models/comment_saved_spec.rb
  • M spec/specs/resources_controller_spec.rb
New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

resources_controller is a rails plugin that eases the pain of RESTful controllers.