1. 10 5月, 2013 1 次提交
  2. 01 5月, 2013 1 次提交
  3. 30 4月, 2013 1 次提交
  4. 03 4月, 2013 1 次提交
  5. 02 4月, 2013 1 次提交
  6. 28 3月, 2013 1 次提交
  7. 27 3月, 2013 1 次提交
  8. 15 3月, 2013 2 次提交
  9. 05 3月, 2013 1 次提交
  10. 04 3月, 2013 1 次提交
  11. 25 2月, 2013 1 次提交
    • Y
      remove AR auto-explain (config.auto_explain_threshold_in_seconds) · d3688e02
      Yves Senn 提交于
      We discussed that the auto explain feature is rarely used.
      This PR removes only the automatic explain. You can still display
      the explain output for any given relation using `ActiveRecord::Relation#explain`.
      
      As a side-effect this should also fix the connection problem during
      asset compilation (#9385). The auto explain initializer in the `ActiveRecord::Railtie`
      forced a connection.
      d3688e02
  12. 19 1月, 2013 1 次提交
  13. 12 1月, 2013 1 次提交
  14. 04 1月, 2013 1 次提交
  15. 29 11月, 2012 1 次提交
  16. 24 11月, 2012 1 次提交
  17. 10 11月, 2012 1 次提交
  18. 23 10月, 2012 1 次提交
  19. 19 10月, 2012 2 次提交
  20. 16 10月, 2012 1 次提交
  21. 17 9月, 2012 1 次提交
  22. 15 8月, 2012 1 次提交
  23. 03 8月, 2012 2 次提交
  24. 02 8月, 2012 2 次提交
    • J
      Refactor a bit · 66aaca4e
      Jon Leighton 提交于
      This doesn't change the exernal behavior, but it moves some code around
      to where I think it properly belongs.
      66aaca4e
    • J
      Add `Relation#load` · 437851ea
      Jon Leighton 提交于
      This method explicitly loads the records and then returns `self`.
      
      Rather than deciding between "do I want an array or a relation?",
      most people are actually asking themselves "do I want to eager load
      or lazy load?" Therefore, this method provides a way to explicitly
      eager-load without having to switch from a `Relation` to an array.
      
      Example:
      
          @posts = Post.where(published: true).load
      437851ea
  25. 22 7月, 2012 1 次提交
  26. 20 7月, 2012 1 次提交
  27. 18 7月, 2012 2 次提交
  28. 17 7月, 2012 2 次提交
  29. 07 7月, 2012 4 次提交
    • J
      Load all records in Relation#inspect · d8ca791f
      Jon Leighton 提交于
      A test was failing due to the way that Relation#inspect causes
      association proxies to ignore unsaved records added to the association.
      
      This is fixed by simply calling to_a and letting to_a figure out how to
      get the records (which, in the case of associations, takes into account
      new records).
      
      I think it is acceptable to do this rather than limiting the query at
      the database level:
      
      * It's what we've done in all released Rails versions up to this point
      * The goal of the limit is to not flood the console with output - this
        is the problem we're targeting, rather than the actual loading of the
        records from the database
      * You probably want to do something with those records later anyway,
        otherwise you wouldn't have built a relation for them.
      d8ca791f
    • J
    • J
      Simplify Relation#inspect · b76b9e21
      Jon Leighton 提交于
      b76b9e21
    • D
      Limit the number of records in Relation#inspect · 7d0053e6
      Damien Mathieu 提交于
      While it's interesting to have the results array, it can make a console or a webpage freeze if there are a lot of them.
      So this limits the number of records displayed in #inspect to 10 and tells how much were effectively found.
      7d0053e6
  30. 06 7月, 2012 1 次提交
    • J
      Show the records in Relation#inspect · 07314e64
      Jon Leighton 提交于
      The reason for removing the previous implementation of `#inspect` was
      that it hid from you that you were dealing with a `Relation` rather than
      an `Array`.
      
      But it is still useful to be able to see the records, particularly if you're
      writing something like the following in tests:
      
          assert_equal [foo], Post.where(:bar)
      
      If the assertion fails, you want to see what records were actually
      loaded.
      
      So this implementation makes it clear that you've got a `Relation`, but
      also shows your records.
      07314e64
  31. 30 6月, 2012 1 次提交