Calling update_attributes will now throw an ArgumentError whenever it
gets a nil argument. More specifically, it will throw an error if the
argument that it gets passed does not respond to to stringify_keys.

Example:

@my_comment.update_attributes(nil) # => raises ArgumentError

John Wang

Deprecate quoted_locking_column method, which isn't used anywhere.

kennyj

Migration dump UUID default functions to schema.rb.

Fixes #10751.

kennyj

Fixed a bug in ActiveRecord::Associations::CollectionAssociation#find_by_scan
when using has_many association with :inverse_of option and UUID primary key.

Fixes #10450.

kennyj

ActiveRecord::Base#<=> has been removed. Primary keys may not be in order,
or even be numbers, so sorting by id doesn't make sense. Please use sort_by
and specify the attribute you wish to sort with. For example, change:

Post.all.to_a.sort

to:

Post.all.to_a.sort_by(&:id)

Aaron Patterson

Fix: joins association, with defined in the scope block constraints by using several
where constraints and at least of them is not Arel::Nodes::Equality,
generates invalid SQL expression.

Fixes #11963.

Paul Nikitochkin

Deprecate the delegation of Array bang methods for associations.
To use them, instead first call #to_a on the association to access the
array to be acted on.

Ben Woosley

CollectionAssociation#first/#last (e.g. has_many) use a LIMITed
query to fetch results rather than loading the entire collection.

Lann Martin

Make possible to run SQLite rake tasks without the Rails constant defined.

Damien Mathieu

Allow Relation#from to accept other relations with bind values.

Ryan Wallace

Fix inserts with prepared statements disabled.

Fixes #12023.

Rafael Mendonça França

Setting a has_one association on a new record no longer causes an empty
transaction.

Some adapters require column information to do their job properly.
By enforcing the provision of the column for this internal method
we ensure that those using adapters that require column information
will always get the proper behavior.

Ben Woosley

When using optimistic locking, update was not passing the column to quote_value
to allow the connection adapter to properly determine how to quote the value. This was
affecting certain databases that use specific column types.

Fixes #6763.

Alfred Wong

rescue from all exceptions in ConnectionManagement#call

Fixes #11497.

As ActiveRecord::ConnectionAdapters::ConnectionManagement middleware does
not rescue from Exception (but only from StandardError), the Connection
Pool quickly runs out of connections when multiple erroneous Requests come
in right after each other.

Rescuing from all exceptions and not just StandardError, fixes this
behaviour.

Vipul A M

change_column for PostgreSQL adapter respects the :array option.

Yves Senn

Remove deprecation warning from attribute_missing for attributes that are columns.

Arun Agrawal

Remove extra decrement of transaction deep level.

Fixes #4566.

Paul Nikitochkin

Reset @column_defaults when assigning locking_column.
We had a potential problem. For example:

Move deprecated ActiveRecord::TestCase into the rails test
suite. The class is no longer public and is only used for internal
Rails tests.

Yves Senn

Removed support for deprecated option :restrict for :dependent
in associations.

Neeraj Singh

Removed support for deprecated delete_sql in associations.

Neeraj Singh

Removed support for deprecated insert_sql in associations.

Neeraj Singh

Removed support for deprecated finder_sql in associations.

Neeraj Singh

Support array as root element in JSON fields.

Alexey Noskov & Francesco Rodriguez

Removed support for deprecated counter_sql in associations.

Neeraj Singh

Do not invoke callbacks when delete_all is called on collection.

Method delete_all should not be invoking callbacks and this
feature was deprecated in Rails 4.0. This is being removed.
delete_all will continue to honor the :dependent option. However
if :dependent value is :destroy then the default deletion
strategy for that collection will be applied.

User can also force a deletion strategy by passing parameter to
delete_all. For example you can do @post.comments.delete_all(:nullify) .

Remove column restrictions for count, let the database raise if the SQL is
invalid. The previous behavior was untested and surprising for the user.
Fixes #5554.

Example:

User.select("name, username").count
# Before => SELECT count(*) FROM users
# After => ActiveRecord::StatementInvalid
# you can still use `count(:all)` to perform a query unrelated to the
# selected columns
User.select("name, username").count(:all) # => SELECT count(*) FROM users

Yves Senn

Rails now automatically detects inverse associations. If you do not set the
:inverse_of option on the association, then Active Record will guess the
inverse association based on heuristics.

Note that automatic inverse detection only works on has_many, has_one,
and belongs_to associations. Extra options on the associations will
also prevent the association's inverse from being found automatically.

The automatic guessing of the inverse association uses a heuristic based
on the name of the class, so it may not work for all associations,
especially the ones with non-standard names.

You can turn off the automatic detection of inverse associations by setting
the :inverse_of option to false like so:

Fix bug where tiny types are incorrectly coerced as boolean when the length is more than 1.

Fixes #10620.

Aaron Patterson

Also support extensions in PostgreSQL 9.1. This feature has been supported since 9.1.

kennyj

Deprecate ConnectionAdapters::SchemaStatements#distinct,
as it is no longer used by internals.

Ben Woosley

Fix pending migrations error when loading schema and ActiveRecord::Base.table_name_prefix
is not blank.

Call assume_migrated_upto_version on connection to prevent it from first
being picked up in method_missing.

In the base class, Migration, method_missing expects the argument to be a
table name, and calls proper_table_name on the arguments before sending to
connection. If table_name_prefix or table_name_suffix is used, the schema
version changes to prefix_version_suffix, breaking rake test:prepare.

Fixes #10411.

Kyle Stevens

Method read_attribute_before_type_cast should accept input as symbol.

Neeraj Singh

Confirm a record has not already been destroyed before decrementing counter cache.

Ben Tucker

Fixed a bug in ActiveRecord#sanitize_sql_hash_for_conditions in which
self.class is an argument to PredicateBuilder#build_from_hash
causing PredicateBuilder to call non-existent method
Class#reflect_on_association.

Zach Ohlgren

While removing index if column option is missing then raise IrreversibleMigration exception.

Following code should raise IrreversibleMigration. But the code was
failing since options is an array and not a hash.

fixes bug introduced by #3329. Now, when autosaving associations,
deletions happen before inserts and saves. This prevents a 'duplicate
unique value' database error that would occur if a record being created had
the same value on a unique indexed field as that of a record being destroyed.

Johnny Holton

Handle aliased attributes in ActiveRecord::Relation.

When using symbol keys, ActiveRecord will now translate aliased attribute names to the actual column name used in the database:

With the model

class Topic
alias_attribute :heading, :title
end

The call

Topic.where(heading: 'The First Topic')

should yield the same result as

Topic.where(title: 'The First Topic')

This also applies to ActiveRecord::Relation::Calculations calls such as Model.sum(:aliased) and Model.pluck(:aliased).

This will not work with SQL fragment strings like Model.sum('DISTINCT aliased').

Godfrey Chan

Mute psql output when running rake db:schema:load.

Godfrey Chan

Trigger a save on has_one association=(associate) when the associate contents have changed.

Fix #8856.

Chris Thompson

Abort a rake task when missing db/structure.sql like db:schema:load task.

kennyj

rake:db:test:prepare falls back to original environment after execution.