aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
...
| * Resolve enums in test fixturesGeorge Claghorn2015-05-271-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, values for columns backing Active Record enums must be specified as integers in test fixtures: awdr: title: "Agile Web Development with Rails" status: 2 rfr: title: "Ruby for Rails" status: <%= Book.statuses[:proposed] %> This is potentially confusing, since enum values are typically specified as symbols or strings in application code. To resolve the confusion, this change permits the use of symbols or strings to specify enum values: awdr: status: :published It is compatible with fixtures that specify enum values as integers.
* | Merge pull request #19886 from henders/henders/reload_wipe_query_cacheRafael Mendonça França2015-05-271-0/+4
|\ \ | |/ |/| | | Cause ActiveRecord::Base::reload to also ignore the QueryCache.
* | Merge pull request #20269 from wojobucco/masterRafael Mendonça França2015-05-271-0/+4
|\ \ | | | | | | | | | Changed mysqldump to include sprocs and functions
* | | add `extend` option on `has_and_belongs_to_many`.keepcosmos2015-05-261-0/+4
| | |
* | | deprecate `Relation#uniq` use `Relation#distinct` instead.Yves Senn2015-05-261-0/+6
|/ / | | | | | | | | | | | | | | | | See #9683 for the reasons we switched to `distinct`. Here is the discussion that triggered the actual deprecation #20198. `uniq`, `uniq!` and `uniq_value` are still around. They will be removed in the next minor release after Rails 5.
* | Pass over CHANGELOGS [ci skip]Prathamesh Sonpatki2015-05-161-2/+3
| |
* | Merge branch 'sti-subclass-from-attributes' of ↵Yves Senn2015-05-131-0/+5
|\ \ | | | | | | | | | | | | | | | | | | https://github.com/agrobbin/rails into agrobbin-sti-subclass-from-attributes Conflicts: activerecord/CHANGELOG.md
| * | allow setting of a demodulized class name when using STIAlex Robbin2015-05-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If your STI class looks like this: ```ruby class Company < ActiveRecord::Base self.store_full_sti_class = false class GoodCo < Company end class BadCo < Company end end ``` The expectation (which is valid) is that the `type` in the database is saved as `GoodCo` or `BadCo`. However, another expectation should be that setting `type` to `GoodCo` would correctly instantiate the object as a `Company::GoodCo`. That second expectation is what this should fix.
* | | Add full set of MySQL CLI options to support SSL authentication when using ↵Alex Coomans2015-05-121-0/+6
|/ / | | | | | | db:structure dump and load
* | Merge pull request #19994 from kamipo/dump_indexes_in_create_tableRafael Mendonça França2015-05-031-0/+7
|\ \ | | | | | | | | | Dump indexes in `create_table` instead of `add_index`
| * | Dump indexes in `create_table` instead of `add_index`Ryuta Kamizono2015-05-031-0/+7
| | | | | | | | | | | | | | | If the adapter supports indexes in create table, generated SQL is slightly more efficient.
* | | Merge pull request #17569 from kamipo/dump_table_optionsRafael Mendonça França2015-05-031-0/+4
|\ \ \ | | | | | | | | | | | | Correctly dump `:options` on `create_table` for MySQL
| * | | Correctly dump `:options` on `create_table` for MySQLRyuta Kamizono2015-05-031-0/+4
| |/ /
* / / PostgreSQL: `:collation` support for string and text columnsRyuta Kamizono2015-05-041-0/+11
|/ / | | | | | | | | | | | | | | | | Example: create_table :foos do |t| t.string :string_en, collation: 'en_US.UTF-8' t.text :text_ja, collation: 'ja_JP.UTF-8' end
* | Improvement on Activerecord CHANGELOGthiagoaugusto2015-05-011-1/+1
| |
* | Merge pull request #19546 from DianthuDia/fix_unscope_for_less_thanYves Senn2015-04-281-0/+4
|\ \ | | | | | | | | | Fix unscope for less than
* \ \ Merge pull request #19718 from eagletmt/find_by-without-argYves Senn2015-04-281-0/+5
|\ \ \ | | | | | | | | | | | | Raise ArgumentError when find_by receives no arguments
* | | | Revert "Merge pull request #17920 from ↵Yves Senn2015-04-271-0/+7
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | calebthompson/dont-rely-on-environment-task-for-schema-load" This reverts commit 08ff4ccbbb3fb143a02e6752efb974a4bcfcd3bb, reversing changes made to 6c9ed6dbc62450cdb87559afd15798305e069146. Caused by #17920. Closes #19545. This patch introduced regressions because initializers were no longer loaded. Specifically missing inflections result in broken restores of the database.
* | | Merge pull request #18880 from mudge/timestamp-index-bugRafael Mendonça França2015-04-231-0/+8
|\ \ \ | | | | | | | | | | | | Fix missing index when using timestamps with index
| * | | Fix missing index when using timestamps with indexPaul Mucur2015-04-151-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `index` option used with `timestamps` should be passed to both `column` definitions for `created_at` and `updated_at` rather than just the first. This was happening because `Hash#delete` is used to extract the `index` option passed to `timestamps`, thereby mutating the `options` hash in-place. Now take a copy of the `options` before deleting so that the original is not modified.
* | | | pass over CHANGELOGs. [ci skip]Yves Senn2015-04-221-4/+6
| | | |
* | | | Rename association option :class to :anonymous_classAndrew White2015-04-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 1f006c an option was added called :class to allow passing anonymous classes to association definitions. Since using :class instead of :class_name is a fairly common typo even amongst experienced developers this can result in hard to debug errors arising in raise_on_type_mismatch? To fix this we're renaming the option from :class to :anonymous_class as that is a more correct description of what the option is for. Since this was an internal, undocumented option there is no need for a deprecation. Fixes #19659
* | | | Autosave existing records on HMT associations when the parent is newSean Griffin2015-04-181-0/+7
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To me it seems like this should only be the case if `autosave: true` is set on the association. However, when implemented that way, it caused issues with has many associations, where we have explicit tests stating that child records are updated when the parent is new, even if autosave is not set (presumably to update the parent id, but other changed attributes would be persisted as well). It's quirky, but at least we should be consistently quirky. This constitutes a minor but subtle change in behavior, and therefore should not be backported to 4.2 and earlier. Fixes #19782
* | | Revert "Merge pull request #19755 from yuki24/activerecord/support-for-set"Yves Senn2015-04-151-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 524d40591eaa2f4d007409bfad386f6b107492eb, reversing changes made to 34d3a6095100245283861ef480a54d0643bbee4c. Reasoning behind the revert are in the PR discussion: https://github.com/rails/rails/pull/19755 - This means that types can no longer cast to/from `Set`, and reasonably work with `where` (we already have this problem for `array`/`json` types on pg) - This adds precedent for every other `Enumerable`, and we can't target `Enumerable` directly. - Calling `to_a` on a `Set` is reasonable.
* | | Merge pull request #19755 from yuki24/activerecord/support-for-setYves Senn2015-04-141-0/+4
|\ \ \ | |/ / |/| | | | | Add support for Set to Relation#where
| * | Add support for Set to Relation#whereYuki Nishijima2015-04-131-0/+4
|/ / | | | | | | | | | | | | | | | | Previously `#where` used to treat `Set`objects as nil, but now it treats them as an array: set = Set.new([1, 2]) Author.where(:id => set) # => SELECT "authors".* FROM "authors" WHERE "authors"."id" IN (1, 2)
* | Merge branch 'fix_uniqueness_validation_when_value_is_out_of_range'Sean Griffin2015-04-081-0/+5
|\ \
| * | Fix uniqueness validation with out of range valueAndrey Voronkov2015-04-081-0/+4
|/ /
* | Merge pull request #17574 from kamipo/charset_collation_optionsJeremy Kemper2015-04-071-0/+11
|\ \ | | | | | | | | | Add charset and collation options support for MySQL string and text columns.
| * | Add `:charset` and `:collation` options support for MySQL string and text ↵Ryuta Kamizono2015-03-061-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | columns Example: create_table :foos do |t| t.string :string_utf8_bin, charset: 'utf8', collation: 'utf8_bin' t.text :text_ascii, charset: 'ascii' end
* | | Merge pull request #19652 from vngrs/pluralize_foreign_key_table_name_bugYves Senn2015-04-061-0/+7
| | | | | | | | | | | | use singular table name if pluralize_table_names is setted as false whil...
* | | Reduce memory usage when loading types in PGSean Griffin2015-03-291-0/+6
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | We were never clearing the `PG::Result` object used to query the types when the connection is first established. This would lead to a potentially large amount of memory being retained for the life of the connection. Investigating this issue also revealed several low hanging fruit on the performance of these methods, and the number of allocations has been reduced by ~90%. Fixes #19578
* | 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.