aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #17580 from ccutrer/change_table_nameYves Senn2014-11-111-0/+4
|\ | | | | | | add a Table#name accessor like TableDefinition#name
| * add a Table#name accessor like TableDefinition#nameCody Cutrer2014-11-101-0/+4
|/
* Merge pull request #11694 from ↵Rafael Mendonça França2014-11-101-0/+6
|\ | | | | | | | | | | | | | | | | Empact/association-bind-values-not-updated-on-save Fix that a collection proxy could be cached before the save of the owner, resulting in an invalid proxy lacking the owner’s id Conflicts: activerecord/CHANGELOG.md
| * Fix that a collection proxy could be cached before the save of the owner, ↵Ben Woosley2014-10-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | resulting in an invalid proxy lacking the owner’s id. Absent this fix calls like: owner.association.update_all to behave unexpectedly because they try to act on association objects where owner_id is null. more evidence here: https://gist.github.com/Empact/5865555 ``` Active Record 3.2.13 -- create_table(:firms, {:force=>true}) -> 0.1371s -- create_table(:clients, {:force=>true}) -> 0.0005s 1 clients. 1 expected. 1 clients updated. 1 expected. ``` ``` Active Record 4.0.0 -- create_table(:firms, {:force=>true}) -> 0.1606s -- create_table(:clients, {:force=>true}) -> 0.0004s 1 clients. 1 expected. 0 clients updated. 1 expected. ```
* | Merge pull request #17541 from OpenSourceProjects/meaninful_messageYves Senn2014-11-071-0/+4
| | | | | | | | Print out a meaningful error when ActiveRecord::ReadOnlyRecord is raised
* | Merge pull request #17360 from bronzle/includes_and_unscopedYves Senn2014-11-051-0/+6
|\ \ | | | | | | | | | copy reflection_scopes’s unscoped value when building scope for preloading
* | | Added SchemaDumper support for tables with jsonb columns.Ted O'Meara2014-11-041-0/+4
| | |
* | | Revert deprecation of `sanitize_sql_hash_for_assignment`Sean Griffin2014-11-021-3/+2
| | | | | | | | | | | | This method is still used by `update_all`
* | | Deprecate `sanitize_sql_hash_` methods on ActiveRecordSean Griffin2014-11-021-0/+6
| | | | | | | | | | | | | | | These appear to be implementation relics of times past. They duplicate the logic in Relation, and are no longer used internally.
* | | Use bind values for joined tables in where statementsSean Griffin2014-11-011-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In practical terms, this allows serialized columns and tz aware columns to be used in wheres that go through joins, where they previously would not behave correctly. Internally, this removes 1/3 of the cases where we rely on Arel to perform type casting for us. There were two non-obvious changes required for this. `update_all` on relation was merging its bind values with arel's in the wrong order. Additionally, through associations were assuming there would be no bind parameters in the preloader (presumably because the where would always be part of a join) [Melanie Gilman & Sean Griffin]
* | | fix MySQL enum type lookup with values matching another type. Closes #17402.Yves Senn2014-10-291-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MySQLAdapter type map used the lowest priority for enum types. This was the result of a recent refactoring and lead to some broken lookups for enums with values that match other types. Like `8bit`. This patch restores the priority to what we had before the refactoring. /cc @sgrif
* | | Merge pull request #17374 from maurogeorge/scope-exceptionYves Senn2014-10-271-0/+4
|\| | | | | | | | | | | Raises ArgumentError when try to define a scope without a callable
* | | Merge pull request #14143 from derekprior/dp-compound-index-orderingYves Senn2014-10-271-0/+4
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Use type column first in multi-column indexes Conflicts: activerecord/CHANGELOG.md
| * | | Use type column first in multi-column indexesDerek Prior2014-10-241-0/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `add_reference` can very helpfully add a multi-column index when you use it to add a polymorphic reference. However, the first column in the index is the `id` column, which is less than ideal. The [PostgreSQL docs][1] say: > A multicolumn B-tree index can be used with query conditions that > involve any subset of the index's columns, but the index is most > efficient when there are constraints on the leading (leftmost) > columns. The [MySQL docs][2] say: > MySQL can use multiple-column indexes for queries that test all the > columns in the index, or queries that test just the first column, the > first two columns, the first three columns, and so on. If you specify > the columns in the right order in the index definition, a single > composite index can speed up several kinds of queries on the same > table. In a polymorphic relationship, the type column is much more likely to be useful as the first column in an index than the id column. That is, I'm more likely to query on type without an id than I am to query on id without a type. [1]: http://www.postgresql.org/docs/9.3/static/indexes-multicolumn.html [2]: http://dev.mysql.com/doc/refman/5.0/en/multiple-column-indexes.html
* / / Fix Relation.rewhere to work with Range valuesDan Olson2014-10-201-0/+4
|/ /
* | Merge pull request #17019 from yuki24/add-class-name-to-unknown-attr-errorYves Senn2014-10-201-4/+1
|\ \ | | | | | | | | | Message on AR::UnknownAttributeError should include the class name of a record
| * | AR::UnknownAttributeError should include the class name of a recordYuki Nishijima2014-10-151-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This would be helpful if 2 models have an attribute that has a similar name to the other. e.g: before: User.new(name: "Yuki Nishijima", projects_attributes: [name: "kaminari"]) # => ActiveRecord::UnknownAttributeError: unknown attribute: name after: User.new(name: "Yuki Nishijima", projects_attributes: [name: "kaminari"]) # => ActiveRecord::UnknownAttributeError: unknown attribute on User: name
* | | AR::UnknownAttributeError should include the class name of a recordYuki Nishijima2014-10-201-0/+10
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | This would be helpful if 2 models have an attribute that has a similar name to the other. e.g: before: User.new(name: "Yuki Nishijima", projects_attributes: [name: "kaminari"]) # => ActiveRecord::UnknownAttributeError: unknown attribute: name after: User.new(name: "Yuki Nishijima", projects_attributes: [name: "kaminari"]) # => ActiveRecord::UnknownAttributeError: unknown attribute on User: name
* | Autosave callbacks shouldn't be `after_save`Agis-2014-10-131-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | 068f092ced8483e557725542dd919ab7c516e567 registered autosave callbacks as `after_save` callbacks. This caused the regression described in #17209. Autosave callbacks should be registered as `after_update` and `after_create` callbacks, just like before. This is a partial revert of 068f092ced8483e557725542dd919ab7c516e567. Fixes #17209.
* | unify PG spelling in CHANGELOGs. [ci skip]Yves Senn2014-10-061-1/+1
|/
* Fix typo in AR changelogPrathamesh Sonpatki2014-09-271-1/+1
| | | | - middlware -> middleware
* ar/connection_pool: honor overriden rack.test in middlewareSimon Eskildsen2014-09-231-0/+5
| | | | | | | Honoring an overidden `rack.test` allows testing closed connection between multiple requests. This is useful if you're working on database resiliency, to ensure the connection is in the expected state from one request to another on the same worker.
* Update changelog with tenderlove's entryPrathamesh Sonpatki2014-09-231-1/+5
| | | | [ci skip]
* add a truncate method to the connectionAaron Patterson2014-09-221-0/+2
| | | | | | it doesn't work on SQLite3 since it doesn't support truncate, but that's OK. If you call truncate on the connection, you're now bound to that database (same as if you use hstore or any other db specific feature).
* Merge pull request #16987 from jonatack/patch-8Yves Senn2014-09-201-13/+15
|\ | | | | | | ActiveRecord CHANGELOG improvements [skip ci]
| * ActiveRecord CHANGELOG improvements [skip ci]Jon Atack2014-09-201-13/+15
|/
* [ci skip] ActionRecord CHANGELOG docs fixeslethalbrains2014-09-191-18/+18
|
* Merge pull request #16875 from alan/dont_autosave_has_one_through_recordRafael Mendonça França2014-09-171-0/+4
|\ | | | | | | | | | | | | Don't autosave unchanged has_one through records Conflicts: activerecord/CHANGELOG.md
| * Don't autosave unchanged has_one through recordsAlan Kennedy2014-09-151-0/+4
| |
* | do not dump foreign keys for ignored tables.Yves Senn2014-09-171-0/+2
| |
* | unify wording in Active Record CHANGELOG. [ci skip]Yves Senn2014-09-171-1/+1
| |
* | pg, correctly dump foreign keys targeting tables in a different schema.Yves Senn2014-09-171-0/+7
|/ | | | | | Closes #16907. [Matthew Draper & Yves Senn]
* Merge pull request #13656 from chanks/rollback_transactions_in_killed_threadsMatthew Draper2014-09-141-0/+8
|\ | | | | | | Data corruption risk: Roll back open transactions when the running thread is killed.
* | A `NullRelation` should represent nothing. Closes #15176.Yves Senn2014-09-111-0/+7
| | | | | | | | | | | | [Matthew Draper & Yves Senn] Closes #16860. (pull request to discuss the implementation)
* | Include default column limits in schema.rbJeremy Kemper2014-09-101-0/+5
| | | | | | | | | | | | Allows :limit defaults to be changed without pulling the rug out from under old migrations that omitted :limit because it matched the default at the time.
* | MySQL: schema.rb now includes TEXT and BLOB column limits.Jeremy Kemper2014-09-101-0/+4
| |
* | MySQL: correct LONGTEXT and LONGBLOB limits from 2GB to their true 4GBJeremy Kemper2014-09-101-0/+4
| |
* | Merge pull request #14056 from girishso/14041Yves Senn2014-09-091-0/+4
|\ \ | | | | | | | | | | | | | | | | | | SQLite3Adapter now checks for views in table_exists? fixes: 14041 Conflicts: activerecord/CHANGELOG.md
| * | SQLite3Adapter now checks for views in table_exists? fixes: 14041Girish S2014-02-141-0/+6
| | |
* | | introduce `connection.supports_views?` and basic view tests.Yves Senn2014-09-091-0/+5
| | | | | | | | | | | | | | | | | | | | | `AbstractAdapter#supports_views?` defaults to `false` so we have to turn it on in adapter subclasses. Currently the flag only controls test execution. /cc @yahonda
* | | Allow included modules to override association methods.Yves Senn2014-09-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #16684. This is achieved by always generating `GeneratedAssociationMethods` when `ActiveRecord::Base` is subclassed. When some of the included modules of `ActiveRecord::Base` were reordered this behavior was broken as `Core#initialize_generated_modules` was no longer called. Meaning that the module was generated on first access.
* | | Remove CHANGELOG entry [ci skip]Rafael Mendonça França2014-09-051-8/+0
| | |
* | | cover all cases of `For not` --> `Do not`, related to #16804Akshay Vishnoi2014-09-051-1/+1
| | |
* | | schema loading rake tasks maintain database connection for current env.Yves Senn2014-09-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Joshua Cody & Yves Senn] Closes #16757. Prior to this patch schema loading rake tasks had the potential to leak a connection to a different database. This had side-effects when rake tasks operating on the current connection (like `db:seed`) were chained.
* | | MySQL: set connection collation along with the charsetJeremy Kemper2014-08-301-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sets the connection collation to the database collation configured in database.yml. Otherwise, `SET NAMES utf8mb4` will use the default collation for that charset (utf8mb4_general_ci) when you may have chosen a different collation, like utf8mb4_unicode_ci. This only applies to literal string comparisons, not column values, so it is unlikely to affect you.
* | | minor changelog formatting changes.Yves Senn2014-08-271-2/+3
| | |
* | | pg, `default_sequence_name` needs to return a string.Yves Senn2014-08-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a reacon to https://github.com/rails/rails/commit/d6c1205584b1ba597db4071b168681678b1e9875#commitcomment-7502487 This backwards incompatibility was introduced with d6c12055 to fix #7516. However both `connection.default_sequence_name` and `model.sequence_name` are public API. The PostgreSQL adapter should honor the interface and return strings. /cc @matthewd @chancancode
* | | CHANGELOG & improvements to #16649Godfrey Chan2014-08-231-0/+7
| |/ |/| | | | | | | * Require either FIRST or LAST qualifier for "NULLS ..." * Require whitespace before "NULLS ..."
* | Only merge scopes with zero arity in has_many throughAgis-2014-08-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with dynamic conditions. Fixes #16128 This bug was introduced in https://github.com/rails/rails/commit/c35e438620f2d56562251571377995359546393d so it's present from 4.1.2-rc1 and after. https://github.com/rails/rails/commit/c35e438620f2d56562251571377995359546393d merges any relation scopes passed as proc objects to the relation, but does *not* take into account the arity of the lambda. To reproduce: https://gist.github.com/Agis-/5f1f0d664d2cd08dfb9b
* | [ci skip] config.active_record.errors_in_transactional_callbacks -> ↵yuuji.yaginuma2014-08-191-1/+1
| | | | | | | | config.active_record.raise_in_transactional_callbacks