aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/persistence.rb
Commit message (Collapse)AuthorAgeFilesLines
* update_attribute should not update readonly attributesNeeraj Singh2010-07-211-0/+2
| | | | | | [#5106 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* revises the rdoc of update_attributes and update_attributes! to document ↵Xavier Noria2010-07-141-4/+9
| | | | they are wrapped in a transaction, and adds code comments explaining why
* update_attributes and update_attributes! are now wrapped in a transactionNeeraj Singh2010-07-131-4/+8
| | | | | | [#922 state:resovled] Signed-off-by: José Valim <jose.valim@gmail.com>
* Tidying up a bit, so update_attribute is not called twice on touch.José Valim2010-07-131-10/+8
|
* with this fix touch method - does not call validations - doest not call ↵Neeraj Singh2010-07-131-0/+1
| | | | | | | | callbacks - updates updated_at/on along with attribute if attribute is provided - marks udpated_at/on and attribute as NOT changed [#2520 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Improve a bit the code in latest commits.José Valim2010-07-081-7/+9
|
* This patch changes update_attribute implementatino so:Neeraj Singh2010-07-081-5/+12
| | | | | | | | | | - it will only save the attribute it has been asked to save and not all dirty attributes - it does not invoke callbacks - it does change updated_at/on Signed-off-by: José Valim <jose.valim@gmail.com>
* Add scoping and unscoped as the syntax to replace the old with_scope and ↵José Valim2010-06-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with_exclusive_scope. A few examples: * with_scope now should be scoping: Before: Comment.with_scope(:find => { :conditions => { :post_id => 1 } }) do Comment.first #=> SELECT * FROM comments WHERE post_id = 1 end After: Comment.where(:post_id => 1).scoping do Comment.first #=> SELECT * FROM comments WHERE post_id = 1 end * with_exclusive_scope now should be unscoped: class Post < ActiveRecord::Base default_scope :published => true end Post.all #=> SELECT * FROM posts WHERE published = true Before: Post.with_exclusive_scope do Post.all #=> SELECT * FROM posts end After: Post.unscoped do Post.all #=> SELECT * FROM posts end Notice you can also use unscoped without a block and it will return an anonymous scope with default_scope values: Post.unscoped.all #=> SELECT * FROM posts
* Adds title and minor changes.Rizwan Reza2010-06-161-11/+18
|
* eliminate alias_method_chain from ActiveRecordwycats2010-05-091-0/+230