1. 23 12月, 2016 1 次提交
  2. 08 8月, 2016 1 次提交
    • X
      code gardening: removes redundant selfs · a9dc4545
      Xavier Noria 提交于
      A few have been left for aesthetic reasons, but have made a pass
      and removed most of them.
      
      Note that if the method `foo` returns an array, `foo << 1`
      is a regular push, nothing to do with assignments, so
      no self required.
      a9dc4545
  3. 07 8月, 2016 2 次提交
  4. 20 7月, 2016 1 次提交
  5. 06 9月, 2015 1 次提交
  6. 22 7月, 2015 1 次提交
  7. 26 11月, 2013 1 次提交
  8. 11 9月, 2013 1 次提交
  9. 18 8月, 2013 1 次提交
  10. 25 7月, 2013 1 次提交
  11. 24 1月, 2013 3 次提交
  12. 13 11月, 2012 1 次提交
  13. 05 11月, 2012 1 次提交
  14. 28 7月, 2012 1 次提交
  15. 22 6月, 2012 1 次提交
  16. 27 4月, 2012 1 次提交
  17. 26 4月, 2012 1 次提交
  18. 25 4月, 2012 1 次提交
  19. 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
  20. 07 1月, 2012 1 次提交
  21. 24 12月, 2011 1 次提交
  22. 17 12月, 2011 1 次提交
  23. 13 9月, 2011 1 次提交
  24. 18 4月, 2011 1 次提交
  25. 13 4月, 2011 1 次提交
  26. 12 1月, 2011 1 次提交
  27. 09 11月, 2010 1 次提交
  28. 20 10月, 2010 1 次提交
  29. 14 8月, 2010 2 次提交
  30. 05 6月, 2010 1 次提交
  31. 18 1月, 2010 1 次提交
  32. 08 9月, 2009 2 次提交
  33. 30 7月, 2009 1 次提交
  34. 16 7月, 2009 1 次提交
  35. 12 3月, 2009 1 次提交