1. 20 8月, 2010 1 次提交
  2. 14 8月, 2010 1 次提交
  3. 13 8月, 2010 1 次提交
  4. 12 8月, 2010 3 次提交
  5. 05 8月, 2010 1 次提交
  6. 04 8月, 2010 1 次提交
  7. 31 7月, 2010 3 次提交
  8. 30 7月, 2010 2 次提交
  9. 29 7月, 2010 2 次提交
  10. 15 7月, 2010 2 次提交
  11. 14 7月, 2010 1 次提交
  12. 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
  13. 27 6月, 2010 3 次提交
  14. 26 6月, 2010 5 次提交
  15. 25 6月, 2010 1 次提交
  16. 22 6月, 2010 1 次提交
  17. 21 6月, 2010 1 次提交
  18. 20 6月, 2010 1 次提交
  19. 03 6月, 2010 1 次提交
  20. 02 6月, 2010 1 次提交
  21. 15 5月, 2010 1 次提交
  22. 07 5月, 2010 1 次提交
  23. 29 4月, 2010 1 次提交
  24. 21 4月, 2010 1 次提交
  25. 11 4月, 2010 2 次提交