Skip to content
Commits on Nov 28, 2010
  1. @josevalim

    Partialy revert f1c13b0

    josevalim committed Nov 28, 2010
Commits on Aug 12, 2010
  1. @josevalim

    Make update_attribute behave as in Rails 2.3 and document the behavio…

    josevalim committed Aug 12, 2010
    …r intrinsic to its implementation.
Commits on Aug 2, 2010
  1. @josevalim
Commits on Jul 13, 2010
  1. @josevalim
Commits on Jul 8, 2010
  1. @josevalim
Commits on Jun 29, 2010
  1. @josevalim

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

    josevalim committed Jun 29, 2010
    …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
Something went wrong with that request. Please try again.