aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
* Prevent making bind param if casted value is nilRyuta Kamizono2017-05-311-0/+4
| | | | | | | | If casted value is nil, generated SQL should be `IS NULL`. But currently it is generated as `= NULL`. To prevent this behavior, avoid making bind param if casted value is nil. Fixes #28945.
* Deprecate passing arguments and block at the same time to `count` and `sum` ↵Ryuta Kamizono2017-05-291-0/+4
| | | | | | | | in `ActiveRecord::Calculations` `select`, `count`, and `sum` in `Relation` are also `Enumerable` method that can be passed block. `select` with block already doesn't take arguments since 4fc3366. This is follow up of that.
* Add a Monitor to ModelSchema#load_schemaMatthew Draper2017-05-251-0/+6
| | | | [Vikrant Chaudhary, David Abdemoulaie, Matthew Draper]
* Cleanup CHANGELOGs [ci skip]Ryuta Kamizono2017-05-191-7/+7
| | | | | * Fix indentation. * Add backticks.
* Use recyclable cache keys (#29092)David Heinemeier Hansson2017-05-181-0/+9
|
* Changelog entry [ci-skip]Guillermo Iguaran2017-05-151-0/+4
|
* Add type caster to `RuntimeReflection#alias_name`Jon Moss2017-05-021-0/+6
| | | | | Since we have been using this `Arel::Table` since 111ccc832bc977b15af12c14e7ca078dad2d4373, in order to properly handle queries, it's important that we properly type cast arguments.
* Deprecate `supports_statement_cache?`Ryuta Kamizono2017-05-011-0/+4
| | | | | | | | | | | | | | `supports_statement_cache?` was introduced in 3.1.0.beta1 (104d0b2) for bind parameter substitution, but it is no longer used in 3.1.0.rc1 (73ff679). Originally it should respect `prepared_statements` rather than `supports_statement_cache?` (fd39847). One more thing, named `supports_statement_cache?` is pretty misreading. We have `StatementCache` and `StatementPool`. However, `supports_statement_cache?` doesn't mean `StatementCache`, but `StatementPool` unlike its name. https://github.com/rails/rails/blob/v5.1.0/activerecord/lib/active_record/statement_cache.rb https://github.com/rails/rails/blob/v5.1.0/activerecord/lib/active_record/connection_adapters/statement_pool.rb
* Cleanup CHANGELOGs [ci skip]Ryuta Kamizono2017-04-301-1/+1
| | | | | | * Remove trailing spaces. * Add backticks around method and command. * Fix indentation.
* Merge pull request #28681 from runephilosof/fix-mysql-grantRafael Mendonça França2017-04-201-0/+4
|\ | | | | | | Fix quoting in db:create grant all statement.
| * Fix quoting in db:create grant all statement.Rune Schjellerup Philosof2017-04-201-0/+4
| | | | | | | | | | | | The database name used in the test would have actually shown this if it had tried to execute on a real Mysql instead of being stubbed out (dashes in database names needs quotes).
* | Add additional raise UnknownMigrationVersionErrorbogdanvlviv2017-04-191-0/+5
| | | | | | | | | | Raise error on the movement of migrations when the current migration does not exist.
* | Fix `bin/rails db:forward` first migrationbogdanvlviv2017-04-191-0/+4
| |
* | Support Descending Indexes for MySQLRyuta Kamizono2017-04-161-0/+7
| | | | | | | | | | | | | | 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.
* | Fix inconsistency with changed attributes when overriding AR attribute readerbogdanvlviv2017-04-121-0/+4
| |
* | Passing in no arguments to the dynamic fixture accessor method returns all ↵Kevin McPhillips2017-04-071-0/+6
|/ | | | fixtures, not an empty array.
* Remove CHANGELOG.md entry that appears in 5-1-stableJon Moss2017-04-011-9/+0
| | | | | | | This CHANGELOG.md is a continuation of the 5-1-stable one, there shouldn't be any duplicate entries. [ci skip]
* Load only needed records on ActiveRecord::Relation#inspectHendy Tanata2017-03-281-0/+9
| | | | | | | Instead of loading all records and returning only a subset of those, just load the records as needed. Fixes #25537.
* Start Rails 5.2 developmentMatthew Draper2017-03-221-771/+1
|
* Fix changelog entry about transaction error classes [ci skip]yuuji.yaginuma2017-03-201-1/+1
| | | | | `ActiveRecord::TransactionSerializationError` was introduces in #25093. However, refactored in #25107, `TransactionSerializationError` is gone.
* Merge pull request #28154 from aripollak/remove-comments-from-structure-sqlRafael Mendonça França2017-03-171-0/+7
|\ | | | | | | Drop comments from structure.sql in postgresql
| * Drop comments from structure.sql in postgresqlAri Pollak2017-02-241-0/+7
| | | | | | | | Fixes #28153.
* | Merge pull request #28318 from ↵Rafael França2017-03-171-5/+0
|\ \ | | | | | | | | | | | | bogdanvlviv/remove-ability-update-locking_column-value Remove ability update locking_column value
| * | Remove ability update locking_column valuebogdanvlviv2017-03-161-5/+0
| | |
* | | Add :default option to belongs_to (#28453)George Claghorn2017-03-171-0/+14
|/ / | | | | | | | | | | | | | | | | | | | | Use it to specify that an association should be initialized with a particular record before validation. For example: # Before belongs_to :account before_validation -> { self.account ||= Current.account } # After belongs_to :account, default: -> { Current.account }
* | Add missing credit [ci skip]Ryuta Kamizono2017-03-101-0/+2
| |
* | Merge pull request #28351 from kamipo/deprecate_schema_migrations_table_nameRafael Mendonça França2017-03-091-0/+4
|\ \ | | | | | | | | | Deprecate `Migrator.schema_migrations_table_name`
| * | Deprecate `Migrator.schema_migrations_table_name`Ryuta Kamizono2017-03-091-0/+4
| | | | | | | | | | | | | | | Since 67fba0cf `SchemaMigration` model was extracted. Use `SchemaMigration.table_name` instead.
* | | Fix select with block doesn't return newly built records in has_many associationRyuta Kamizono2017-03-091-0/+6
|/ / | | | | | | | | | | | | | | The `select` in `QueryMethods` is also an enumerable method. Enumerable methods with block should delegate to `records` on `CollectionProxy`, not `scope`. Fixes #28348.
* | Check whether `Rails.application` defined before calling itAndrew White2017-03-071-0/+10
| | | | | | | | | | | | | | | | | | | | In #27674 we changed the migration generator to generate migrations at the path defined in `Rails.application.config.paths` however the code checked for the presence of the `Rails` constant but not the `Rails.application` method which caused problems when using Active Record and generators outside of the context of a Rails application. Fixes #28325.
* | Fix `deserialize` with JSON arrayRyuta Kamizono2017-03-061-0/+6
| | | | | | | | Fixes #28285.
* | Fix `rake db:schema:load` with subdirectoriesRyuta Kamizono2017-03-051-0/+4
| | | | | | | | | | | | | | | | Related #25174. `db:schema:load` doesn't work with subdirectories like previous `db:migrate:status`. `Migrator.migration_files` should be used in `assume_migrated_upto_version` to fix the issue.
* | Fix `rake db:migrate:status` with subdirectoriesRyuta Kamizono2017-03-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | `db:migrate` supports subdirectories and have a test. https://github.com/rails/rails/blob/v5.1.0.beta1/activerecord/test/cases/migrator_test.rb#L78-L85 But `db:migrate:status` doesn't work with subdirectories. It is due to `Dir.foreach(path)` is not the same with `Dir["#{path}/**/[0-9]*_*.rb"]`. I extracted `migration_files` and sharing it in the both to fix the issue. And added tests for `db:migrate:status`.
* | [ci skip] Add CHANGELOG entry for #28282Andrew White2017-03-041-0/+10
| |
* | Use `max_identifier_length` for `index_name_length` in PostgreSQL adapterRyuta Kamizono2017-02-271-0/+4
| | | | | | | | | | Actually `index_name_length` depend on `max_identifier_length`, not always 63.
* | Deprecate `supports_migrations?` on connection adaptersRyuta Kamizono2017-02-271-0/+4
| | | | | | | | | | | | | | `supports_migrations?` was added at 4160b518 to determine if schema statements (`create_table`, `drop_table`, etc) are implemented in the adapter. But all tested databases has been supported migrations since a4fc93c3 at least.
* | [ci skip] Add CHANGELOG entry for #28183Andrew White2017-02-261-0/+4
|/
* Deprecate using `#quoted_id` in quotingRyuta Kamizono2017-02-241-0/+4
| | | | | Originally `quoted_id` was used in legacy quoting mechanism. Now we use type casting mechanism for that. Let's deprecate `quoted_id`.
* Fix `wait_timeout` to configurable for mysql2 adapterRyuta Kamizono2017-02-241-0/+7
| | | | Fixes #26556.
* Preparing for 5.1.0.beta1 releaseRafael Mendonça França2017-02-231-0/+2
|
* Correctly dump native timestamp types for MySQLRyuta Kamizono2017-02-231-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The native timestamp type in MySQL is different from datetime type. Internal representation of the timestamp type is UNIX time, This means that timestamp columns are affected by time zone. ``` > SET time_zone = '+00:00'; Query OK, 0 rows affected (0.00 sec) > INSERT INTO time_with_zone(ts,dt) VALUES (NOW(),NOW()); Query OK, 1 row affected (0.02 sec) > SELECT * FROM time_with_zone; +---------------------+---------------------+ | ts | dt | +---------------------+---------------------+ | 2016-02-07 22:11:44 | 2016-02-07 22:11:44 | +---------------------+---------------------+ 1 row in set (0.00 sec) > SET time_zone = '-08:00'; Query OK, 0 rows affected (0.00 sec) > SELECT * FROM time_with_zone; +---------------------+---------------------+ | ts | dt | +---------------------+---------------------+ | 2016-02-07 14:11:44 | 2016-02-07 22:11:44 | +---------------------+---------------------+ 1 row in set (0.00 sec) ```
* Merge pull request #28042 from kamipo/add_changelog_for_27384Rafael França2017-02-211-0/+4
|\ | | | | Add CHANGELOG entry for #27384 and #27762
| * Add CHANGELOG entry for #27384 and #27762Ryuta Kamizono2017-02-171-0/+4
| |
* | Add backticks around method namesJon Moss2017-02-211-1/+1
|/ | | | [ci skip]
* Omit redundant `using: :btree` for schema dumpingRyuta Kamizono2017-02-131-0/+4
|
* Deprecate passing `default` to `index_name_exists?`Ryuta Kamizono2017-02-131-3/+7
|
* Schema dumping support for PostgreSQL oid typeRyuta Kamizono2017-02-121-1/+1
| | | | Closes #27980
* Schema dumping support for PostgreSQL interval typeRyuta Kamizono2017-02-121-0/+4
| | | | Closes #27979
* Deprecate `supports_primary_key?`Ryuta Kamizono2017-02-121-0/+5
| | | | | | | | | | | | `supports_primary_key?` was added to determine if `primary_key` is implemented in the adapter in f060221. But we already use `primary_key` without `supports_primary_key?` (207f266, 5f3cf42) and using `supports_primary_key?` has been removed in #1318. This means that `supports_primary_key?` is no longer used in the internal and Active Record doesn't work without `primary_key` is implemented (all adapters must implement `primary_key`). Closes #27977
* Make `table_name=` reset current statement cachenamusyaka2017-02-121-0/+5
| | | | | | So queries are not run against the previous table name. Closes #27953