1. 22 3月, 2012 1 次提交
    • J
      Deprecate eager-evaluated scopes. · 0a12a5f8
      Jon Leighton 提交于
      Don't use this:
      
          scope :red, where(color: 'red')
          default_scope where(color: 'red')
      
      Use this:
      
          scope :red, -> { where(color: 'red') }
          default_scope { where(color: 'red') }
      
      The former has numerous issues. It is a common newbie gotcha to do
      the following:
      
          scope :recent, where(published_at: Time.now - 2.weeks)
      
      Or a more subtle variant:
      
          scope :recent, -> { where(published_at: Time.now - 2.weeks) }
          scope :recent_red, recent.where(color: 'red')
      
      Eager scopes are also very complex to implement within Active
      Record, and there are still bugs. For example, the following does
      not do what you expect:
      
          scope :remove_conditions, except(:where)
          where(...).remove_conditions # => still has conditions
      0a12a5f8
  2. 08 3月, 2012 1 次提交
  3. 06 3月, 2012 1 次提交
  4. 11 2月, 2012 1 次提交
  5. 03 2月, 2012 1 次提交
  6. 01 2月, 2012 1 次提交
  7. 31 1月, 2012 1 次提交
  8. 17 1月, 2012 3 次提交
  9. 07 1月, 2012 1 次提交
  10. 30 12月, 2011 1 次提交
    • A
      Test fixtures with custom model and table names · 6468ff41
      Alexey Muranov 提交于
      Test using fixtures with random names and model names, that is not following naming conventions but using set_fixture_class instead.
      
      It is expected that the table name be defined in the model, but this is not explicitly tested here.  This will need to be fixed.
      6468ff41
  11. 29 12月, 2011 2 次提交
  12. 24 12月, 2011 4 次提交
  13. 22 12月, 2011 1 次提交
  14. 17 12月, 2011 1 次提交
  15. 15 12月, 2011 1 次提交
  16. 09 12月, 2011 1 次提交
  17. 30 11月, 2011 6 次提交
  18. 28 11月, 2011 1 次提交
  19. 04 11月, 2011 1 次提交
  20. 14 10月, 2011 2 次提交
  21. 13 9月, 2011 2 次提交
  22. 09 9月, 2011 1 次提交
  23. 06 9月, 2011 1 次提交
  24. 05 9月, 2011 1 次提交
  25. 29 8月, 2011 1 次提交
  26. 13 8月, 2011 1 次提交
  27. 25 7月, 2011 1 次提交