aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
* Prep Rails 5 beta 4eileencodes2016-04-271-0/+2
|
* Add Expression Indexes and Operator Classes support for PostgreSQLRyuta Kamizono2016-04-241-0/+13
| | | | | | | | | | | | | | | | Example: create_table :users do |t| t.string :name t.index 'lower(name) varchar_pattern_ops' end Fixes #19090. Fixes #21765. Fixes #21819. Fixes #24359. Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
* Merge pull request #23461 from kamipo/prepared_statements_for_mysql2_adapterJeremy Daer2016-04-231-0/+7
|\ | | | | | | Add prepared statements support for `Mysql2Adapter`
| * Add prepared statements support for `Mysql2Adapter`Ryuta Kamizono2016-04-211-0/+4
|/
* Merge pull request #23557 from ↵Jeremy Daer2016-04-201-0/+10
|\ | | | | | | | | | | kamipo/dump_indexes_in_create_for_generates_sql_in_one_query Dump indexes in `create_table` for generates SQL in one query
| * Dump indexes in `create_table` for generates SQL in one queryRyuta Kamizono2016-04-201-0/+7
|/ | | | | If the adapter supports indexes in create table, it generates SQL in one query.
* Merge pull request #23523 from kamipo/avoid_truncation_in_uniqueness_validationJeremy Daer2016-04-181-0/+17
|\ | | | | | | Avoid a string value truncation in uniqueness validation
* \ Merge pull request #23522 from kamipo/add_value_too_long_exception_classJeremy Daer2016-04-181-0/+5
|\ \ | | | | | | | | | Add `ActiveRecord::ValueTooLong` exception class
* | | Merge pull request #24614 from ↵Jeremy Daer2016-04-181-0/+4
| | | | | | | | | | | | | | | | | | kamipo/foreign_key_respects_table_name_prefix_and_suffix `foreign_key` respects `table_name_prefix` and `table_name_suffix`
* | | Merge pull request #23622 from kamipo/primary_key_should_be_not_nullJeremy Daer2016-04-181-0/+17
|\ \ \ | | | | | | | | | | | | Primary key should be `NOT NULL`
* | | | Move CHANGELOG entry about database notices at the top [ci skip]Prathamesh Sonpatki2016-04-181-23/+20
| | | |
* | | | Merge pull request #24551 from bogdanvlviv/notice_for_tasksJeremy Daer2016-04-171-0/+22
|\ \ \ \ | | | | | | | | | | Added notice when a database is successfully created or dropped.
| * | | | Added notice when a database is successfully created or dropped.bogdanvlviv2016-04-171-0/+22
| | | | |
* | | | | Merge pull request #22911 from Envek/database_commentsJeremy Daer2016-04-161-0/+11
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | Add support for specifying comments for tables, columns, and indexes in database itself
| * | | | | Add support for specifying comments for tables, columns, and indexes.Andrey Novikov2016-04-161-0/+17
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Comments are specified in migrations, stored in database itself (in its schema), and dumped into db/schema.rb file. This allows to generate good documentation and explain columns and tables' purpose to everyone from new developers to database administrators. For PostgreSQL and MySQL only. SQLite does not support comments at the moment. See docs for PostgreSQL: http://www.postgresql.org/docs/current/static/sql-comment.html See docs for MySQL: http://dev.mysql.com/doc/refman/5.7/en/create-table.html
* / / / / Add changelog for #24542Vipul A M2016-04-151-0/+6
|/ / / / | | | | | | | | | | | | [ci skip]
* | | | Properly serialize all JSON primitives in the AR JSON typeSean Griffin2016-04-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we were assuming that the only valid types for encoding were arrays and hashes. However, any JSON primitive is an accepted value by both PG and MySQL. This does involve a minor breaking change in the handling of `default` in the schema dumper. This is easily worked around, as passing a hash/array literal would have worked fine in previous versions of Rails. However, because of this, I will not be backporting this to 4.2 or earlier. Fixes #24234
* | | | Support microsecond datetime precision on MariaDB 5.3+.Jeremy Daer2016-04-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We support microsecond datetime precision for MySQL 5.6.4+. MariaDB has supported it since 5.3.0, but even 10.x versions return a compatible version string like `5.5.5-10.1.8-MariaDB-log` which we parse as 5.5.5, before MySQL supported microsecond precision. Specialize our version check to account for MariaDB to fix.
* | | | remove needless entry [ci skip]yuuji.yaginuma2016-04-081-5/+0
| | | | | | | | | | | | | | | | The option backed to `start` in da26934313a31ae530b7537aba8a7662152f4dfe.
* | | | Pass over CHANGELOGs [ci skip]Prathamesh Sonpatki2016-03-301-2/+2
| | | |
* | | | Merge pull request #24349 from chrisarcand/add-changelog-for-24305Rafael França2016-03-291-0/+6
|\ \ \ \ | | | | | | | | | | Add changelog for #24305
| * | | | Add changelog for #24305 [skip ci]Chris Arcand2016-03-281-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Forgot to add, sigh. Closes #24273
* | | | | Delegate some additional methods in querying.rbKenta2016-03-301-0/+13
|/ / / /
* | | | add `:index_errors` option to example [ci skip]yuuji.yaginuma2016-03-271-2/+2
| | | |
* | | | Memoize user provided defaults before type castingSean Griffin2016-03-241-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a proc is given as a default value, the form builder ends up displaying `Proc#to_s` when the default is used. That's because we didn't handle the proc until type casting. This issue technically can occur any time that a proc is the value before type casting, but in reality the only place that will occur is when a proc default is provided through the attributes API, so the best place to handle this edge case is there. I've opted to memoize instead of just moving the `Proc#call` up, as this made me realize that it could potentially interact very poorly with dirty checking. The code here is a little redundant, but I don't want to rely on how `value_before_type_cast` is implemented in the super class, even if it's just an `attr_reader`. Fixes #24249 Close #24306
* | | | Merge pull request #24167 from ↵Jeremy Daer2016-03-231-0/+7
|\| | | | | | | | | | | | | | | | | | | | | | | kamipo/append_sql_mode_instead_of_overwriting_in_strict_mode Append sql_mode instead of overwriting in strict mode
* | | | guides, sync 5.0 release notes with changelogsYves Senn2016-03-221-1/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | [ci skip] Sync AV, AR, AJ, AS, AM changelogs with our 5.0 release notes draft. This is a follow up to c94045d and contains changes made since the release of beta1.
* | | Execute default_scope defined by abstract class within the scope of subclassMehmet Emin İNAÇ2016-03-081-0/+6
| | |
* | | Add changelog for batch touch records.Arthur Neves2016-03-071-0/+15
| | | | | | | | | | | | | | | | | | related to #19324 and #18606 [skip ci]
* | | move changelog to right place [skip ci]Arthur Neves2016-03-071-6/+6
| | |
* | | Add changelog for #20997Arthur Neves2016-03-071-0/+6
| | |
* | | don't treat all associations with extensions as instance dependent.Yves Senn2016-03-031-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #23934. This is a forward port of ac832a43b4d026dbad28fed196d2de69ec9928ac Previously the scope of all associations with extensions were wrapped in an instance dependent proc. This made it impossible to preload such associations.
* | | Deprecate `{insert|update|delete}_sql` in `DatabaseStatements`Ryuta Kamizono2016-03-021-1/+5
| | | | | | | | | | | | | | | Originally, `{insert|update|delete}_sql` is protected methods. We can use the `{insert|update|delete}` public methods instead.
* | | Merge pull request #23417 from sgringwe/masterRafael Mendonça França2016-03-011-0/+6
|\ \ \ | | | | | | | | | | | | Add option to error on ignored order or limit
| * | | Add initial support for allowing an error on order or limit of queries being ↵Scott Ringwelski2016-02-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ignored in batches add some documentation and add 4 tests regarding error vs. warning behavior fix a typo when referring to the message go back to default in tests so that ordering is not important. use a constant instead of method. fix assert_nothing_raised call. use self.klass to allow per class configuration remove logger warn assets as that is tested elsewhere. pass error_on_ignore through find_each and find_in_batches also. add blocks to the finds so that the code is actually executed put the setting back to default in an ensure Add a changelog entry
* | | | Merge pull request #18766 from yasyf/issue_17864Sean Griffin2016-02-291-0/+15
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Honour joining model order in `has_many :through` associations when eager loading
| * | | | Honour the order of the joining model in a `has_many :through`Yasyf Mohamedali2015-03-021-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | association when eager loading. Previously, eager loading a `has_many :through` association with no defined order would return the records in the natural order of the database. Now, these records will be returned in the order that the joining record is returned, in case there is a defined order there.
* | | | | Ensure suppressor runs before validationseileencodes2016-02-241-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I ran into an issue where validations on a suppressed record were causing validation errors to be thrown on a record that was never going to be saved. There isn't a reason to run the validations on a record that doesn't matter. This change moves the suppressor up the chain to be run on the `save` or `save!` in the validations rather than in persistence. The issue with running it when we hit persistence is that the validations are run first, then we hit persistance, and then we hit the suppressor. The suppressor comes first. The change to the test was required since I added the `validates_presence_of` validations. Adding this alone was enough to demonstrate the issue. I added a new test to demonstrate the new behavior is explict.
* | | | | Preparing for 5.0.0.beta3 releaseeileencodes2016-02-241-0/+2
| | | | | | | | | | | | | | | | | | | | Adds changelog headers for beta3 release
* | | | | Remove changelog entry for reverted commiteileencodes2016-02-241-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | I had to revert changes made for this CHANGELOG entry so this is no longer valid. The change for this entry was removed in 2c02bc0.
* | | | | Merge pull request #23794 from matthewd/mutation-safe-to_aMatthew Draper2016-02-211-0/+8
| | | | | | | | | | | | | | | | | | | | Mutating the result of Relation#to_a should not affect the relation
* | | | | Add accidentally removed `#` [ci skip]Ryuta Kamizono2016-02-181-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | `#` was removed at f57092a but this `#` is intentional. e.g. https://github.com/rails/rails/blame/v5.0.0.beta2/activerecord/CHANGELOG.md#L1423-L1426
* | | | | Fix indentation for code block in changelogEileen M. Uchitelle2016-02-171-4/+4
| | | | | | | | | | | | | | | This was showing up as an H1. Fixing the indentation here fixes the codeblock.
* | | | | Remove accidentally duplicated change log title [ci skip]Mehmet Emin İNAÇ2016-02-181-3/+0
| | | | |
* | | | | Fixed `where` for polymorphic associations when passed an array containing ↵Philippe Huibonhoa2016-02-161-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | different types. When passing in an array of different types of objects to `where`, it would only take into account the class of the first object in the array. PriceEstimate.where(estimate_of: [Treasure.find(1), Car.find(2)]) # => SELECT "price_estimates".* FROM "price_estimates" WHERE ("price_estimates"."estimate_of_type" = 'Treasure' AND "price_estimates"."estimate_of_id" IN (1, 2)) This is fixed to properly look for any records matching both type and id: PriceEstimate.where(estimate_of: [Treasure.find(1), Car.find(2)]) # => SELECT "price_estimates".* FROM "price_estimates" WHERE (("price_estimates"."estimate_of_type" = 'Treasure' AND "price_estimates"."estimate_of_id" = 1) OR ("price_estimates"."estimate_of_type" = 'Car' AND "price_estimates"."estimate_of_id" = 2))
* | | | | Merge pull request #23614 from georgemillo/foreign_keyYves Senn2016-02-161-0/+5
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let t.foreign_key use the same `to_table` twice Conflicts: activerecord/CHANGELOG.md
| * | | | | Let t.foreign_key use the same `to_table` twiceGeorge Millo2016-02-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously if you used `t.foreign_key` twice within the same `create_table` block using the same `to_table`, all statements except the final one would fail silently. For example, the following code: def change create_table :flights do |t| t.integer :from_id, index: true, null: false t.integer :to_id, index: true, null: false t.foreign_key :airports, column: :from_id t.foreign_key :airports, column: :to_id end end Would only create one foreign key, on the column `from_id`. This commit allows multiple foreign keys to the same table to be created within one `create_table` block.
* | | | | | Merge pull request #23706 from vipulnsward/add-changelog-for-regressionYves Senn2016-02-161-2/+9
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | Add missing CHANGELOG for regression fix in #18155 which fixes #13387
| * | | | | Add missing CHANGELOG for regression fix in #18155 which fixes #13387Vipul A M2016-02-161-0/+7
|/ / / / / | | | | | | | | | | | | | | | [ci skip]
* | | | | Merge pull request #23377 from bogdan/last-with-sqlEileen M. Uchitelle2016-02-131-0/+21
|\ \ \ \ \ | | | | | | | | | | | | Fix AR::Relation#last bugs instroduced in 7705fc