aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
* Add database configuration to disable advisory locks.Guo Xiang Tan2018-08-221-0/+10
| | | | https://github.com/rails/rails/issues/31190
* Merge pull request #33585 from yahonda/diag33520Ryuta Kamizono2018-08-161-0/+4
|\ | | | | | | SQLite3 adapter `alter_table` method restores foreign keys
| * SQLite3 adapter `alter_table` method restores foreign keysYasuo Honda2018-08-111-0/+4
| | | | | | | | Related to #33520
* | Follow up #33530bogdanvlviv2018-08-151-4/+8
| | | | | | | | | | | | | | | | | | - Move changelog entry of #33530 up in order to preserve the chronology since we always add new entries on the top of a changelog file. - Clarify the changelog entry - Clarify the docs of remove_foreign_key - Ensure reversible of `remove_foreign_key` with `:primary_key` and `:to_table` options.
* | Allow `to_table` in `invert_remove_foreign_key`Rich2018-08-141-0/+4
|/ | | | | | | | | | | | remove_foreign_key supports - remove_foreign_key :accounts, :branches - remove_foreign_key :accounts, to_table: :branches but the second one is not reversible. This branch is to fix and allow second one to be reversible. [Nikolay Epifanov, Rich Chen]
* Revert "Merge pull request #24131 from brchristian/limit_and_primary_key"Ryuta Kamizono2018-08-011-6/+0
| | | | | | | | | | This reverts commit d162188dd662a7d9f62ba8431474f50bc35e3e93, reversing changes made to 3576782888c307e3e192c44e332b957cd1174128. Reason: #24131 conflicts the #5153's default order contract, it means that existing apps would be broken by that change. We don't want to break existing apps without a deprecation cycle.
* CHANGELOG entryBrian Christian2018-07-191-0/+6
|
* Add missing load config dependency to `rake db:seed`Tobias Bielohlawek2018-07-101-0/+5
|
* Merge pull request #33280 from nkondratyev/fix/mysql-time-default-valuesRyuta Kamizono2018-07-091-0/+4
|\ | | | | | | Fix default value for mysql time types with specified precision
| * Fix default value for mysql time types with specified precisionNikolay Kondratyev2018-07-041-0/+4
|/ | | | | | | | | | | | | | | | The TIME, DATETIME, and TIMESTAMP types [have supported](https://mariadb.com/kb/en/library/microseconds-in-mariadb/) a fractional seconds precision from 0 to 6. Default values from time columns with specified precision is read as `current_timestamp(n)` from information schema. rake `db:schema:dump` produces `schema.rb` **without** default values for time columns with the specified precision: t.datetime "last_message_at", precision: 6, null: false rake `db:schema:dump` produces `schema.rb` **with** default values for time columns with the specified precision: t.datetime "last_message_at", precision: 6, default: -> { "current_timestamp(6)" }, null: false
* Fix `touch` option to behave consistently with `Persistence#touch` methodRyuta Kamizono2018-06-181-0/+4
| | | | | | | | | | | | | | | | `touch` option was added to `increment!` (#27660) and `update_counters` (#26995). But that option behaves inconsistently with `Persistence#touch` method. If `touch` option is passed attribute names, it won't update update_at/on attributes unlike `Persistence#touch` method. Due to changed from `Persistence#touch` to `increment!` with `touch` option, #31405 has a regression that `counter_cache` with `touch` option which is passed attribute names won't update update_at/on attributes. I think that the inconsistency is not intended. To get back consistency, ensure that `touch` option updates update_at/on attributes.
* Merge pull request #29373 from untidy-hair/store_accessor_enhanceRyuta Kamizono2018-06-131-2/+2
|\ | | | | | | Allow prefix/suffix options for store accessors
* | :scissors:Ryuta Kamizono2018-06-101-1/+1
| | | | | | | | [ci skip]
* | Migrations will raise an exception if there are multiple column definitions ↵Federico Martinez2018-06-011-0/+6
| | | | | | | | (same name).
* | [skip ci] Add changelog about bumping minimum SQLite version to 3.8Yasuo Honda2018-06-011-0/+4
| | | | | | | | Related to #32923
* | Merge pull request #32952 from mechanicles/32940-fixRyuta Kamizono2018-05-291-0/+6
|\ \ | |/ |/| | | Fix parent record should not get saved with duplicate children records
| * Fix parent record should not get saved with duplicate children recordsSantosh Wadghule2018-05-281-0/+6
|/ | | | - Fixes #32940
* Fix logic on disabling commit callbacksBrian Durand2018-05-041-0/+4
| | | | Commit callbacks are intentionally disabled when errors occur when calling the callback chain in order to reset the internal record state. However, the implicit order of operations on the logic for checking if callbacks are disabled is wrong. The result is that callbacks can be unexpectedly when errors occur in transactions.
* Loaded associations should not run a new query when size is calledGraham Turner2018-04-261-0/+5
| | | | | | | Already loaded associations were running an extra query when `size` was called on the association. This fix ensures that an extra query is no longer run. Update tests to use proper methods
* Can preload associations through polymorphic associationsDana Sherson2018-04-201-0/+4
|
* Add `touch_all` method to `ActiveRecord::Relation`fatkodima2018-04-131-0/+8
|
* [ci skip] Fully quantify Active Record module in changelog.Kasper Timm Hansen2018-04-021-1/+1
|
* Add AR::Base.base_class? predicateBogdan Gusiev2018-04-021-0/+4
|
* Add custom prefix to ActiveRecord::Store accessorsTan Huynh2018-03-231-0/+4
| | | | | | Add a prefix option to ActiveRecord::Store.store_accessor and ActiveRecord::Store.store. This option allows stores to have identical keys with different accessors.
* Remove changelog header for unreleased versionRafael Mendonça França2018-03-131-2/+0
| | | | | | We only add the header when releasing to avoid some conflicts. [ci skip]
* Remove CHANGELOG entries which were backported to 5-2-stableRyuta Kamizono2018-02-281-14/+0
|
* Fix a typo in activerecord/CHANGELOG.mdokkez2018-02-281-1/+1
| | | | columsn -> columns
* Merge pull request #31966 from kg8m/fix_limited_ids_forRyuta Kamizono2018-02-281-0/+8
|\ | | | | | | Use column alias of primary_key in limited_ids_for
| * Fix `#columsn_for_distinct` of MySQL and PostgreSQLkg8m2018-02-271-0/+8
|/ | | | | | | Prevent `ActiveRecord::FinderMethods#limited_ids_for` from using correct primary key values even if `ORDER BY` columns include other table's primary key. Fixes #28364.
* Make `reflection.klass` raise if `polymorphic?` not to be misusedRyuta Kamizono2018-02-191-0/+6
| | | | | | | | | | | | | | | | This is an alternative of #31877 to fix #31876 caused by #28808. This issue was caused by a combination of several loose implementation. * finding automatic inverse association of polymorphic without context (caused by #28808) * returning `klass` even if `polymorphic?` (exists before #28808) * loose verification by `valid_inverse_reflection?` (exists before #28808) This makes `klass` raise if `polymorphic?` not to be misused. This issue will not happen unless polymorphic `klass` is misused. Fixes #31876. Closes #31877.
* Add a CHANGELOG entry for #31941 [ci skip]Ryuta Kamizono2018-02-191-0/+4
|
* Rails 6 requires Ruby 2.4.1+Jeremy Daer2018-02-171-0/+5
| | | | | | Skipping over 2.4.0 to sidestep the `"symbol_from_string".to_sym.dup` bug. References #32028
* Deprecate update_attributes and update_attributes!Eddie Lebow2018-02-171-0/+3
| | | | Closes #31998
* Add #create_or_find_by to lean on unique constraints (#31989)David Heinemeier Hansson2018-02-141-0/+6
| | | Add #create_or_find_by to lean on unique constraints
* Start Rails 6.0 development!!!Rafael Mendonça França2018-01-301-667/+1
| | | | :tada::tada::tada:
* Deprecate `expand_hash_conditions_for_aggregates`Ryuta Kamizono2018-01-291-0/+5
| | | | | This can not expand an array of aggregated objects correctly, and is no longer used internally since 159b21b5.
* Merge pull request #31724 from orekyuu/fix-expand-composed-object-arrayRyuta Kamizono2018-01-291-0/+14
|\ | | | | | | Fix not expanded problem when passing an Array object as argument to the where method using composed_of column.
| * Fix not expanded problem when passing an Array object as argument to the ↵orekyuu2018-01-261-0/+14
|/ | | | | | | | | | | | | | where method using composed_of column. Fixes #31723 ``` david_balance = customers(:david).balance Customer.where(balance: [david_balance]).to_sql # Before: WHERE `customers`.`balance` = NULL # After : WHERE `customers`.`balance` = 50 ```
* Fix `count(:all)` with eager loading and having an order other than the ↵Ryuta Kamizono2018-01-251-0/+6
| | | | | | | | | | | | | | | | | | | driving table This is a regression caused by 6beb4de. In PostgreSQL, ORDER BY expressions must appear in SELECT list when using DISTINCT. When using `count(:all)` with eager loading, Active Record enforces DISTINCT to count the driving table records only. 6beb4de was caused the regression because `count(:all)` with DISTINCT path no longer removes ORDER BY. We need to ignore ORDER BY when DISTINCT is enforced, otherwise not always generated valid SQL for PostgreSQL. Fixes #31783.
* Expand AR to Active Record [ci skip]Ryuta Kamizono2018-01-251-2/+2
|
* Clear the transaction state when AR object is dupedYuriy Ustushenko2018-01-251-0/+6
|
* Support for PostgreSQL foreign tablesfatkodima2018-01-221-0/+4
|
* Fix relation merger issue with `left_outer_joins`Mehmet Emin INAC2018-01-151-0/+4
|
* Don't allow destroyed object mutation after `save` or `save!` is calledRyuta Kamizono2018-01-151-0/+4
| | | | | | | | | | Currently `object.save` will unfreeze the object, due to `changes_applied` replaces frozen `@attributes` to new `@attributes`. Since originally destroyed objects are not allowed to be mutated, `save` and `save!` should not return success in that case. Fixes #28563.
* Merge pull request #23146 from piotrj/issue_18424Ryuta Kamizono2018-01-111-0/+6
|\ | | | | | | When deleting through records, take into account association conditions
* \ Merge pull request #16314 from ↵Ryuta Kamizono2018-01-101-0/+38
|\ \ | | | | | | | | | | | | | | | zoltankiss/allow-nested-has-many-associations-on-unpersisted-parent-instances fix nested `has many :through` associations on unpersisted parent instances
* | | resolve inconsistencies between first and to_a.first with limitBrian Christian2018-01-091-0/+8
| | |
* | | Merge pull request #27561 from fishbrain/count-all-in-has-many-associationRyuta Kamizono2018-01-031-0/+5
|\ \ \ | | | | | | | | | | | | Use `count(:all)` in HasManyAssociation#count_records
| * | | Use `count(:all)` in HasManyAssociation#count_recordsKlas Eskilson2017-02-071-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Calling `count` on an association can cause invalid SQL queries to be created where the `SELECT COUNT(a, b, c)` function receives multiple columns. This will cause a `StatementInvalid` exception later on. Solution: Use `count(:all)`, which generates a `SELECT COUNT(*)...` query independently of the association. This also includes a test case that, before the fix, broke.
* | | | Merge pull request #27780 from ↵Ryuta Kamizono2017-12-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | mikelikesbikes/fix-update-attribute-callbacks-issue save attributes changed by callbacks after update_attribute