1. 06 9月, 2011 1 次提交
  2. 18 7月, 2011 2 次提交
  3. 07 6月, 2011 1 次提交
  4. 05 6月, 2011 1 次提交
    • J
      Refactor Active Record test connection setup. Please see the... · 253bb6b9
      Jon Leighton 提交于
      Refactor Active Record test connection setup. Please see the RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
      253bb6b9
  5. 03 6月, 2011 1 次提交
  6. 11 5月, 2011 1 次提交
  7. 18 4月, 2011 1 次提交
  8. 13 4月, 2011 3 次提交
  9. 30 3月, 2011 1 次提交
  10. 25 2月, 2011 1 次提交
  11. 18 2月, 2011 1 次提交
  12. 16 12月, 2010 1 次提交
  13. 16 11月, 2010 1 次提交
  14. 20 10月, 2010 1 次提交
  15. 06 9月, 2010 1 次提交
  16. 17 8月, 2010 1 次提交
  17. 03 8月, 2010 1 次提交
  18. 21 7月, 2010 1 次提交
  19. 30 6月, 2010 1 次提交
  20. 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
  21. 05 6月, 2010 1 次提交
  22. 04 6月, 2010 1 次提交
  23. 17 5月, 2010 1 次提交
  24. 15 5月, 2010 1 次提交
  25. 07 4月, 2010 1 次提交
  26. 06 4月, 2010 1 次提交
  27. 30 3月, 2010 1 次提交
  28. 29 3月, 2010 1 次提交
  29. 16 3月, 2010 1 次提交
  30. 22 1月, 2010 1 次提交
  31. 20 1月, 2010 1 次提交
  32. 18 1月, 2010 4 次提交
  33. 27 12月, 2009 1 次提交
  34. 10 8月, 2009 1 次提交