2014-04-03 21:07:03 -04:00
|
|
|
* The comparison between `Relation` and `CollectionProxy` should be consistent.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
author.posts == Post.where(author_id: author.id)
|
|
|
|
# => true
|
|
|
|
Post.where(author_id: author.id) == author.posts
|
|
|
|
# => true
|
|
|
|
|
|
|
|
Fixes #13506.
|
|
|
|
|
|
|
|
*Lauro Caetano*
|
|
|
|
|
2014-04-13 05:13:19 -04:00
|
|
|
* Calling `delete_all` on an unloaded `CollectionProxy` no longer
|
|
|
|
generates a SQL statement containing each id of the collection:
|
|
|
|
|
|
|
|
Before:
|
|
|
|
|
|
|
|
DELETE FROM `model` WHERE `model`.`parent_id` = 1
|
|
|
|
AND `model`.`id` IN (1, 2, 3...)
|
|
|
|
|
|
|
|
After:
|
|
|
|
|
|
|
|
DELETE FROM `model` WHERE `model`.`parent_id` = 1
|
|
|
|
|
|
|
|
*Eileen M. Uchitelle*, *Aaron Patterson*
|
|
|
|
|
2014-04-11 14:46:20 -04:00
|
|
|
* Fixed error for aggregate methods (`empty?`, `any?`, `count`) with `select`
|
|
|
|
which created invalid SQL.
|
|
|
|
|
|
|
|
Fixes #13648.
|
|
|
|
|
|
|
|
*Simon Woker*
|
|
|
|
|
2014-04-10 14:39:21 -04:00
|
|
|
* PostgreSQL adapter only warns once for every missing OID per connection.
|
|
|
|
|
|
|
|
Fixes #14275.
|
|
|
|
|
|
|
|
*Matthew Draper*, *Yves Senn*
|
|
|
|
|
2014-04-10 14:25:40 -04:00
|
|
|
* PostgreSQL adapter automatically reloads it's type map when encountering
|
|
|
|
unknown OIDs.
|
|
|
|
|
|
|
|
Fixes #14678.
|
|
|
|
|
|
|
|
*Matthew Draper*, *Yves Senn*
|
|
|
|
|
2014-04-10 16:43:59 -04:00
|
|
|
* Fix insertion of records via `has_many :through` association with scope.
|
2013-11-10 00:28:54 -05:00
|
|
|
|
2014-04-10 16:43:59 -04:00
|
|
|
Fixes #3548.
|
2013-11-10 00:28:54 -05:00
|
|
|
|
|
|
|
*Ivan Antropov*
|
|
|
|
|
2013-08-25 05:22:36 -04:00
|
|
|
* Auto-generate stable fixture UUIDs on PostgreSQL.
|
|
|
|
|
|
|
|
Fixes: #11524
|
|
|
|
|
|
|
|
*Roderick van Domburg*
|
|
|
|
|
2014-04-07 10:01:03 -04:00
|
|
|
* Fixed a problem where an enum would overwrite values of another enum
|
|
|
|
with the same name in an unrelated class.
|
|
|
|
|
|
|
|
Fixes #14607.
|
|
|
|
|
|
|
|
*Evan Whalen*
|
|
|
|
|
2014-04-03 08:59:53 -04:00
|
|
|
* PostgreSQL and SQLite string columns no longer have a default limit of 255.
|
|
|
|
|
|
|
|
Fixes #13435, #9153.
|
|
|
|
|
|
|
|
*Vladimir Sazhin*, *Toms Mikoss*, *Yves Senn*
|
|
|
|
|
2014-04-04 17:41:43 -04:00
|
|
|
* Make possible to have an association called `records`.
|
|
|
|
|
|
|
|
Fixes #11645.
|
|
|
|
|
|
|
|
*prathamesh-sonpatki*
|
|
|
|
|
2014-04-01 23:18:16 -04:00
|
|
|
* `to_sql` on an association now matches the query that is actually executed, where it
|
|
|
|
could previously have incorrectly accrued additional conditions (e.g. as a result of
|
|
|
|
a previous query). CollectionProxy now always defers to the association scope's
|
|
|
|
`arel` method so the (incorrect) inherited one should be entirely concealed.
|
|
|
|
|
|
|
|
Fixes #14003.
|
|
|
|
|
|
|
|
*Jefferson Lai*
|
|
|
|
|
2014-04-03 10:39:05 -04:00
|
|
|
* Block a few default Class methods as scope name.
|
|
|
|
|
|
|
|
For instance, this will raise:
|
|
|
|
|
|
|
|
scope :public, -> { where(status: 1) }
|
|
|
|
|
|
|
|
*arthurnn*
|
|
|
|
|
2014-04-02 18:27:55 -04:00
|
|
|
* Fixed error when using `with_options` with lambda.
|
|
|
|
|
|
|
|
Fixes #9805.
|
|
|
|
|
|
|
|
*Lauro Caetano*
|
|
|
|
|
2014-04-03 10:12:06 -04:00
|
|
|
* Switch `sqlite3:///` URLs (which were temporarily
|
2014-04-02 11:11:34 -04:00
|
|
|
deprecated in 4.1) from relative to absolute.
|
|
|
|
|
|
|
|
If you still want the previous interpretation, you should replace
|
|
|
|
`sqlite3:///my/path` with `sqlite3:my/path`.
|
|
|
|
|
|
|
|
*Matthew Draper*
|
|
|
|
|
2014-03-27 08:29:20 -04:00
|
|
|
* Treat blank UUID values as `nil`.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
Sample.new(uuid_field: '') #=> <Sample id: nil, uuid_field: nil>
|
|
|
|
|
|
|
|
*Dmitry Lavrov*
|
|
|
|
|
2013-11-30 18:01:34 -05:00
|
|
|
* Enable support for materialized views on PostgreSQL >= 9.3.
|
|
|
|
|
|
|
|
*Dave Lee*
|
|
|
|
|
2014-04-01 13:42:22 -04:00
|
|
|
* The PostgreSQL adapter supports custom domains. Fixes #14305.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-03-26 12:14:05 -04:00
|
|
|
* PostgreSQL `Column#type` is now determined through the corresponding OID.
|
|
|
|
The column types stay the same except for enum columns. They no longer have
|
|
|
|
`nil` as type but `enum`.
|
|
|
|
|
|
|
|
See #7814.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-03-30 12:10:41 -04:00
|
|
|
* Fixed error when specifying a non-empty default value on a PostgreSQL array column.
|
|
|
|
|
|
|
|
Fixes #10613.
|
|
|
|
|
|
|
|
*Luke Steensen*
|
|
|
|
|
2014-03-27 17:10:17 -04:00
|
|
|
* Make possible to change `record_timestamps` inside Callbacks.
|
|
|
|
|
|
|
|
*Tieg Zaharia*
|
|
|
|
|
2014-03-15 06:32:24 -04:00
|
|
|
* Fixed error where .persisted? throws SystemStackError for an unsaved model with a
|
|
|
|
custom primary key that didn't save due to validation error.
|
|
|
|
|
|
|
|
Fixes #14393.
|
|
|
|
|
|
|
|
*Chris Finne*
|
|
|
|
|
2014-03-23 07:09:55 -04:00
|
|
|
* Introduce `validate` as an alias for `valid?`.
|
|
|
|
|
|
|
|
This is more intuitive when you want to run validations but don't care about the return value.
|
|
|
|
|
|
|
|
*Henrik Nyh*
|
|
|
|
|
2014-03-26 19:31:32 -04:00
|
|
|
* Create indexes inline in CREATE TABLE for MySQL.
|
2014-03-26 00:13:29 -04:00
|
|
|
|
|
|
|
This is important, because adding an index on a temporary table after it has been created
|
|
|
|
would commit the transaction.
|
2014-03-26 19:31:32 -04:00
|
|
|
|
|
|
|
It also allows creating and dropping indexed tables with fewer queries and fewer permissions
|
|
|
|
required.
|
2014-03-26 00:13:29 -04:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
create_table :temp, temporary: true, as: "SELECT id, name, zip FROM a_really_complicated_query" do |t|
|
|
|
|
t.index :zip
|
|
|
|
end
|
|
|
|
# => CREATE TEMPORARY TABLE temp (INDEX (zip)) AS SELECT id, name, zip FROM a_really_complicated_query
|
|
|
|
|
2014-03-26 19:31:32 -04:00
|
|
|
*Cody Cutrer*, *Steve Rice*, *Rafael Mendonça Franca*
|
2014-03-26 00:13:29 -04:00
|
|
|
|
2014-03-25 14:09:48 -04:00
|
|
|
* Save `has_one` association even if the record doesn't changed.
|
|
|
|
|
|
|
|
Fixes #14407.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2014-03-25 11:07:52 -04:00
|
|
|
* Use singular table name in generated migrations when
|
|
|
|
`ActiveRecord::Base.pluralize_table_names` is `false`.
|
2014-03-25 10:57:37 -04:00
|
|
|
|
|
|
|
Fixes #13426.
|
|
|
|
|
|
|
|
*Kuldeep Aggarwal*
|
|
|
|
|
2014-03-20 07:08:22 -04:00
|
|
|
* `touch` accepts many attributes to be touched at once.
|
2014-03-19 21:13:03 -04:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
2014-03-20 07:08:22 -04:00
|
|
|
# touches :signed_at, :sealed_at, and :updated_at/on attributes.
|
|
|
|
Photo.last.touch(:signed_at, :sealed_at)
|
2014-03-20 07:00:28 -04:00
|
|
|
|
2014-03-19 21:13:03 -04:00
|
|
|
*James Pinto*
|
|
|
|
|
2014-03-20 05:30:30 -04:00
|
|
|
* `rake db:structure:dump` only dumps schema information if the schema
|
|
|
|
migration table exists.
|
|
|
|
|
|
|
|
Fixes #14217.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-03-07 08:36:09 -05:00
|
|
|
* Reap connections that were checked out by now-dead threads, instead
|
|
|
|
of waiting until they disconnect by themselves. Before this change,
|
|
|
|
a suitably constructed series of short-lived threads could starve
|
|
|
|
the connection pool, without ever having more than a couple alive at
|
|
|
|
the same time.
|
|
|
|
|
|
|
|
*Matthew Draper*
|
|
|
|
|
2013-11-19 15:50:14 -05:00
|
|
|
* `pk_and_sequence_for` now ensures that only the pg_depend entries
|
|
|
|
pointing to pg_class, and thus only sequence objects, are considered.
|
|
|
|
|
|
|
|
*Josh Williams*
|
|
|
|
|
2014-03-17 09:20:23 -04:00
|
|
|
* `where.not` adds `references` for `includes` like normal `where` calls do.
|
|
|
|
|
|
|
|
Fixes #14406.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-03-17 03:44:56 -04:00
|
|
|
* Extend fixture `$LABEL` replacement to allow string interpolation.
|
|
|
|
|
2014-03-15 21:49:04 -04:00
|
|
|
Example:
|
|
|
|
|
|
|
|
martin:
|
|
|
|
email: $LABEL@email.com
|
|
|
|
|
|
|
|
users(:martin).email # => martin@email.com
|
|
|
|
|
|
|
|
*Eric Steele*
|
2014-03-17 03:44:56 -04:00
|
|
|
|
2014-03-13 13:05:10 -04:00
|
|
|
* Add support for `Relation` be passed as parameter on `QueryCache#select_all`.
|
|
|
|
|
|
|
|
Fixes #14361.
|
|
|
|
|
|
|
|
*arthurnn*
|
|
|
|
|
2014-03-17 03:44:56 -04:00
|
|
|
* Passing an Active Record object to `find` is now deprecated. Call `.id`
|
|
|
|
on the object first.
|
2014-03-13 14:47:12 -04:00
|
|
|
|
2014-03-17 03:44:56 -04:00
|
|
|
* Passing an Active Record object to `find` or `exists?` is now deprecated.
|
|
|
|
Call `.id` on the object first.
|
2014-03-13 14:40:35 -04:00
|
|
|
|
2014-03-17 03:44:56 -04:00
|
|
|
* Only use BINARY for MySQL case sensitive uniqueness check when column has a case insensitive collation.
|
2013-11-25 14:59:18 -05:00
|
|
|
|
|
|
|
*Ryuta Kamizono*
|
|
|
|
|
2014-03-17 03:44:56 -04:00
|
|
|
* Support for MySQL 5.6 fractional seconds.
|
2014-03-12 09:15:46 -04:00
|
|
|
|
|
|
|
*arthurnn*, *Tatsuhiko Miyagawa*
|
|
|
|
|
2014-03-10 17:10:25 -04:00
|
|
|
* Support for Postgres `citext` data type enabling case-insensitive where
|
|
|
|
values without needing to wrap in UPPER/LOWER sql functions.
|
|
|
|
|
|
|
|
*Troy Kruthoff*, *Lachlan Sylvester*
|
|
|
|
|
2014-03-05 08:00:23 -05:00
|
|
|
* Allow strings to specify the `#order` value.
|
2013-05-22 23:17:15 -04:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
Model.order(id: 'asc').to_sql == Model.order(id: :asc).to_sql
|
|
|
|
|
2014-03-05 03:07:12 -05:00
|
|
|
*Marcelo Casiraghi*, *Robin Dupret*
|
2013-05-22 23:17:15 -04:00
|
|
|
|
2013-12-09 12:52:36 -05:00
|
|
|
* Dynamically register PostgreSQL enum OIDs. This prevents "unknown OID"
|
|
|
|
warnings on enum columns.
|
|
|
|
|
|
|
|
*Dieter Komendera*
|
|
|
|
|
2014-02-28 03:49:52 -05:00
|
|
|
* `includes` is able to detect the right preloading strategy when string
|
|
|
|
joins are involved.
|
|
|
|
|
|
|
|
Fixes #14109.
|
|
|
|
|
|
|
|
*Aaron Patterson*, *Yves Senn*
|
|
|
|
|
2014-02-25 20:24:44 -05:00
|
|
|
* Fixed error with validation with enum fields for records where the
|
|
|
|
value for any enum attribute is always evaluated as 0 during
|
|
|
|
uniqueness validation.
|
|
|
|
|
2014-03-05 03:07:12 -05:00
|
|
|
Fixes #14172.
|
2014-02-25 20:24:44 -05:00
|
|
|
|
|
|
|
*Vilius Luneckas* *Ahmed AbouElhamayed*
|
|
|
|
|
2014-03-05 03:07:12 -05:00
|
|
|
* `before_add` callbacks are fired before the record is saved on
|
|
|
|
`has_and_belongs_to_many` assocations *and* on `has_many :through`
|
|
|
|
associations. Before this change, `before_add` callbacks would be fired
|
|
|
|
before the record was saved on `has_and_belongs_to_many` associations, but
|
|
|
|
*not* on `has_many :through` associations.
|
2014-02-25 17:57:06 -05:00
|
|
|
|
2014-03-05 03:07:12 -05:00
|
|
|
Fixes #14144.
|
2014-02-25 17:57:06 -05:00
|
|
|
|
2014-02-13 14:49:19 -05:00
|
|
|
* Fixed STI classes not defining an attribute method if there is a
|
|
|
|
conflicting private method defined on its ancestors.
|
|
|
|
|
|
|
|
Fixes #11569.
|
|
|
|
|
|
|
|
*Godfrey Chan*
|
|
|
|
|
2014-03-05 03:07:12 -05:00
|
|
|
* Coerce strings when reading attributes. Fixes #10485.
|
2013-08-07 12:56:49 -04:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
book = Book.new(title: 12345)
|
|
|
|
book.save!
|
|
|
|
book.title # => "12345"
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-01-22 08:20:01 -05:00
|
|
|
* Deprecate half-baked support for PostgreSQL range values with excluding beginnings.
|
|
|
|
We currently map PostgreSQL ranges to Ruby ranges. This conversion is not fully
|
|
|
|
possible because the Ruby range does not support excluded beginnings.
|
|
|
|
|
|
|
|
The current solution of incrementing the beginning is not correct and is now
|
|
|
|
deprecated. For subtypes where we don't know how to increment (e.g. `#succ`
|
|
|
|
is not defined) it will raise an ArgumentException for ranges with excluding
|
|
|
|
beginnings.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-01-21 06:14:11 -05:00
|
|
|
* Support for user created range types in PostgreSQL.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-02-25 07:14:35 -05:00
|
|
|
Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/activerecord/CHANGELOG.md) for previous changes.
|