1. 29 10月, 2012 1 次提交
  2. 19 10月, 2012 2 次提交
  3. 12 10月, 2012 1 次提交
  4. 10 10月, 2012 1 次提交
  5. 24 8月, 2012 1 次提交
  6. 19 8月, 2012 1 次提交
  7. 17 8月, 2012 1 次提交
    • E
      Fix merge error when Equality LHS is non-attribute · b127d86c
      Ernie Miller 提交于
      This is at best a band-aid for a more proper fix, since it won't truly
      handle the removal of the previous equality condition of these other
      nodes. I'm planning to put in some work on ARel toward supporting that
      goal.
      
      Related: rails/arel#130, ernie/squeel#153, ernie/squeel#156
      b127d86c
  8. 15 8月, 2012 1 次提交
  9. 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
  10. 02 8月, 2012 1 次提交
    • 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
  11. 31 7月, 2012 1 次提交
  12. 28 7月, 2012 1 次提交
  13. 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
  14. 13 7月, 2012 1 次提交
  15. 07 7月, 2012 2 次提交
  16. 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
  17. 22 6月, 2012 1 次提交
  18. 03 6月, 2012 1 次提交
  19. 01 6月, 2012 1 次提交
  20. 21 5月, 2012 1 次提交
  21. 18 5月, 2012 2 次提交
  22. 17 5月, 2012 1 次提交
  23. 11 5月, 2012 1 次提交
  24. 06 5月, 2012 1 次提交
  25. 05 5月, 2012 1 次提交
  26. 04 5月, 2012 1 次提交
  27. 30 4月, 2012 1 次提交
  28. 27 4月, 2012 3 次提交
  29. 26 4月, 2012 2 次提交
  30. 11 4月, 2012 1 次提交
  31. 04 4月, 2012 1 次提交
  32. 03 4月, 2012 1 次提交
    • B
      Removes caching from ActiveRecord::Core::ClassMethods#relation · 68677ffb
      Benedikt Deicke 提交于
      The #relation method gets called in four places and the return value was instantly cloned in three of them. The only place that did not clone was ActiveRecord::Scoping::Default::ClassMethods#unscoped. This introduced a bug described in #5667 and should really clone the relation, too. This means all four places would clone the relation, so it doesn't make a lot of sense caching it in the first place.
      
      The four places with calls to relations are:
      
      activerecord/lib/active_record/scoping/default.rb:110:in `block in build_default_scope'"
      activerecord/lib/active_record/scoping/default.rb:42:in `unscoped'"
      activerecord/lib/active_record/scoping/named.rb:38:in `scoped'"
      activerecord/lib/active_record/scoping/named.rb:52:in `scope_attributes'"
      68677ffb
  33. 30 3月, 2012 1 次提交
  34. 18 3月, 2012 1 次提交