CHANGELOG.md 5.6 KB
Newer Older
1 2 3 4 5 6 7
*   `Relation#joins` is no longer affected by the target model's
    `current_scope`, with the exception of `unscoped`.

    Fixes #29338.

    *Sean Griffin*

8 9 10 11 12 13 14 15 16 17 18
*   Change sqlite3 boolean serialization to use 1 and 0

    SQLite natively recognizes 1 and 0 as true and false, but does not natively
    recognize 't' and 'f' as was previously serialized.

    This change in serialization requires a migration of stored boolean data
    for SQLite databases, so it's implemented behind a configuration flag
    whose default false value is deprecated.

    *Lisa Ugray*

19 20 21 22 23 24 25 26
*   Skip query caching when working with batches of records (`find_each`, `find_in_batches`,
    `in_batches`).

    Previously, records would be fetched in batches, but all records would be retained in memory
    until the end of the request or job.

    *Eugene Kenny*

R
Ryuta Kamizono 已提交
27 28
*   Prevent errors raised by `sql.active_record` notification subscribers from being converted into
    `ActiveRecord::StatementInvalid` exceptions.
29 30 31

    *Dennis Taylor*

32 33 34 35 36 37
*   Fix eager loading/preloading association with scope including joins.

    Fixes #28324.

    *Ryuta Kamizono*

38 39 40 41 42 43 44 45 46 47
*   Fix transactions to apply state to child transactions

    Previously if you had a nested transaction and the outer transaction was rolledback the record from the
    inner transaction would still be marked as persisted.

    This change fixes that by applying the state of the parent transaction to the child transaction when the
    parent transaction is rolledback. This will correctly mark records from the inner transaction as not persisted.

    *Eileen M. Uchitelle*, *Aaron Patterson*

48 49 50 51 52 53 54 55
*   Deprecate `set_state` method in `TransactionState`

    Deprecated the `set_state` method in favor of setting the state via specific methods. If you need to mark the
    state of the transaction you can now use `rollback!`, `commit!` or `nullify!` instead of
    `set_state(:rolledback)`, `set_state(:committed)`, or `set_state(nil)`.

    *Eileen M. Uchitelle*, *Aaron Patterson*

56 57 58 59
*   Deprecate delegating to `arel` in `Relation`.

    *Ryuta Kamizono*

60 61 62 63
*   Fix eager loading to respect `store_full_sti_class` setting.

    *Ryuta Kamizono*

R
Ryuta Kamizono 已提交
64
*   Query cache was unavailable when entering the `ActiveRecord::Base.cache` block
65 66 67 68
    without being connected.

    *Tsukasa Oishi*

69 70 71 72 73 74 75
*   Previously, when building records using a `has_many :through` association,
    if the child records were deleted before the parent was saved, they would
    still be persisted. Now, if child records are deleted before the parent is saved
    on a `has_many :through` association, the child records will not be persisted.

    *Tobias Kraze*

76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
*   Merging two relations representing nested joins no longer transforms the joins of
    the merged relation into LEFT OUTER JOIN. Example to clarify:

    ```
    Author.joins(:posts).merge(Post.joins(:comments))
    # Before the change:
    #=> SELECT ... FROM authors INNER JOIN posts ON ... LEFT OUTER JOIN comments ON...

    # After the change:
    #=> SELECT ... FROM authors INNER JOIN posts ON ... INNER JOIN comments ON...
    ```

    TODO: Add to the Rails 5.2 upgrade guide

    *Maxime Handfield Lapointe*

92 93 94 95 96
*   `ActiveRecord::Persistence#touch` does not work well when optimistic locking enabled and
    `locking_column`, without default value, is null in the database.

    *bogdanvlviv*

97
*   Fix destroying existing object does not work well when optimistic locking enabled and
R
Ryuta Kamizono 已提交
98
    `locking_column` is null in the database.
99 100 101

    *bogdanvlviv*

K
Kir Shatrov 已提交
102 103 104 105
*   Use bulk INSERT to insert fixtures for better performance.

    *Kir Shatrov*

106 107 108 109
*   Prevent making bind param if casted value is nil.

    *Ryuta Kamizono*

110 111 112 113
*   Deprecate passing arguments and block at the same time to `count` and `sum` in `ActiveRecord::Calculations`.

    *Ryuta Kamizono*

114 115 116 117 118 119
*   Loading model schema from database is now thread-safe.

    Fixes #28589.

    *Vikrant Chaudhary*, *David Abdemoulaie*

R
Ryuta Kamizono 已提交
120 121
*   Add `ActiveRecord::Base#cache_version` to support recyclable cache keys via the new versioned entries
    in `ActiveSupport::Cache`. This also means that `ActiveRecord::Base#cache_key` will now return a stable key
122
    that does not include a timestamp any more.
R
Ryuta Kamizono 已提交
123 124 125 126

    NOTE: This feature is turned off by default, and `#cache_key` will still return cache keys with timestamps
    until you set `ActiveRecord::Base.cache_versioning = true`. That's the setting for all new apps on Rails 5.2+

127 128
    *DHH*

R
Ryuta Kamizono 已提交
129
*   Respect `SchemaDumper.ignore_tables` in rake tasks for databases structure dump
G
Guillermo Iguaran 已提交
130 131 132

    *Rusty Geldmacher*, *Guillermo Iguaran*

133 134 135 136 137 138
*   Add type caster to `RuntimeReflection#alias_name`

    Fixes #28959.

    *Jon Moss*

139 140 141 142
*   Deprecate `supports_statement_cache?`.

    *Ryuta Kamizono*

R
Ryuta Kamizono 已提交
143
*   Quote database name in `db:create` grant statement (when database user does not have access to create the database).
144 145 146

    *Rune Philosof*

147 148 149 150 151
*   Raise error `UnknownMigrationVersionError` on the movement of migrations
    when the current migration does not exist.

    *bogdanvlviv*

152 153 154 155
*   Fix `bin/rails db:forward` first migration.

    *bogdanvlviv*

156 157 158 159 160 161 162
*   Support Descending Indexes for MySQL.

    MySQL 8.0.1 and higher supports descending indexes: `DESC` in an index definition is no longer ignored.
    See https://dev.mysql.com/doc/refman/8.0/en/descending-indexes.html.

    *Ryuta Kamizono*

163 164 165 166
*   Fix inconsistency with changed attributes when overriding AR attribute reader.

    *bogdanvlviv*

167 168 169 170 171 172
*   When calling the dynamic fixture accessor method with no arguments it now returns all fixtures of this type.
    Previously this method always returned an empty array.

    *Kevin McPhillips*


M
Matthew Draper 已提交
173
Please check [5-1-stable](https://github.com/rails/rails/blob/5-1-stable/activerecord/CHANGELOG.md) for previous changes.