1. 10 5月, 2015 1 次提交
  2. 09 5月, 2015 1 次提交
  3. 08 5月, 2015 1 次提交
  4. 06 5月, 2015 2 次提交
  5. 05 5月, 2015 2 次提交
  6. 04 5月, 2015 5 次提交
  7. 03 5月, 2015 7 次提交
  8. 02 5月, 2015 1 次提交
  9. 01 5月, 2015 1 次提交
  10. 30 4月, 2015 2 次提交
  11. 29 4月, 2015 1 次提交
    • E
      Apply schema cache dump when creating connections · 33fe7cc8
      Eugene Kenny 提交于
      The `db:schema:cache:dump` rake task dumps the database schema structure
      to `db/schema_cache.dump`. If this file is present, the schema details
      are loaded into the currently checked out connection by a railtie while
      Rails is booting, to avoid having to query the database for its schema.
      
      The schema cache dump is only applied to the initial connection used to
      boot the application though; other connections from the same pool are
      created with an empty schema cache, and still have to load the structure
      of each table directly from the database.
      
      With this change, a copy of the schema cache is associated with the
      connection pool and applied to connections as they are created.
      33fe7cc8
  12. 28 4月, 2015 1 次提交
  13. 27 4月, 2015 4 次提交
  14. 24 4月, 2015 2 次提交
  15. 23 4月, 2015 1 次提交
  16. 21 4月, 2015 1 次提交
    • A
      Rename association option :class to :anonymous_class · ac2b7a5c
      Andrew White 提交于
      In 1f006c an option was added called :class to allow passing anonymous
      classes to association definitions. Since using :class instead of
      :class_name is a fairly common typo even amongst experienced developers
      this can result in hard to debug errors arising in raise_on_type_mismatch?
      
      To fix this we're renaming the option from :class to :anonymous_class as
      that is a more correct description of what the option is for. Since this
      was an internal, undocumented option there is no need for a deprecation.
      
      Fixes #19659
      ac2b7a5c
  17. 20 4月, 2015 2 次提交
  18. 18 4月, 2015 1 次提交
    • S
      Autosave existing records on HMT associations when the parent is new · d849f42b
      Sean Griffin 提交于
      To me it seems like this should only be the case if `autosave: true` is
      set on the association. However, when implemented that way, it caused
      issues with has many associations, where we have explicit tests stating
      that child records are updated when the parent is new, even if autosave
      is not set (presumably to update the parent id, but other changed
      attributes would be persisted as well).
      
      It's quirky, but at least we should be consistently quirky. This
      constitutes a minor but subtle change in behavior, and therefore should
      not be backported to 4.2 and earlier.
      
      Fixes #19782
      d849f42b
  19. 17 4月, 2015 1 次提交
    • R
      Encourage users to user super to override methods. · 8f7d9eb0
      Richard Wilson 提交于
      IMO we shouldn't encourage users to use methods they shouldn't need to know about. As Song (in this example) inherits from ActiveRecord, we can use super here instead to get the same effect with the bonus of not knowing how active record actually implements these methods.
      8f7d9eb0
  20. 15 4月, 2015 2 次提交
    • P
      Fix missing index when using timestamps with index · c0abeadc
      Paul Mucur 提交于
      The `index` option used with `timestamps` should be passed to both
      `column` definitions for `created_at` and `updated_at` rather than just
      the first.
      
      This was happening because `Hash#delete` is used to extract the `index`
      option passed to `timestamps`, thereby mutating the `options` hash
      in-place. Now take a copy of the `options` before deleting so that the
      original is not modified.
      c0abeadc
    • Y
      Revert "Merge pull request #19755 from yuki24/activerecord/support-for-set" · 5f00ed10
      Yves Senn 提交于
      This reverts commit 524d4059, reversing
      changes made to 34d3a609.
      
      Reasoning behind the revert are in the PR discussion:
      https://github.com/rails/rails/pull/19755
      
      - This means that types can no longer cast to/from `Set`, and reasonably
        work with `where` (we already have this problem for `array`/`json`
        types on pg)
      - This adds precedent for every other `Enumerable`, and we can't target
        `Enumerable` directly.
      - Calling `to_a` on a `Set` is reasonable.
      5f00ed10
  21. 14 4月, 2015 1 次提交
    • Y
      Add support for Set to Relation#where · 50cae600
      Yuki Nishijima 提交于
      Previously `#where` used to treat `Set`objects as nil, but now it treats
      them as an array:
      
        set = Set.new([1, 2])
        Author.where(:id => set)
        # => SELECT "authors".* FROM "authors" WHERE "authors"."id" IN (1, 2)
      50cae600