1. 08 9月, 2010 1 次提交
  2. 07 9月, 2010 1 次提交
  3. 05 9月, 2010 1 次提交
  4. 01 9月, 2010 5 次提交
  5. 25 8月, 2010 3 次提交
  6. 24 8月, 2010 1 次提交
  7. 20 8月, 2010 1 次提交
  8. 14 8月, 2010 1 次提交
  9. 13 8月, 2010 1 次提交
  10. 12 8月, 2010 3 次提交
  11. 05 8月, 2010 1 次提交
  12. 04 8月, 2010 1 次提交
  13. 31 7月, 2010 3 次提交
  14. 30 7月, 2010 2 次提交
  15. 29 7月, 2010 2 次提交
  16. 15 7月, 2010 2 次提交
  17. 14 7月, 2010 1 次提交
  18. 29 6月, 2010 2 次提交
    • J
      Add scoping and unscoped as the syntax to replace the old with_scope and... · bd1666ad
      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
      bd1666ad
    • S
      Remove unneeded reject · 093c4eed
      Santiago Pastorino 提交于
      093c4eed
  19. 27 6月, 2010 3 次提交
  20. 26 6月, 2010 5 次提交