1. 17 2月, 2016 1 次提交
  2. 18 1月, 2016 1 次提交
  3. 26 8月, 2015 1 次提交
  4. 07 8月, 2015 1 次提交
    • S
      Add ActiveRecord::Relation#in_batches · 25cee1f0
      Sina Siadat 提交于
      `in_batches` yields Relation objects if a block is given, otherwise it
      returns an instance of `BatchEnumerator`. The existing `find_each` and
      `find_in_batches` methods work with batches of records. The new API
      allows working with relation batches as well.
      
      Examples:
      
          Person.in_batches.each_record(&:party_all_night!)
          Person.in_batches.update_all(awesome: true)
          Person.in_batches.delete_all
          Person.in_batches.map do |relation|
            relation.delete_all
            sleep 10 # Throttles the delete queries
          end
      25cee1f0
  5. 29 3月, 2015 1 次提交
  6. 25 3月, 2015 1 次提交
    • C
      DRY up STI subclass logic · 7c0f8c64
      Cody Cutrer 提交于
      the newer method used for discriminating new records did not
      use the older and more robust method used for instantiating
      existing records, but did have a better post-check to ensure
      the sublass was in the hierarchy. so move the descendants check
      to find_sti_class, and then simply call find_sti_class from
      subclass_from_attributes
      
      now with fixed specs
      7c0f8c64
  7. 17 2月, 2015 1 次提交
  8. 09 2月, 2015 1 次提交
  9. 06 2月, 2014 2 次提交
  10. 30 1月, 2014 1 次提交
  11. 21 1月, 2014 1 次提交
  12. 06 12月, 2013 1 次提交
  13. 28 6月, 2013 1 次提交
  14. 19 6月, 2013 1 次提交
  15. 21 5月, 2013 1 次提交
  16. 28 3月, 2013 2 次提交
  17. 19 3月, 2013 1 次提交
  18. 31 10月, 2012 2 次提交
  19. 22 9月, 2012 3 次提交
  20. 16 9月, 2012 1 次提交
  21. 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
  22. 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
  23. 27 4月, 2012 1 次提交
  24. 05 9月, 2011 2 次提交
  25. 07 7月, 2011 1 次提交
  26. 22 6月, 2011 1 次提交
    • C
      Stop find_in_batches using the records after yielding. · 96be08de
      Caius Durling 提交于
      Currently if the code that calls .find_in_batches modifies the yielded array in place then .find_in_batches can enter an infinite loop searching with ruby object ids in the database instead of the primary key of records in the database. This happens because it naively assumes the yielded array hasn't been modified before calling #id on the last object in the array. And ruby (1.8 at least) alias' #id to #object_id so an integer is still returned no matter what the last object is.
      
      By moving finding the #id of the last object before yielding the array it means the calling code can do whatever it wants to the array in terms of modifying it in place, and .find_in_batches doesn't care.
      96be08de
  27. 07 6月, 2011 1 次提交
  28. 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
  29. 30 3月, 2011 1 次提交
  30. 15 1月, 2011 1 次提交
  31. 19 10月, 2010 1 次提交
  32. 03 10月, 2010 1 次提交
  33. 09 5月, 2010 1 次提交
  34. 29 3月, 2010 1 次提交