1. 17 12月, 2010 1 次提交
  2. 16 12月, 2010 1 次提交
  3. 24 11月, 2010 1 次提交
  4. 20 11月, 2010 2 次提交
  5. 19 11月, 2010 1 次提交
  6. 18 11月, 2010 1 次提交
  7. 16 11月, 2010 3 次提交
  8. 09 11月, 2010 1 次提交
  9. 07 11月, 2010 1 次提交
  10. 06 11月, 2010 1 次提交
  11. 31 10月, 2010 1 次提交
  12. 27 10月, 2010 1 次提交
  13. 23 10月, 2010 1 次提交
  14. 11 10月, 2010 1 次提交
  15. 28 9月, 2010 1 次提交
  16. 19 9月, 2010 1 次提交
  17. 16 9月, 2010 1 次提交
  18. 10 9月, 2010 2 次提交
  19. 08 9月, 2010 1 次提交
  20. 05 9月, 2010 1 次提交
    • N
      order should always be concatenated. · 91fec0d2
      Neeraj Singh 提交于
      order that is declared first has highest priority in all cases.
      
      Here are some examples.
      
      Car.order('name desc').find(:first, :order => 'id').name
      
      Car.named_scope_with_order.named_scope_with_another_order
      
      Car.order('id DESC').scoping do
        Car.find(:first, :order => 'id asc')
      end
      
      No special treatment to with_scope or scoping.
      
      Also note that if default_scope declares an order then the order
      declared in default_scope has the highest priority unless
      with_exclusive_scope is used.
      Signed-off-by: NSantiago Pastorino <santiago@wyeworks.com>
      91fec0d2
  21. 01 9月, 2010 1 次提交
  22. 17 8月, 2010 1 次提交
  23. 14 8月, 2010 3 次提交
  24. 13 8月, 2010 1 次提交
  25. 07 8月, 2010 2 次提交
  26. 31 7月, 2010 1 次提交
  27. 22 7月, 2010 1 次提交
  28. 29 6月, 2010 1 次提交
    • 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
  29. 26 6月, 2010 4 次提交
  30. 24 6月, 2010 1 次提交