1. 24 9月, 2013 1 次提交
  2. 23 9月, 2013 1 次提交
  3. 19 9月, 2013 1 次提交
  4. 13 9月, 2013 2 次提交
  5. 12 9月, 2013 2 次提交
  6. 11 9月, 2013 1 次提交
  7. 10 9月, 2013 1 次提交
    • L
      Make CollectionAssociation first/last with integer fetch with query · 8875e28a
      Lann Martin 提交于
      When first or last is called with an integer on an unloaded association,
      the entire collection is loaded. This differs surprisingly from the
      behavior of Relation#first/last, which translate the call into a limit
      query. For large collections this can make a big difference in
      performance.
      
      Change CollectionAssociation#fetch_first_or_last_using_find? to make
      this kind of call delegate to Relation.
      8875e28a
  8. 09 9月, 2013 2 次提交
  9. 04 9月, 2013 2 次提交
  10. 30 8月, 2013 1 次提交
  11. 29 8月, 2013 1 次提交
  12. 27 8月, 2013 1 次提交
  13. 26 8月, 2013 1 次提交
  14. 21 8月, 2013 1 次提交
  15. 19 8月, 2013 1 次提交
  16. 15 8月, 2013 1 次提交
  17. 12 8月, 2013 2 次提交
    • B
      Restore the use of `#add_to_target` for nested attribute updates on existing... · d35e900c
      Ben Woosley 提交于
      Restore the use of `#add_to_target` for nested attribute updates on existing records, and don't bother updating the association if the update is going to be rejected anyway.
      
      This requires adding a `skip_callbacks` argument to `#add_to_target`
      so that we don't call the callbacks multiple times in this case,
      which is functionally an application of existing association data,
      rather than an addition of a new record to the association.
      d35e900c
    • D
      Fix interactions between :before_add callbacks and nested attributes assignment · 018697de
      Dr.(USA) Joerg Schray 提交于
      Issue #1: :before_add callback is called when nested attributes assignment assigns to existing record if the association is not yet loaded
      Issue #2: Nested Attributes assignment does not affect the record in the association target when callback triggers loading of the association
      018697de
  18. 10 8月, 2013 1 次提交
  19. 08 8月, 2013 2 次提交
  20. 06 8月, 2013 2 次提交
    • R
      Add CHANGELOG entry for #11767 · 4c1c2e65
      Rafael Mendonça França 提交于
      [ci skip]
      4c1c2e65
    • S
      Create sqlite3 directory if not present · f0362394
      schneems 提交于
      If the `db/` directory is not present on a remote machine it will blow up in unexpected ways with error messages that do not indicate there is a missing directory:
      
      ```
      SQLite3::CantOpenException: unable to open database file
      ```
      
      This PR checks to see if a directory exists for the sqlite3 file and if not creates it for you.
      
      This PR is an alternative to #11692 as suggested by @josevalim
      f0362394
  21. 02 8月, 2013 3 次提交
  22. 30 7月, 2013 1 次提交
    • R
      Revert change on ActiveRecord::Relation#order method that prepends new · 92c5a224
      Rafael Mendonça França 提交于
      order on the old ones
      
      The previous behavior added a major backward incompatibility since it
      impossible to have a upgrade path without major changes on the
      application code.
      
      We are taking the most conservative path to be consistent with the idea
      of having a smoother upgrade on Rails 4.
      
      We are reverting the behavior for what was in Rails 3.x and,
      if needed, we will implement a new API to prepend the order clauses in
      Rails 4.1.
      92c5a224
  23. 29 7月, 2013 1 次提交
    • S
      Add ability to specify how a class is converted to Arel predicate · 92a60338
      sgrif 提交于
      This adds the ability for rails apps or gems to have granular control
      over how a domain object is converted to sql. One simple use case would
      be to add support for Regexp. Another simple case would be something
      like the following:
      
          class DateRange < Struct.new(:start, :end)
            def include?(date)
              (start..end).cover?(date)
            end
          end
      
          class DateRangePredicate
            def call(attribute, range)
              attribute.in(range.start..range.end)
            end
          end
      
          ActiveRecord::PredicateBuilder.register_handler(DateRange,
            DateRangePredicate.new)
      
      More complex cases might include taking a currency object and converting
      it from EUR to USD before performing the query.
      
      By moving the existing handlers to this format, we were also able to
      nicely refactor a rather nasty method in PredicateBuilder.
      92a60338
  24. 22 7月, 2013 4 次提交
    • B
      Don't allow `quote_value` to be called without a column · 31a43ebc
      Ben Woosley 提交于
      Some adapters require column information to do their job properly.
      By enforcing the provision of the column for this internal method
      we ensure that those using adapters that require column information
      will always get the proper behavior.
      31a43ebc
    • B
      Tidy up the "Specified column type for quote_value" changes · c083dc22
      Ben Woosley 提交于
      This includes fixing typos in changelog, removing a deprecated
      mocha/setup test require, and preferring the `column_for_attribute`
      accessor over direct access to the columns_hash in the new code.
      c083dc22
    • A
      Specified column type for quote_value · 39b5bfe2
      Alfred Wong 提交于
      When calling quote_value the underlying connection sometimes requires
      more information about the column to properly return the correct quoted
      value.
      
      I ran into this issue when using optimistic locking in JRuby and the
      activerecord-jdbcmssql-adapter. In SQLSever 2000, we aren't allowed to
      insert a integer into a NVARCHAR column type so we need to format it as
      N'3' if we want to insert into the NVARCHAR type. Unfortuantely, without
      the column type being passed the connection adapter cannot properly return
      the correct quote value because it doesn't know to return N'3' or '3'.
      
      This patch is fairly straight forward where it just passes in the column
      type into the quote_value, as it already has the ability to take in the column,
      so it can properly handle at the connection level.
      
      I've added the tests required to make sure that the quote_value method
      is being passed the column type so that the underlying connection can
      determine how to quote the value.
      39b5bfe2
    • V
      rescue from all exceptions in `ConnectionManagement#call` · 0b6c1f08
      Vipul A M 提交于
      Fixes #11497
      
      As `ActiveRecord::ConnectionAdapters::ConnectionManagement` middleware does not rescue from Exception (but only from StandardError),
      the Connection Pool quickly runs out of connections when multiple erroneous Requests come in right after each other.
      
      Recueing from all exceptions and not just StandardError, fixes this behaviour.
      0b6c1f08
  25. 17 7月, 2013 1 次提交
  26. 16 7月, 2013 3 次提交