2016-10-02 18:35:54 -04:00
|
|
|
* Deprecate passing `name` to `indexes`.
|
|
|
|
|
|
|
|
*Ryuta Kamizono*
|
|
|
|
|
2017-01-03 19:10:31 -05:00
|
|
|
* Remove deprecated tasks: `db:test:clone`, `db:test:clone_schema`, `db:test:clone_structure`.
|
|
|
|
|
|
|
|
*Rafel Mendonça França*
|
|
|
|
|
2016-12-30 18:43:04 -05:00
|
|
|
* Compare deserialized values for `PostgreSQL::OID::Hstore` types when
|
2016-10-02 18:35:54 -04:00
|
|
|
calling `ActiveRecord::Dirty#changed_in_place?`.
|
2016-12-30 18:43:04 -05:00
|
|
|
|
|
|
|
Fixes #27502.
|
|
|
|
|
|
|
|
*Jon Moss*
|
|
|
|
|
2017-01-03 19:22:52 -05:00
|
|
|
* Raise `ArgumentError` when passing an `ActiveRecord::Base` instance to `.find`,
|
|
|
|
`.exists?` and `.update`.
|
2017-01-03 15:52:35 -05:00
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2017-01-03 11:15:16 -05:00
|
|
|
* Respect precision option for arrays of timestamps.
|
|
|
|
|
|
|
|
Fixes #27514.
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2016-12-31 13:42:53 -05:00
|
|
|
* Optimize slow model instantiation when using STI and `store_full_sti_class = false` option.
|
|
|
|
|
|
|
|
*Konstantin Lazarev*
|
|
|
|
|
2016-12-31 12:45:52 -05:00
|
|
|
* Add `touch` option to counter cache modifying methods.
|
|
|
|
|
|
|
|
Works when updating, resetting, incrementing and decrementing counters:
|
|
|
|
|
|
|
|
# Touches `updated_at`/`updated_on`.
|
|
|
|
Topic.increment_counter(:messages_count, 1, touch: true)
|
|
|
|
Topic.decrement_counter(:messages_count, 1, touch: true)
|
|
|
|
|
|
|
|
# Touches `last_discussed_at`.
|
|
|
|
Topic.reset_counters(18, :messages, touch: :last_discussed_at)
|
|
|
|
|
|
|
|
# Touches `updated_at` and `last_discussed_at`.
|
|
|
|
Topic.update_counters(18, messages_count: 5, touch: %i( updated_at last_discussed_at ))
|
2016-12-30 17:01:25 -05:00
|
|
|
|
|
|
|
Fixes #26724.
|
|
|
|
|
|
|
|
*Jarred Trost*
|
|
|
|
|
2016-12-30 07:29:18 -05:00
|
|
|
* Remove deprecated `#uniq`, `#uniq!`, and `#uniq_value`.
|
|
|
|
|
|
|
|
*Ryuta Kamizono*
|
|
|
|
|
2016-12-30 07:14:59 -05:00
|
|
|
* Remove deprecated `#insert_sql`, `#update_sql`, and `#delete_sql`.
|
|
|
|
|
|
|
|
*Ryuta Kamizono*
|
|
|
|
|
2016-12-29 16:37:15 -05:00
|
|
|
* Remove deprecated `#use_transactional_fixtures` configuration.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2016-12-29 16:08:12 -05:00
|
|
|
* Remove deprecated `#raise_in_transactional_callbacks` configuration.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2016-12-29 16:05:43 -05:00
|
|
|
* Remove deprecated `#load_schema_for`.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2016-12-29 16:01:16 -05:00
|
|
|
* Remove deprecated conditions parameter from `#destroy_all` and `#delete_all`.
|
2016-12-29 15:55:31 -05:00
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2016-12-29 15:39:50 -05:00
|
|
|
* Remove deprecated support to passing arguments to `#select` when a block is provided.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2016-12-29 15:18:44 -05:00
|
|
|
* Remove deprecated support to query using commas on LIMIT.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2016-12-29 14:43:19 -05:00
|
|
|
* Remove deprecated support to passing a class as a value in a query.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2016-12-29 19:11:56 -05:00
|
|
|
* Raise `ActiveRecord::IrreversibleOrderError` when using `last` with an irreversible
|
2016-12-29 13:14:00 -05:00
|
|
|
order.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2016-12-29 19:11:56 -05:00
|
|
|
* Raise when a `has_many :through` association has an ambiguous reflection name.
|
2016-12-29 12:50:01 -05:00
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2016-12-30 18:58:03 -05:00
|
|
|
* Raise when `ActiveRecord::Migration` is inherited from directly.
|
2016-12-29 11:57:45 -05:00
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2016-12-29 11:08:34 -05:00
|
|
|
* Remove deprecated `original_exception` argument in `ActiveRecord::StatementInvalid#initialize`
|
|
|
|
and `ActiveRecord::StatementInvalid#original_exception`.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2016-12-29 19:03:46 -05:00
|
|
|
* `#tables` and `#table_exists?` return only tables and not views.
|
2016-12-29 03:33:15 -05:00
|
|
|
|
|
|
|
All the deprecations on those methods were removed.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2016-12-29 02:50:21 -05:00
|
|
|
* Remove deprecated `name` argument from `#tables`.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2016-12-29 02:20:50 -05:00
|
|
|
* Remove deprecated support to passing a column to `#quote`.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2016-12-29 19:11:56 -05:00
|
|
|
* Set `:time` as a timezone aware type and remove deprecation when
|
|
|
|
`config.active_record.time_zone_aware_types` is not explictly set.
|
2016-12-28 23:45:01 -05:00
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2016-12-28 23:18:42 -05:00
|
|
|
* Remove deprecated force reload argument in singular and collection association readers.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2016-11-29 16:52:59 -05:00
|
|
|
* Remove deprecated `activerecord.errors.messages.restrict_dependent_destroy.one` and
|
|
|
|
`activerecord.errors.messages.restrict_dependent_destroy.many` i18n scopes.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2016-12-29 14:29:47 -05:00
|
|
|
* Allow passing extra flags to `db:structure:load` and `db:structure:dump`
|
|
|
|
|
|
|
|
Introduces `ActiveRecord::Tasks::DatabaseTasks.structure_(load|dump)_flags` to customize the
|
|
|
|
eventual commands run against the database, e.g. mysqldump/pg_dump.
|
|
|
|
|
|
|
|
*Kir Shatrov*
|
|
|
|
|
2016-12-12 16:51:39 -05:00
|
|
|
* Notifications see frozen SQL string.
|
|
|
|
|
2016-12-27 08:47:10 -05:00
|
|
|
Fixes #23774.
|
2016-12-12 16:51:39 -05:00
|
|
|
|
|
|
|
*Richard Monette*
|
|
|
|
|
2016-12-27 08:47:10 -05:00
|
|
|
* RuntimeErrors are no longer translated to `ActiveRecord::StatementInvalid`.
|
2016-12-12 16:51:39 -05:00
|
|
|
|
|
|
|
*Richard Monette*
|
|
|
|
|
2016-12-13 12:01:02 -05:00
|
|
|
* Change the schema cache format to use YAML instead of Marshal.
|
|
|
|
|
|
|
|
*Kir Shatrov*
|
|
|
|
|
2016-12-11 06:55:23 -05:00
|
|
|
* Support index length and order options using both string and symbol
|
|
|
|
column names.
|
|
|
|
|
|
|
|
Fixes #27243.
|
|
|
|
|
|
|
|
*Ryuta Kamizono*
|
|
|
|
|
2016-12-10 09:07:45 -05:00
|
|
|
* Raise `ActiveRecord::RangeError` when values that executed are out of range.
|
|
|
|
|
|
|
|
*Ryuta Kamizono*
|
|
|
|
|
2016-12-09 14:41:42 -05:00
|
|
|
* Raise `ActiveRecord::NotNullViolation` when a record cannot be inserted
|
|
|
|
or updated because it would violate a not null constraint.
|
|
|
|
|
|
|
|
*Ryuta Kamizono*
|
|
|
|
|
|
|
|
* Emulate db trigger behaviour for after_commit :destroy, :update.
|
2016-12-01 17:39:15 -05:00
|
|
|
|
|
|
|
Race conditions can occur when an ActiveRecord is destroyed
|
|
|
|
twice or destroyed and updated. The callbacks should only be
|
|
|
|
triggered once, similar to a SQL database trigger.
|
|
|
|
|
|
|
|
*Stefan Budeanu*
|
|
|
|
|
2016-12-09 14:41:42 -05:00
|
|
|
* Moved `DecimalWithoutScale`, `Text`, and `UnsignedInteger` from Active Model to Active Record.
|
2016-10-03 09:06:11 -04:00
|
|
|
|
|
|
|
*Iain Beeston*
|
|
|
|
|
2016-10-05 12:34:33 -04:00
|
|
|
* Fix `write_attribute` method to check whether an attribute is aliased or not, and
|
|
|
|
use the aliased attribute name if needed.
|
|
|
|
|
|
|
|
*Prathamesh Sonpatki*
|
|
|
|
|
2016-09-16 09:51:56 -04:00
|
|
|
* Fix `read_attribute` method to check whether an attribute is aliased or not, and
|
|
|
|
use the aliased attribute name if needed.
|
|
|
|
|
|
|
|
Fixes #26417.
|
|
|
|
|
|
|
|
*Prathamesh Sonpatki*
|
|
|
|
|
2016-12-09 14:41:42 -05:00
|
|
|
* PostgreSQL & MySQL: Use big integer as primary key type for new tables.
|
2016-05-10 18:10:46 -04:00
|
|
|
|
|
|
|
*Jon McCartie*, *Pavel Pravosud*
|
|
|
|
|
2016-11-30 12:47:31 -05:00
|
|
|
* Change the type argument of `ActiveRecord::Base#attribute` to be optional.
|
|
|
|
The default is now `ActiveRecord::Type::Value.new`, which provides no type
|
|
|
|
casting behavior.
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2017-01-03 18:54:14 -05:00
|
|
|
* Don't treat unsigned integers with zerofill as signed.
|
2016-11-21 03:40:05 -05:00
|
|
|
|
|
|
|
Fixes #27125.
|
|
|
|
|
|
|
|
*Ryuta Kamizono*
|
|
|
|
|
2016-11-26 07:17:11 -05:00
|
|
|
* Fix the uniqueness validation scope with a polymorphic association.
|
|
|
|
|
|
|
|
*Sergey Alekseev*
|
|
|
|
|
2016-12-09 14:41:42 -05:00
|
|
|
* Raise `ActiveRecord::RecordNotFound` from collection `*_ids` setters
|
2016-10-06 08:47:26 -04:00
|
|
|
for unknown IDs with a better error message.
|
|
|
|
|
2016-10-07 03:56:05 -04:00
|
|
|
Changes the collection `*_ids` setters to cast provided IDs the data
|
|
|
|
type of the primary key set in the association, not the model
|
|
|
|
primary key.
|
|
|
|
|
2016-10-06 08:47:26 -04:00
|
|
|
*Dominic Cleal*
|
|
|
|
|
2016-07-07 23:22:37 -04:00
|
|
|
* For PostgreSQL >= 9.4 use `pgcrypto`'s `gen_random_uuid()` instead of
|
|
|
|
`uuid-ossp`'s UUID generation function.
|
|
|
|
|
|
|
|
*Yuji Yaginuma*, *Yaw Boakye*
|
|
|
|
|
2016-11-21 11:19:23 -05:00
|
|
|
* Introduce `Model#reload_<association>` to bring back the behavior
|
|
|
|
of `Article.category(true)` where `category` is a singular
|
|
|
|
association.
|
|
|
|
|
2016-12-01 00:27:05 -05:00
|
|
|
The force reloading of the association reader was deprecated
|
|
|
|
in #20888. Unfortunately the suggested alternative of
|
2016-11-21 11:19:23 -05:00
|
|
|
`article.reload.category` does not expose the same behavior.
|
|
|
|
|
|
|
|
This patch adds a reader method with the prefix `reload_` for
|
|
|
|
singular associations. This method has the same semantics as
|
|
|
|
passing true to the association reader used to have.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2016-11-21 06:56:20 -05:00
|
|
|
* Make sure eager loading `ActiveRecord::Associations` also loads
|
|
|
|
constants defined in `ActiveRecord::Associations::Preloader`.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2016-11-15 16:14:15 -05:00
|
|
|
* Allow `ActionController::Parameters`-like objects to be passed as
|
|
|
|
values for Postgres HStore columns.
|
|
|
|
|
|
|
|
Fixes #26904.
|
|
|
|
|
|
|
|
*Jon Moss*
|
|
|
|
|
2016-10-05 12:34:33 -04:00
|
|
|
* Added `stat` method to `ActiveRecord::ConnectionAdapters::ConnectionPool`.
|
2016-11-08 12:10:16 -05:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
ActiveRecord::Base.connection_pool.stat # =>
|
|
|
|
{ size: 15, connections: 1, busy: 1, dead: 0, idle: 0, waiting: 0, checkout_timeout: 5 }
|
|
|
|
|
|
|
|
*Pavel Evstigneev*
|
|
|
|
|
2016-11-06 10:27:50 -05:00
|
|
|
* Avoid `unscope(:order)` when `limit_value` is presented for `count`
|
|
|
|
and `exists?`.
|
2016-11-05 10:20:53 -04:00
|
|
|
|
|
|
|
If `limit_value` is presented, records fetching order is very important
|
2016-11-12 13:14:49 -05:00
|
|
|
for performance. We should not unscope the order in the case.
|
2016-11-05 10:20:53 -04:00
|
|
|
|
|
|
|
*Ryuta Kamizono*
|
|
|
|
|
2016-11-12 13:14:49 -05:00
|
|
|
* Fix an Active Record `DateTime` field `NoMethodError` caused by incomplete
|
2016-11-05 10:20:53 -04:00
|
|
|
datetime.
|
|
|
|
|
|
|
|
Fixes #24195.
|
2016-03-14 21:51:25 -04:00
|
|
|
|
|
|
|
*Sen Zhang*
|
|
|
|
|
2016-11-12 13:14:49 -05:00
|
|
|
* Allow `slice` to take an array of methods(without the need for splatting).
|
2016-10-19 20:51:00 -04:00
|
|
|
|
|
|
|
*Cohen Carlisle*
|
|
|
|
|
2015-04-14 15:50:36 -04:00
|
|
|
* Improved partial writes with HABTM and has many through associations
|
|
|
|
to fire database query only if relation has been changed.
|
|
|
|
|
|
|
|
Fixes #19663.
|
|
|
|
|
|
|
|
*Mehmet Emin İNAÇ*
|
|
|
|
|
2016-09-07 02:05:01 -04:00
|
|
|
* Deprecate passing arguments and block at the same time to
|
|
|
|
`ActiveRecord::QueryMethods#select`.
|
|
|
|
|
|
|
|
*Prathamesh Sonpatki*
|
|
|
|
|
2016-11-12 13:14:49 -05:00
|
|
|
* Optimistic locking: Added ability to update `locking_column` value.
|
|
|
|
Ignore optimistic locking if trying to update with new `locking_column` value.
|
2016-08-22 14:16:08 -04:00
|
|
|
|
|
|
|
*bogdanvlviv*
|
|
|
|
|
2016-11-12 13:14:49 -05:00
|
|
|
* Fixed: Optimistic locking does not work well with `null` in the database.
|
2016-08-03 20:36:30 -04:00
|
|
|
|
2016-12-09 14:41:42 -05:00
|
|
|
Fixes #26024.
|
2016-08-03 20:36:30 -04:00
|
|
|
|
|
|
|
*bogdanvlviv*
|
|
|
|
|
2016-10-10 21:50:26 -04:00
|
|
|
* Fixed support for case insensitive comparisons of `text` columns in
|
|
|
|
PostgreSQL.
|
|
|
|
|
|
|
|
*Edho Arief*
|
|
|
|
|
2016-12-09 14:41:42 -05:00
|
|
|
* Serialize JSON attribute value `nil` as SQL `NULL`, not JSON `null`.
|
2016-07-03 15:27:37 -04:00
|
|
|
|
|
|
|
*Trung Duc Tran*
|
|
|
|
|
2016-09-23 05:50:39 -04:00
|
|
|
* Return `true` from `update_attribute` when the value of the attribute
|
|
|
|
to be updated is unchanged.
|
|
|
|
|
|
|
|
Fixes #26593.
|
|
|
|
|
|
|
|
*Prathamesh Sonpatki*
|
|
|
|
|
2016-09-19 18:37:42 -04:00
|
|
|
* Always store errors details information with symbols.
|
|
|
|
|
|
|
|
When the association is autosaved we were storing the details with
|
|
|
|
string keys. This was creating inconsistency with other details that are
|
|
|
|
added using the `Errors#add` method. It was also inconsistent with the
|
|
|
|
`Errors#messages` storage.
|
|
|
|
|
|
|
|
To fix this inconsistency we are always storing with symbols. This will
|
|
|
|
cause a small breaking change because in those cases the details could
|
|
|
|
be accessed as strings keys but now it can not.
|
|
|
|
|
|
|
|
Fix #26499.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*, *Marcus Vieira*
|
|
|
|
|
2016-09-14 11:07:15 -04:00
|
|
|
* Calling `touch` on a model using optimistic locking will now leave the model
|
|
|
|
in a non-dirty state with no attribute changes.
|
|
|
|
|
|
|
|
Fixes #26496.
|
|
|
|
|
|
|
|
*Jakob Skjerning*
|
|
|
|
|
2016-09-13 14:17:06 -04:00
|
|
|
* Using a mysql2 connection after it fails to reconnect will now have an error message
|
|
|
|
saying the connection is closed rather than an undefined method error message.
|
|
|
|
|
|
|
|
*Dylan Thacker-Smith*
|
|
|
|
|
2016-08-31 12:06:30 -04:00
|
|
|
* PostgreSQL array columns will now respect the encoding of strings contained
|
|
|
|
in the array.
|
|
|
|
|
|
|
|
Fixes #26326.
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2016-08-31 08:54:38 -04:00
|
|
|
* Inverse association instances will now be set before `after_find` or
|
|
|
|
`after_initialize` callbacks are run.
|
|
|
|
|
|
|
|
Fixes #26320.
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2016-02-05 10:16:15 -05:00
|
|
|
* Remove unnecessarily association load when a `belongs_to` association has already been
|
|
|
|
loaded then the foreign key is changed directly and the record saved.
|
|
|
|
|
|
|
|
*James Coleman*
|
|
|
|
|
2016-08-22 14:46:04 -04:00
|
|
|
* Remove standardized column types/arguments spaces in schema dump.
|
2016-07-01 05:24:12 -04:00
|
|
|
|
|
|
|
*Tim Petricola*
|
|
|
|
|
2016-08-19 00:08:09 -04:00
|
|
|
* Avoid loading records from database when they are already loaded using
|
|
|
|
the `pluck` method on a collection.
|
|
|
|
|
|
|
|
Fixes #25921.
|
|
|
|
|
|
|
|
*Ryuta Kamizono*
|
|
|
|
|
2016-08-13 17:17:20 -04:00
|
|
|
* Remove text default treated as an empty string in non-strict mode for
|
|
|
|
consistency with other types.
|
|
|
|
|
|
|
|
Strict mode controls how MySQL handles invalid or missing values in
|
|
|
|
data-change statements such as INSERT or UPDATE. If strict mode is not
|
|
|
|
in effect, MySQL inserts adjusted values for invalid or missing values
|
|
|
|
and produces warnings.
|
|
|
|
|
|
|
|
def test_mysql_not_null_defaults_non_strict
|
|
|
|
using_strict(false) do
|
|
|
|
with_mysql_not_null_table do |klass|
|
|
|
|
record = klass.new
|
|
|
|
assert_nil record.non_null_integer
|
|
|
|
assert_nil record.non_null_string
|
|
|
|
assert_nil record.non_null_text
|
|
|
|
assert_nil record.non_null_blob
|
|
|
|
|
|
|
|
record.save!
|
|
|
|
record.reload
|
|
|
|
|
|
|
|
assert_equal 0, record.non_null_integer
|
|
|
|
assert_equal "", record.non_null_string
|
|
|
|
assert_equal "", record.non_null_text
|
|
|
|
assert_equal "", record.non_null_blob
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sql-mode-strict
|
|
|
|
|
|
|
|
*Ryuta Kamizono*
|
|
|
|
|
Added nil case handling to allow rollback migration in case of
invalid column type
/activerecord/lib/active_record/connection_adapters
/abstract/schema_definitions.rb:306
type = type.to_sym
Changed to the following to handle nil case:
type = type.to_sym if type
Added regression test for this case:
/activerecord/test/cases/migration_test.rb:554
if current_adapter?(:SQLite3Adapter)
def test_allows_sqlite3_rollback_on_invalid_column_type
Person.connection.create_table :something, force: true do |t|
t.column :number, :integer
t.column :name, :string
t.column :foo, :bar
end
assert Person.connection.column_exists?(:something, :foo)
assert_nothing_raised { Person.connection.remove_column :something, :foo, :bar }
assert !Person.connection.column_exists?(:something, :foo)
assert Person.connection.column_exists?(:something, :name)
assert Person.connection.column_exists?(:something, :number)
ensure
Person.connection.drop_table :something, if_exists: true
end
end
2016-08-17 20:21:54 -04:00
|
|
|
* Sqlite3 migrations to add a column to an existing table can now be
|
|
|
|
successfully rolled back when the column was given and invalid column
|
|
|
|
type.
|
|
|
|
|
2016-12-09 14:41:42 -05:00
|
|
|
Fixes #26087.
|
Added nil case handling to allow rollback migration in case of
invalid column type
/activerecord/lib/active_record/connection_adapters
/abstract/schema_definitions.rb:306
type = type.to_sym
Changed to the following to handle nil case:
type = type.to_sym if type
Added regression test for this case:
/activerecord/test/cases/migration_test.rb:554
if current_adapter?(:SQLite3Adapter)
def test_allows_sqlite3_rollback_on_invalid_column_type
Person.connection.create_table :something, force: true do |t|
t.column :number, :integer
t.column :name, :string
t.column :foo, :bar
end
assert Person.connection.column_exists?(:something, :foo)
assert_nothing_raised { Person.connection.remove_column :something, :foo, :bar }
assert !Person.connection.column_exists?(:something, :foo)
assert Person.connection.column_exists?(:something, :name)
assert Person.connection.column_exists?(:something, :number)
ensure
Person.connection.drop_table :something, if_exists: true
end
end
2016-08-17 20:21:54 -04:00
|
|
|
|
|
|
|
*Travis O'Neill*
|
|
|
|
|
2016-07-31 00:11:30 -04:00
|
|
|
* Deprecate `sanitize_conditions`. Use `sanitize_sql` instead.
|
|
|
|
|
|
|
|
*Ryuta Kamizono*
|
|
|
|
|
2016-08-10 17:27:32 -04:00
|
|
|
* Doing count on relations that contain LEFT OUTER JOIN Arel node no longer
|
|
|
|
force a DISTINCT. This solves issues when using count after a left_joins.
|
|
|
|
|
|
|
|
*Maxime Handfield Lapointe*
|
|
|
|
|
2016-07-30 09:19:30 -04:00
|
|
|
* RecordNotFound raised by association.find exposes `id`, `primary_key` and
|
|
|
|
`model` methods to be consistent with RecordNotFound raised by Record.find.
|
|
|
|
|
|
|
|
*Michel Pigassou*
|
|
|
|
|
Don't assume all hashes are from multiparameter assignment in `composed_of`
So this bug is kinda funky. The code path is basically "if we weren't passed an
instance of the class we compose to, and we have a converter, call that".
Ignoring the hash case for a moment, everything after that was roughly intended
to be the "else" clause, meaning that we are expected to have an instance of
the class we compose to. Really, we should be blowing up in that case, as we
can give a much better error message than what they user will likely get (e.g.
`NameError: No method first for String` or something). Still, Ruby is duck
typed, so if the object you're assigning responds to the same methods as the
type you compose to, knock yourself out.
The hash case was added in 36e9be8 to remove a bunch of special cased code from
multiparameter assignment. I wrongly assumed that the only time we'd get a hash
there is in that case. Multiparameter assignment will construct a very specific
hash though, where the keys are integers, and we will have a set of keys
covering `1..part.size` exactly. I'm pretty sure this could actually be passed
around as an array, but that's a different story. Really I should convert this
to something like `class MultiParameterAssignment < Hash; end`, which I might
do soon. However for a change that I'm willing to backport to 4-2-stable, this
is what I want to go with for the time being.
Fixes #25978
2016-08-05 09:39:46 -04:00
|
|
|
* Hashes can once again be passed to setters of `composed_of`, if all of the
|
|
|
|
mapping methods are methods implemented on `Hash`.
|
|
|
|
|
|
|
|
Fixes #25978.
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2016-07-27 22:19:08 -04:00
|
|
|
* Fix the SELECT statement in `#table_comment` for MySQL.
|
|
|
|
|
|
|
|
*Takeshi Akima*
|
|
|
|
|
2016-07-25 11:13:01 -04:00
|
|
|
* Virtual attributes will no longer raise when read on models loaded from the
|
2016-12-09 14:41:42 -05:00
|
|
|
database.
|
2016-07-25 11:13:01 -04:00
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2016-07-14 12:12:53 -04:00
|
|
|
* Support calling the method `merge` in `scope`'s lambda.
|
|
|
|
|
|
|
|
*Yasuhiro Sugino*
|
|
|
|
|
2016-07-14 15:12:11 -04:00
|
|
|
* Fixes multi-parameter attributes conversion with invalid params.
|
|
|
|
|
|
|
|
*Hiroyuki Ishii*
|
|
|
|
|
2016-07-10 12:43:12 -04:00
|
|
|
* Add newline between each migration in `structure.sql`.
|
2016-07-13 11:44:37 -04:00
|
|
|
|
|
|
|
Keeps schema migration inserts as a single commit, but allows for easier
|
2016-07-10 12:43:12 -04:00
|
|
|
git diffing.
|
|
|
|
|
|
|
|
Fixes #25504.
|
2016-07-13 11:44:37 -04:00
|
|
|
|
|
|
|
*Grey Baker*, *Norberto Lopes*
|
|
|
|
|
2016-07-13 12:21:41 -04:00
|
|
|
* The flag `error_on_ignored_order_or_limit` has been deprecated in favor of
|
|
|
|
the current `error_on_ignored_order`.
|
|
|
|
|
|
|
|
*Xavier Noria*
|
|
|
|
|
|
|
|
* Batch processing methods support `limit`:
|
|
|
|
|
|
|
|
Post.limit(10_000).find_each do |post|
|
|
|
|
# ...
|
|
|
|
end
|
|
|
|
|
|
|
|
It also works in `find_in_batches` and `in_batches`.
|
|
|
|
|
|
|
|
*Xavier Noria*
|
|
|
|
|
2016-07-11 10:43:02 -04:00
|
|
|
* Using `group` with an attribute that has a custom type will properly cast
|
Added nil case handling to allow rollback migration in case of
invalid column type
/activerecord/lib/active_record/connection_adapters
/abstract/schema_definitions.rb:306
type = type.to_sym
Changed to the following to handle nil case:
type = type.to_sym if type
Added regression test for this case:
/activerecord/test/cases/migration_test.rb:554
if current_adapter?(:SQLite3Adapter)
def test_allows_sqlite3_rollback_on_invalid_column_type
Person.connection.create_table :something, force: true do |t|
t.column :number, :integer
t.column :name, :string
t.column :foo, :bar
end
assert Person.connection.column_exists?(:something, :foo)
assert_nothing_raised { Person.connection.remove_column :something, :foo, :bar }
assert !Person.connection.column_exists?(:something, :foo)
assert Person.connection.column_exists?(:something, :name)
assert Person.connection.column_exists?(:something, :number)
ensure
Person.connection.drop_table :something, if_exists: true
end
end
2016-08-17 20:21:54 -04:00
|
|
|
the hash keys after calling a calculation method like `count`.
|
|
|
|
|
2016-08-10 00:02:22 -04:00
|
|
|
Fixes #25595.
|
2016-07-11 10:43:02 -04:00
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2016-07-09 08:21:31 -04:00
|
|
|
* Fix the generated `#to_param` method to use `omission: ''` so that
|
2016-02-11 14:22:09 -05:00
|
|
|
the resulting output is actually up to 20 characters, not
|
|
|
|
effectively 17 to leave room for the default "...".
|
|
|
|
Also call `#parameterize` before `#truncate` and make the
|
|
|
|
`separator: /-/` to maximize the information included in the
|
|
|
|
output.
|
|
|
|
|
2016-07-09 08:21:31 -04:00
|
|
|
Fixes #23635.
|
2016-02-11 14:22:09 -05:00
|
|
|
|
|
|
|
*Rob Biedenharn*
|
|
|
|
|
2016-07-05 19:07:26 -04:00
|
|
|
* Ensure concurrent invocations of the connection reaper cannot allocate the
|
|
|
|
same connection to two threads.
|
|
|
|
|
|
|
|
Fixes #25585.
|
|
|
|
|
|
|
|
*Matthew Draper*
|
|
|
|
|
2016-06-28 14:54:17 -04:00
|
|
|
* Inspecting an object with an associated array of over 10 elements no longer
|
|
|
|
truncates the array, preventing `inspect` from looping infinitely in some
|
|
|
|
cases.
|
|
|
|
|
|
|
|
*Kevin McPhillips*
|
|
|
|
|
2016-06-29 09:46:45 -04:00
|
|
|
* Removed the unused methods `ActiveRecord::Base.connection_id` and
|
2016-07-09 08:21:31 -04:00
|
|
|
`ActiveRecord::Base.connection_id=`.
|
2016-06-29 09:46:45 -04:00
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2016-05-31 09:56:19 -04:00
|
|
|
* Ensure hashes can be assigned to attributes created using `composed_of`.
|
Added nil case handling to allow rollback migration in case of
invalid column type
/activerecord/lib/active_record/connection_adapters
/abstract/schema_definitions.rb:306
type = type.to_sym
Changed to the following to handle nil case:
type = type.to_sym if type
Added regression test for this case:
/activerecord/test/cases/migration_test.rb:554
if current_adapter?(:SQLite3Adapter)
def test_allows_sqlite3_rollback_on_invalid_column_type
Person.connection.create_table :something, force: true do |t|
t.column :number, :integer
t.column :name, :string
t.column :foo, :bar
end
assert Person.connection.column_exists?(:something, :foo)
assert_nothing_raised { Person.connection.remove_column :something, :foo, :bar }
assert !Person.connection.column_exists?(:something, :foo)
assert Person.connection.column_exists?(:something, :name)
assert Person.connection.column_exists?(:something, :number)
ensure
Person.connection.drop_table :something, if_exists: true
end
end
2016-08-17 20:21:54 -04:00
|
|
|
|
2016-05-31 09:56:19 -04:00
|
|
|
Fixes #25210.
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2016-05-21 08:51:36 -04:00
|
|
|
* Fix logging edge case where if an attribute was of the binary type and
|
|
|
|
was provided as a Hash.
|
2016-05-21 08:55:06 -04:00
|
|
|
|
2016-05-21 08:51:36 -04:00
|
|
|
*Jon Moss*
|
|
|
|
|
2016-02-22 11:36:08 -05:00
|
|
|
* Handle JSON deserialization correctly if the column default from database
|
|
|
|
adapter returns `''` instead of `nil`.
|
|
|
|
|
|
|
|
*Johannes Opper*
|
2016-05-06 17:54:40 -04:00
|
|
|
|
2016-07-09 08:21:31 -04:00
|
|
|
* Introduce `ActiveRecord::TransactionSerializationError` for catching
|
2016-05-21 07:25:01 -04:00
|
|
|
transaction serialization failures or deadlocks.
|
|
|
|
|
|
|
|
*Erol Fornoles*
|
|
|
|
|
2016-08-10 00:02:22 -04:00
|
|
|
* PostgreSQL: Fix `db:structure:load` silent failure on SQL error.
|
2016-05-10 13:44:33 -04:00
|
|
|
|
2016-07-09 08:21:31 -04:00
|
|
|
The command line flag `-v ON_ERROR_STOP=1` should be used
|
|
|
|
when invoking `psql` to make sure errors are not suppressed.
|
2016-05-10 13:44:33 -04:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
psql -v ON_ERROR_STOP=1 -q -f awesome-file.sql my-app-db
|
|
|
|
|
|
|
|
Fixes #23818.
|
|
|
|
|
|
|
|
*Ralin Chimev*
|
|
|
|
|
|
|
|
|
2016-05-10 00:07:09 -04:00
|
|
|
Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/activerecord/CHANGELOG.md) for previous changes.
|