aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
* Add `config.active_record.warn_on_records_fetched_greater_than` optionJason Nochlin2015-03-251-0/+7
| | | | | | | | | When set to an integer, a warning will be logged whenever a result set larger than the specified size is returned by a query. Fixes #16463 The warning is outputed a module which is prepended in an initializer, so there will be no performance impact if `config.active_record.warn_on_records_fetched_greater_than` is not set.
* Merge pull request #19503 from jasoncodes/no-psqlrcYves Senn2015-03-251-0/+4
| | | | Avoid loading user's psqlrc when loading test structure
* Merge pull request #19452 from ↵Carlos Antonio da Silva2015-03-241-0/+7
|\ | | | | | | | | | | pinglamb/fix-referencing-wrong-alias-when-joining-tables-of-has-many-through-association Fix referencing wrong aliases while joining tables of has many through association
| * Fix referencing wrong aliases while joining tables of has many throughpinglamb2015-03-221-0/+7
| | | | | | | | | | | | | | | | | | | | | | association While joining table of has_many :through association, ActiveRecord will use the actual table name instead of through-join alias. It results with a wrong SQL and exception is raised. This only happens when calculation methods like #count is called. This issue is affecting Rails 4.1.x and 4.2.x as well.
* | Make sure to persist a newly-nil serialized valueMatthew Draper2015-03-231-0/+7
| | | | | | | | | | | | | | The subtype will (quite reasonably) ignore the possibility that it has `changed_in_place?` by becoming nil. Fixes #19467
* | Move #19447 changelog to the top and reword it a bit [ci skip]Carlos Antonio da Silva2015-03-221-6/+8
|/
* Delegate limit to subtypewallerjake2015-03-211-0/+6
| | | | | | | | | | As described here https://github.com/rails/rails/issues/19420. When using the Postgres BigInt[] field type the big int value was not being translated into schema.rb. This caused the field to become just a regular integer field when building off of schema.rb. This fix will address this by delegating the limit from the subtype to the Array type. https://github.com/rails/rails/issues/19420
* Merge pull request #19406 from larskanis/add_changelog_entry_for_17680Yves Senn2015-03-191-0/+7
| | | | | | ActiveRecord: Add a changelog entry for issue #17680. [ci skip] Conflicts: activerecord/CHANGELOG.md
* Active Record changelog pass [skip ci]Jon Atack2015-03-191-35/+38
|
* Merge pull request #19348 from Empact/null-scopeYves Senn2015-03-181-0/+5
|\ | | | | | | | | | | | | Reuse the CollectionAssociation#reader proxy cache if the foreign key is present from the start. Conflicts: activerecord/CHANGELOG.md
| * Reuse the CollectionAssociation#reader proxy cache if the foreign key is ↵Ben Woosley2015-03-151-0/+5
| | | | | | | | | | | | | | | | | | | | present from the start. When a new record has the necessary information prior to save, we can avoid busting the cache. We could simply clear the @proxy on #reset or #reset_scope, but that would clear the cache more often than necessary.
* | Add config.active_record.dump_schemas.Ryan Wallace2015-03-171-0/+7
| | | | | | | | | | | | | | Fixes db:structure:dump when using schema_search_path and PostgreSQL extensions. Closes #17157.
* | Closes rails/rails#18864: Renaming transactional fixtures to transactional testsBrandon Weiss2015-03-161-0/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | I’m renaming all instances of `use_transcational_fixtures` to `use_transactional_tests` and “transactional fixtures” to “transactional tests”. I’m deprecating `use_transactional_fixtures=`. So anyone who is explicitly setting this will get a warning telling them to use `use_transactional_tests=` instead. I’m maintaining backwards compatibility—both forms will work. `use_transactional_tests` will check to see if `use_transactional_fixtures` is set and use that, otherwise it will use itself. But because `use_transactional_tests` is a class attribute (created with `class_attribute`) this requires a little bit of hoop jumping. The writer method that `class_attribute` generates defines a new reader method that return the value being set. Which means we can’t set the default of `true` using `use_transactional_tests=` as was done previously because that won’t take into account anyone using `use_transactional_fixtures`. Instead I defined the reader method manually and it checks `use_transactional_fixtures`. If it was set then it should be used, otherwise it should return the default, which is `true`. If someone uses `use_transactional_tests=` then it will overwrite the backwards-compatible method with whatever they set.
* Require pg~>0.18 to ensure Ruby 2.2 compatibilityMatt Brictson2015-03-111-0/+5
| | | | | | | Versions of the pg gem earlier than 0.18.0 cannot be used safely with Ruby 2.2. Specifically, pg 0.17 when used with Ruby 2.2 has a known bug that causes random bits to be added to the end of strings. Further explanation here: https://bitbucket.org/ged/ruby-pg/issue/210/crazy-bytes-being-added-to-record
* Correctly dump `serial` and `bigserial`Ryuta Kamizono2015-03-041-0/+4
|
* add CHANGELOG entry for #19176. [ci skip]Yves Senn2015-03-041-0/+4
|
* Add changelog for #15549 fix [skip ci]Arthur Neves2015-02-271-0/+7
|
* Properly create through records when called with `where`Sean Griffin2015-02-261-0/+7
| | | | | | | | | | | Various behaviors needed by associations (such as creating the through record) are lost when `where` is called, since we stop having a `CollectionProxy` and start having an `AssociationRelation` which does not contain this behavior. I *think* we should be able to rm `AssociationRelation`, but we have tests saying the changes required to do that would be bad (Without saying why. Of course. >_>) Fixes #19073.
* Add `SchemaMigration.create_table` support any unicode charsets for MySQL.Ryuta Kamizono2015-02-261-0/+4
| | | | | | | | | | | | | | | | | MySQL unicode support is not only `utf8mb4`. Then, The index length problem is not only `utf8mb4`. http://dev.mysql.com/doc/refman/5.6/en/charset-unicode.html SELECT * FROM information_schema.character_sets WHERE maxlen > 3; +--------------------+----------------------+------------------+--------+ | CHARACTER_SET_NAME | DEFAULT_COLLATE_NAME | DESCRIPTION | MAXLEN | +--------------------+----------------------+------------------+--------+ | utf8mb4 | utf8mb4_general_ci | UTF-8 Unicode | 4 | | utf16 | utf16_general_ci | UTF-16 Unicode | 4 | | utf16le | utf16le_general_ci | UTF-16LE Unicode | 4 | | utf32 | utf32_general_ci | UTF-32 Unicode | 4 | +--------------------+----------------------+------------------+--------+
* rework `disable_referential_integrity` for PostgreSQL.Yves Senn2015-02-241-0/+19
| | | | | | | | | | | | | | | | | | | | | | | [Toby Ovod-Everett & Andrey Nering & Yves Senn] Closes #17726. Closes #10939. This patch makes three distinct modifications: 1. no longer fall back to disabling user triggers if system triggers can't be disabled 2. warn the user when referential integrity can't be disabled 3. restore aborted transactions when referential integrity can't be disabled The motivation behind these changes is to make the behavior of Rails transparent and less error-prone. To require superuser privileges is not optimal but it's what Rails currently needs. Users who absolutely rely on disabling user triggers can patch `disable_referential_integrity`. We should investigate `SET CONSTRAINTS` as a possible solution which does not require superuser privileges. /cc @matthewd
* Allow `:limit` option for MySQL bigint primary key supportRyuta Kamizono2015-02-241-0/+15
| | | | | | | | | | | | | Example: create_table :foos, id: :primary_key, limit: 8 do |t| end # or create_table :foos, id: false do |t| t.column :id, limit: 8 end
* some indenting and punctuation fixes. [ci skip]Yves Senn2015-02-231-5/+7
|
* Require `belongs_to` by default.Josef Šimánek2015-02-211-0/+7
| | | | Deprecate `required` option in favor of `optional` for belongs_to.
* Merge pull request #17139 from mfazekas/fix_becomes_changed_attributesRafael Mendonça França2015-02-201-0/+6
|\ | | | | | | Always reset changed attributes in becomes
| * Always reset changed attributes in becomesMiklos Fazekas2015-02-041-0/+6
| | | | | | | | | | | | | | | | | | | | When ```becomes``` changes @attributes it should also change @changed_attributes. Otherwise we'll experience a kind of split head situation where attributes are coming from ```self```, but changed_attributes is coming from ```klass.new```. This affects the inheritance_colmn as it's changed by new for example. Fixes #16881
* | Format the time string according to the precision of the time columnRyuta Kamizono2015-02-201-0/+4
| | | | | | | | It is also necessary to format a time column like a datetime column.
* | Allow `:precision` option for time type columnsRyuta Kamizono2015-02-201-0/+4
| |
* | Copy edit the suppressor documentationRafael Mendonça França2015-02-191-13/+13
| | | | | | | | [ci skip]
* | Add `ActiveRecord::Base.suppress`Michael Ryan2015-02-181-0/+29
| |
* | Add `time` option to `#touch`Hyonjee Joo2015-02-181-0/+5
| | | | | | | | | | | | Fixes #18905. `#touch` now takes time as an option. Setting the option saves the record with the updated_at/on attributes set to the current time or the time specified. Updated tests and documentation accordingly.
* | Revert "Allow `:precision` option for time type columns"Sean Griffin2015-02-171-4/+0
| | | | | | | | | | | | | | | | | | | | This reverts commit 1502caefd30b137fd1a0865be34c5bbf85ba64c1. The test suite for the mysql adapter broke when this commit was used with MySQL 5.6. Conflicts: activerecord/CHANGELOG.md
* | Deprecated passing of `start` value to `find_in_batches` and `find_each` in ↵Vipul A M2015-02-171-0/+5
| | | | | | | | favour of `begin_at` value.
* | Merge pull request #18662 from estum/foreign-key-existsYves Senn2015-02-161-0/+4
|\ \ | | | | | | | | | Add `foreign_key_exists?` method.
* | | remove CHANGELOG entry for Rails 5.0 only feature. #18918Yves Senn2015-02-131-7/+0
| | | | | | | | | | | | | | | `has_secure_token` hasen't been released yet. No need to track every change in the CHANGELOG.
* | | Do not overwrite secret token value when already present.Wojciech Wnętrzak2015-02-121-0/+7
| | | | | | | | | | | | | | | | | | | | | ``` user = User.create(token: "custom-secure-token") user.token # => "custom-secure-token" ```
* | | Optimize none? and one? relation query methods to use LIMIT and COUNT.Eugene Gilburg2015-02-121-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | Use SQL COUNT and LIMIT 1 queries for none? and one? methods if no block or limit is given, instead of loading the entire collection to memory. The any? and many? methods already follow this behavior. [Eugene Gilburg & Rafael Mendonça França]
* | | Allow `:precision` option for time type columnsRyuta Kamizono2015-02-121-0/+4
| | |
* | | Refactor enum to be defined in terms of the attributes APISean Griffin2015-02-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In addition to cleaning up the implementation, this allows type casting behavior to be applied consistently everywhere. (#where for example). A good example of this was the previous need for handling value to key conversion in the setter, because the number had to be passed to `where` directly. This is no longer required, since we can just pass the string along to where. (It's left around for backwards compat) Fixes #18387
* | | `current_scope` shouldn't pollute sibling STI classesSean Griffin2015-02-111-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It looks like the only reason `current_scope` was thread local on `base_class` instead of `self` is to ensure that when we call a named scope created with a proc on the parent class, it correctly uses the default scope of the subclass. The reason this wasn't happening was because the proc captured `self` as the parent class, and we're not actually defining a real method. Using `instance_exec` fixes the problem. Fixes #18806
* | | fix `remove_reference` with `foreign_key: true` on MySQL. #18664.Yves Senn2015-02-111-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MySQL rejects to remove an index which is used in a foreign key constraint: ``` ActiveRecord::StatementInvalid: Mysql2::Error: Cannot drop index 'index_copies_on_title_id': needed in a foreign key constraint: ALTER TABLE `copies` DROP `title_id` ``` Removing the constraint before removing the column (and the index) solves this problem.
* | | Merge pull request #18877 from prathamesh-sonpatki/ar-changelog-typos-2Rafael Mendonça França2015-02-101-2/+2
|\ \ \ | | | | | | | | Fixed typos in ActiveRecord CHANGELOG [ci skip]
| * | | Fixed typos in ActiveRecord CHANGELOG [ci skip]Prathamesh Sonpatki2015-02-111-2/+2
| | | |
* | | | Add an option `end_at` to `find_in_batches`Vipul A M2015-02-091-0/+5
|/ / / | | | | | | | | | that complements the `start`parameter to specify where to stop batch processing
* | | Fix rounding problem for PostgreSQL timestamp columnRyuta Kamizono2015-02-081-0/+7
| | | | | | | | | | | | | | | If timestamp column have the precision, it need to format according to the precision of timestamp column.
* | | Respect the database default charset for `schema_migrations` table.Ryuta Kamizono2015-02-081-0/+8
| | | | | | | | | | | | | | | | | | The charset of `version` column in `schema_migrations` table is depend on the database default charset and collation rather than the encoding of the connection.
* | | Raise ArgumentError when passing nil to Relation#mergeRafael Mendonça França2015-02-061-0/+7
| | | | | | | | | | | | | | | | | | nil or false should not be valid argument to the merge method. Closes #12264
* | | Merge pull request #18399 from kommen/unify-structure-file-envvar-namesRafael Mendonça França2015-02-051-0/+6
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Use SCHEMA instead of DB_STRUCTURE for specifiying structure file. Conflicts: activerecord/CHANGELOG.md
| * | | Use `SCHEMA` instead of `DB_STRUCTURE` for specifiying structure file.Dieter Komendera2015-01-081-0/+6
| | | | | | | | | | | | | | | | | | | | `rake test:load_structure` already uses `SCHEMA` and there's no need to maintain two different env vars.
* | | | Respect custom primary keys for associations in `Relation#where`Sean Griffin2015-02-041-0/+6
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | While we query the proper columns, we go through normal handling for converting the value to a primitive which assumes it should use the table's primary key. If the association specifies a different value (and we know that we're working with an association), we should use the custom primary key instead. Fixes #18813.
* | | Correct errors in counter cache updatingSean Griffin2015-02-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cache name should be converted to a string when given, not compared as a symbol. This edge case is already adequately covered by our tests, but was masked by another issue where we were incorrectly updating the counter cache twice. When paired with a bug where we didn't update the counter cache because we couldn't find a match with the name, this made it look like everything was working fine. Fixes #10865.