1. 05 4月, 2013 1 次提交
  2. 30 3月, 2013 2 次提交
  3. 28 3月, 2013 1 次提交
  4. 19 3月, 2013 1 次提交
  5. 08 3月, 2013 2 次提交
  6. 03 8月, 2012 1 次提交
    • J
      Remove ActiveRecord::Base.to_a · 55b24888
      Jon Leighton 提交于
      On reflection, it seems like a bit of a weird method to have on
      ActiveRecord::Base, and it shouldn't be needed most of the time anyway.
      55b24888
  7. 28 7月, 2012 1 次提交
  8. 27 7月, 2012 1 次提交
    • J
      ActiveRecord::Base.all returns a Relation. · 6a81ccd6
      Jon Leighton 提交于
      Previously it returned an Array.
      
      If you want an array, call e.g. `Post.to_a` rather than `Post.all`. This
      is more explicit.
      
      In most cases this should not break existing code, since
      Relations use method_missing to delegate unknown methods to #to_a
      anyway.
      6a81ccd6
  9. 10 6月, 2012 2 次提交
  10. 18 5月, 2012 1 次提交
  11. 04 5月, 2012 3 次提交
  12. 27 4月, 2012 6 次提交
  13. 26 4月, 2012 3 次提交
  14. 25 4月, 2012 2 次提交
  15. 22 3月, 2012 2 次提交
    • 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
    • J
      Remove valid_scope_name? check - use ruby · f6db31ec
      Jon Leighton 提交于
      scope is syntactic sugar for defining a class method. Ruby allows
      redefining methods but emits a warning when run with -w. So let's
      not implement our own logic for this. Users should run with -w if they
      want to be warned about redefined methods.
      f6db31ec
  16. 12 2月, 2012 1 次提交
  17. 11 2月, 2012 1 次提交
  18. 22 12月, 2011 1 次提交
  19. 17 12月, 2011 1 次提交
  20. 06 9月, 2011 2 次提交
  21. 18 7月, 2011 2 次提交
  22. 07 6月, 2011 1 次提交
  23. 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
  24. 03 6月, 2011 1 次提交