Skip to content
This repository

Jul 21, 2010

  1. Neeraj Singh

    expanded comment for update_attribute method

    neerajdotname authored fxn committed
  2. Neeraj Singh

    update_attribute should not update readonly attributes

    [#5106 state:resolved]
    
    Signed-off-by: José Valim <jose.valim@gmail.com>
    neerajdotname authored josevalim committed

Jul 14, 2010

  1. Xavier Noria

    revises the rdoc of update_attributes and update_attributes! to docum…

    …ent they are wrapped in a transaction, and adds code comments explaining why
    fxn authored

Jul 13, 2010

  1. Neeraj Singh

    update_attributes and update_attributes! are now wrapped in a transac…

    …tion
    
    [#922 state:resovled]
    
    Signed-off-by: José Valim <jose.valim@gmail.com>
    neerajdotname authored josevalim committed
  2. José Valim

    Tidying up a bit, so update_attribute is not called twice on touch.

    josevalim authored
  3. Neeraj Singh

    with this fix touch method - does not call validations - doest not ca…

    …ll 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>
    neerajdotname authored josevalim committed

Jul 08, 2010

  1. José Valim

    Improve a bit the code in latest commits.

    josevalim authored
  2. Neeraj Singh

    This patch changes update_attribute implementatino so:

    - 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>
    neerajdotname authored josevalim committed

Jun 29, 2010

  1. José Valim

    Add scoping and unscoped as the syntax to replace the old with_scope …

    …and 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
    josevalim authored

Jun 16, 2010

  1. Rizwan Reza

    Adds title and minor changes.

    rizwanreza authored

May 08, 2010

  1. Yehuda Katz

    eliminate alias_method_chain from ActiveRecord

    wycats authored
Something went wrong with that request. Please try again.