2014-07-25 05:16:20 -04:00
|
|
|
* Add support for Postgresql JSONB.
|
2014-07-24 13:39:39 -04:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
create_table :posts do |t|
|
|
|
|
t.jsonb :meta_data
|
|
|
|
end
|
|
|
|
|
|
|
|
*Philippe Creux*, *Chris Teague*
|
|
|
|
|
2014-07-24 10:38:41 -04:00
|
|
|
* `db:purge` with MySQL respects `Rails.env`.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-07-24 08:27:41 -04:00
|
|
|
* `change_column_default :table, :column, nil` with PostgreSQL will issue a
|
|
|
|
`DROP DEFAULT` instead of a `DEFAULT NULL` query.
|
|
|
|
|
|
|
|
Fixes #16261.
|
|
|
|
|
|
|
|
*Matthew Draper*, *Yves Senn*
|
|
|
|
|
2014-07-22 09:04:29 -04:00
|
|
|
* Allow to specify a type for the foreign key column in `references`
|
|
|
|
and `add_reference`.
|
2014-07-19 15:38:38 -04:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
change_table :vehicle do |t|
|
|
|
|
t.references :station, type: :uuid
|
|
|
|
end
|
|
|
|
|
2014-07-22 09:04:29 -04:00
|
|
|
*Andrey Novikov*, *Łukasz Sarnacki*
|
2014-07-19 15:38:38 -04:00
|
|
|
|
2014-07-18 12:46:53 -04:00
|
|
|
* `create_join_table` removes a common prefix when generating the join table.
|
|
|
|
This matches the existing behavior of HABTM associations.
|
|
|
|
|
|
|
|
Fixes #13683.
|
|
|
|
|
|
|
|
*Stefan Kanev*
|
|
|
|
|
2014-06-16 18:25:09 -04:00
|
|
|
* Dont swallow errors on compute_type when having a bad alias_method on
|
|
|
|
a class.
|
|
|
|
|
|
|
|
*arthurnn*
|
|
|
|
|
2014-05-29 03:45:56 -04:00
|
|
|
* PostgreSQL invalid `uuid` are convert to nil.
|
|
|
|
|
|
|
|
*Abdelkader Boudih*
|
2014-07-16 14:51:47 -04:00
|
|
|
|
2014-07-15 11:43:18 -04:00
|
|
|
* Restore 4.0 behavior for using serialize attributes with `JSON` as coder.
|
|
|
|
|
|
|
|
With 4.1.x, `serialize` started returning a string when `JSON` was passed as
|
|
|
|
the second attribute. It will now return a hash as per previous versions.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
class Post < ActiveRecord::Base
|
|
|
|
serialize :comment, JSON
|
|
|
|
end
|
|
|
|
|
|
|
|
class Comment
|
|
|
|
include ActiveModel::Model
|
|
|
|
attr_accessor :category, :text
|
|
|
|
end
|
|
|
|
|
|
|
|
post = Post.create!
|
|
|
|
post.comment = Comment.new(category: "Animals", text: "This is a comment about squirrels.")
|
|
|
|
post.save!
|
|
|
|
|
|
|
|
# 4.0
|
|
|
|
post.comment # => {"category"=>"Animals", "text"=>"This is a comment about squirrels."}
|
|
|
|
|
|
|
|
# 4.1 before
|
|
|
|
post.comment # => "#<Comment:0x007f80ab48ff98>"
|
|
|
|
|
|
|
|
# 4.1 after
|
|
|
|
post.comment # => {"category"=>"Animals", "text"=>"This is a comment about squirrels."}
|
|
|
|
|
|
|
|
When using `JSON` as the coder in `serialize`, Active Record will use the
|
|
|
|
new `ActiveRecord::Coders::JSON` coder which delegates its `dump/load` to
|
|
|
|
`ActiveSupport::JSON.encode/decode`. This ensures special objects are dumped
|
|
|
|
correctly using the `#as_json` hook.
|
|
|
|
|
|
|
|
To keep the previous behaviour, supply a custom coder instead
|
|
|
|
([example](https://gist.github.com/jenncoop/8c4142bbe59da77daa63)).
|
|
|
|
|
|
|
|
Fixes #15594.
|
|
|
|
|
|
|
|
*Jenn Cooper*
|
|
|
|
|
2014-06-27 10:04:18 -04:00
|
|
|
* Do not use `RENAME INDEX` syntax for MariaDB 10.0.
|
|
|
|
|
|
|
|
Fixes #15931.
|
|
|
|
|
|
|
|
*Jeff Browning*
|
|
|
|
|
2014-07-15 11:40:15 -04:00
|
|
|
* Calling `#empty?` on a `has_many` association would use the value from the
|
|
|
|
counter cache if one exists.
|
|
|
|
|
|
|
|
*David Verhasselt*
|
|
|
|
|
2014-07-10 13:00:46 -04:00
|
|
|
* Fix the schema dump generated for tables without constraints and with
|
|
|
|
primary key with default value of custom PostgreSQL function result.
|
|
|
|
|
2014-07-24 08:52:51 -04:00
|
|
|
Fixes #16111.
|
2014-07-10 13:00:46 -04:00
|
|
|
|
|
|
|
*Andrey Novikov*
|
|
|
|
|
2014-07-08 13:57:01 -04:00
|
|
|
* Fix the SQL generated when a `delete_all` is run on an association to not
|
|
|
|
produce an `IN` statements.
|
|
|
|
|
|
|
|
Before:
|
|
|
|
|
|
|
|
UPDATE "categorizations" SET "category_id" = NULL WHERE
|
|
|
|
"categorizations"."category_id" = 1 AND "categorizations"."id" IN (1, 2)
|
|
|
|
|
|
|
|
After:
|
|
|
|
|
|
|
|
UPDATE "categorizations" SET "category_id" = NULL WHERE
|
|
|
|
"categorizations"."category_id" = 1
|
|
|
|
|
|
|
|
*Eileen M. Uchitelle, Aaron Patterson*
|
|
|
|
|
2014-07-06 01:49:19 -04:00
|
|
|
* Avoid type casting boolean and ActiveSupport::Duration values to numeric
|
|
|
|
values for string columns. Otherwise, in some database, the string column
|
|
|
|
values will be coerced to a numeric allowing false or 0.seconds match any
|
|
|
|
string starting with a non-digit.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
App.where(apikey: false) # => SELECT * FROM users WHERE apikey = '0'
|
|
|
|
|
|
|
|
*Dylan Thacker-Smith*
|
|
|
|
|
2014-07-04 20:47:00 -04:00
|
|
|
* Add a `:required` option to singular associations, providing a nicer
|
|
|
|
API for presence validations on associations.
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2014-07-02 21:09:05 -04:00
|
|
|
* Fixed error in `reset_counters` when associations have `select` scope.
|
|
|
|
(Call to `count` generates invalid SQL.)
|
|
|
|
|
|
|
|
*Cade Truitt*
|
|
|
|
|
2014-07-04 10:45:04 -04:00
|
|
|
* After a successful `reload`, `new_record?` is always false.
|
|
|
|
|
|
|
|
Fixes #12101.
|
|
|
|
|
|
|
|
*Matthew Draper*
|
|
|
|
|
2014-06-27 17:28:55 -04:00
|
|
|
* PostgreSQL renaming table doesn't attempt to rename non existent sequences.
|
|
|
|
|
2014-06-27 04:46:07 -04:00
|
|
|
*Abdelkader Boudih*
|
2014-06-27 17:28:55 -04:00
|
|
|
|
2013-10-26 01:35:59 -04:00
|
|
|
* Move 'dependent: :destroy' handling for 'belongs_to'
|
|
|
|
from 'before_destroy' to 'after_destroy' callback chain
|
|
|
|
|
2014-07-24 08:52:51 -04:00
|
|
|
Fixes #12380.
|
2013-10-26 01:35:59 -04:00
|
|
|
|
|
|
|
*Ivan Antropov*
|
|
|
|
|
2014-06-27 14:14:47 -04:00
|
|
|
* Detect in-place modifications on String attributes.
|
|
|
|
|
|
|
|
Before this change user have to mark the attribute as changed to it be persisted
|
|
|
|
in the database. Now it is not required anymore.
|
|
|
|
|
|
|
|
Before:
|
|
|
|
|
|
|
|
user = User.first
|
|
|
|
user.name << ' Griffin'
|
|
|
|
user.name_will_change!
|
|
|
|
user.save
|
|
|
|
user.reload.name # => "Sean Griffin"
|
|
|
|
|
|
|
|
After:
|
|
|
|
|
|
|
|
user = User.first
|
|
|
|
user.name << ' Griffin'
|
|
|
|
user.save
|
|
|
|
user.reload.name # => "Sean Griffin"
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2014-06-27 13:49:43 -04:00
|
|
|
* Add `ActiveRecord::Base#validate!` that raises `RecordInvalid` if the record
|
|
|
|
is invalid.
|
|
|
|
|
|
|
|
*Bogdan Gusiev*, *Marc Schütz*
|
|
|
|
|
2014-06-12 02:42:00 -04:00
|
|
|
* Support for adding and removing foreign keys. Foreign keys are now
|
|
|
|
a part of `schema.rb`. This is supported by Mysql2Adapter, MysqlAdapter
|
|
|
|
and PostgreSQLAdapter.
|
|
|
|
|
2014-06-27 10:17:52 -04:00
|
|
|
Many thanks to *Matthew Higgins* for laying the foundation with his work on
|
|
|
|
[foreigner](https://github.com/matthuhiggins/foreigner).
|
|
|
|
|
2014-06-12 02:42:00 -04:00
|
|
|
Example:
|
|
|
|
|
|
|
|
# within your migrations:
|
|
|
|
add_foreign_key :articles, :authors
|
|
|
|
remove_foreign_key :articles, :authors
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-06-26 11:36:40 -04:00
|
|
|
* Fix subtle bugs regarding attribute assignment on models with no primary
|
|
|
|
key. `'id'` will no longer be part of the attributes hash.
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2014-06-15 11:19:54 -04:00
|
|
|
* Deprecate automatic counter caches on `has_many :through`. The behavior was
|
|
|
|
broken and inconsistent.
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2014-06-22 08:48:28 -04:00
|
|
|
* `preload` preserves readonly flag for associations.
|
|
|
|
|
|
|
|
See #15853.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-06-24 08:55:24 -04:00
|
|
|
* Assume numeric types have changed if they were assigned to a value that
|
|
|
|
would fail numericality validation, regardless of the old value. Previously
|
|
|
|
this would only occur if the old value was 0.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
model = Model.create!(number: 5)
|
|
|
|
model.number = '5wibble'
|
|
|
|
model.number_changed? # => true
|
|
|
|
|
|
|
|
Fixes #14731.
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2014-06-22 17:04:58 -04:00
|
|
|
* `reload` no longer merges with the existing attributes.
|
|
|
|
The attribute hash is fully replaced. The record is put into the same state
|
|
|
|
as it would be with `Model.find(model.id)`.
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
|
|
|
* The object returned from `select_all` must respond to `column_types`.
|
|
|
|
If this is not the case a `NoMethodError` is raised.
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2014-06-14 11:21:31 -04:00
|
|
|
* `has_many :through` associations will no longer save the through record
|
|
|
|
twice when added in an `after_create` callback defined before the
|
|
|
|
associations.
|
|
|
|
|
|
|
|
Fixes #3798.
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2014-06-17 19:05:34 -04:00
|
|
|
* Detect in-place modifications of PG array types
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2014-06-16 13:28:38 -04:00
|
|
|
* Add `bin/rake db:purge` task to empty the current database.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-06-25 12:43:32 -04:00
|
|
|
* Deprecate `serialized_attributes` without replacement.
|
2014-06-13 21:37:10 -04:00
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2014-06-14 01:34:34 -04:00
|
|
|
* Correctly extract IPv6 addresses from `DATABASE_URI`: the square brackets
|
|
|
|
are part of the URI structure, not the actual host.
|
|
|
|
|
|
|
|
Fixes #15705.
|
|
|
|
|
|
|
|
*Andy Bakun*, *Aaron Stone*
|
|
|
|
|
2014-06-08 18:04:03 -04:00
|
|
|
* Ensure both parent IDs are set on join records when both sides of a
|
|
|
|
through association are new.
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2014-06-12 17:13:28 -04:00
|
|
|
* `ActiveRecord::Dirty` now detects in-place changes to mutable values.
|
|
|
|
Serialized attributes on ActiveRecord models will no longer save when
|
2014-07-24 08:52:51 -04:00
|
|
|
unchanged.
|
|
|
|
|
|
|
|
Fixes #8328.
|
2014-06-12 17:13:28 -04:00
|
|
|
|
2014-07-02 08:41:52 -04:00
|
|
|
*Sean Griffin*
|
2014-06-01 11:41:04 -04:00
|
|
|
|
2014-06-11 16:32:00 -04:00
|
|
|
* Pluck now works when selecting columns from different tables with the same
|
|
|
|
name.
|
|
|
|
|
2014-07-24 08:52:51 -04:00
|
|
|
Fixes #15649.
|
2014-06-11 16:32:00 -04:00
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2014-05-30 14:38:55 -04:00
|
|
|
* Remove `cache_attributes` and friends. All attributes are cached.
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2014-06-10 13:06:00 -04:00
|
|
|
* Remove deprecated method `ActiveRecord::Base.quoted_locking_column`.
|
|
|
|
|
|
|
|
*Akshay Vishnoi*
|
|
|
|
|
2014-06-09 04:18:43 -04:00
|
|
|
* `ActiveRecord::FinderMethods.find` with block can handle proc parameter as
|
|
|
|
`Enumerable#find` does.
|
|
|
|
|
|
|
|
Fixes #15382.
|
|
|
|
|
|
|
|
*James Yang*
|
|
|
|
|
2014-06-07 10:26:28 -04:00
|
|
|
* Make timezone aware attributes work with PostgreSQL array columns.
|
|
|
|
|
|
|
|
Fixes #13402.
|
|
|
|
|
|
|
|
*Kuldeep Aggarwal*, *Sean Griffin*
|
|
|
|
|
2014-06-06 09:53:33 -04:00
|
|
|
* `ActiveRecord::SchemaMigration` has no primary key regardless of the
|
|
|
|
`primary_key_prefix_type` configuration.
|
|
|
|
|
|
|
|
Fixes #15051.
|
|
|
|
|
2014-06-06 10:03:13 -04:00
|
|
|
*JoseLuis Torres*, *Yves Senn*
|
2014-06-06 09:53:33 -04:00
|
|
|
|
2014-06-06 06:16:48 -04:00
|
|
|
* `rake db:migrate:status` works with legacy migration numbers like `00018_xyz.rb`.
|
|
|
|
|
|
|
|
Fixes #15538.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-06-06 02:55:25 -04:00
|
|
|
* Baseclass becomes! subclass.
|
|
|
|
|
|
|
|
Before this change, a record which changed its STI type, could not be
|
|
|
|
updated.
|
|
|
|
|
|
|
|
Fixes #14785.
|
|
|
|
|
|
|
|
*Matthew Draper*, *Earl St Sauver*, *Edo Balvers*
|
|
|
|
|
2014-06-05 05:30:29 -04:00
|
|
|
* Remove deprecated `ActiveRecord::Migrator.proper_table_name`. Use the
|
|
|
|
`proper_table_name` instance method on `ActiveRecord::Migration` instead.
|
2014-06-05 05:18:58 -04:00
|
|
|
|
|
|
|
*Akshay Vishnoi*
|
|
|
|
|
2014-06-02 22:07:02 -04:00
|
|
|
* Fix regression on eager loading association based on SQL query rather than
|
|
|
|
existing column.
|
|
|
|
|
|
|
|
Fixes #15480.
|
|
|
|
|
|
|
|
*Lauro Caetano*, *Carlos Antonio da Silva*
|
|
|
|
|
2014-06-23 11:48:47 -04:00
|
|
|
* Deprecate returning `nil` from `column_for_attribute` when no column exists.
|
|
|
|
It will return a null object in Rails 5.0
|
2014-05-30 18:57:42 -04:00
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2014-05-18 17:27:02 -04:00
|
|
|
* Implemented ActiveRecord::Base#pretty_print to work with PP.
|
|
|
|
|
|
|
|
*Ethan*
|
|
|
|
|
2014-06-03 11:54:25 -04:00
|
|
|
* Preserve type when dumping PostgreSQL point, bit, bit varying and money
|
|
|
|
columns.
|
2014-06-03 07:56:21 -04:00
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-05-31 09:01:59 -04:00
|
|
|
* New records remain new after YAML serialization.
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2014-05-30 07:48:05 -04:00
|
|
|
* PostgreSQL support default values for enum types. Fixes #7814.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-05-30 07:18:31 -04:00
|
|
|
* PostgreSQL `default_sequence_name` respects schema. Fixes #7516.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2013-08-14 07:44:14 -04:00
|
|
|
* Fixed `columns_for_distinct` of postgresql adapter to work correctly
|
|
|
|
with orders without sort direction modifiers.
|
|
|
|
|
|
|
|
*Nikolay Kondratyev*
|
|
|
|
|
2014-05-30 05:09:36 -04:00
|
|
|
* PostgreSQL `reset_pk_sequence!` respects schemas. Fixes #14719.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-05-28 07:32:40 -04:00
|
|
|
* Keep PostgreSQL `hstore` and `json` attributes as `Hash` in `@attributes`.
|
|
|
|
Fixes duplication in combination with `store_accessor`.
|
|
|
|
|
|
|
|
Fixes #15369.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-05-27 18:29:10 -04:00
|
|
|
* `rake railties:install:migrations` respects the order of railties.
|
|
|
|
|
|
|
|
*Arun Agrawal*
|
|
|
|
|
2014-05-27 00:23:33 -04:00
|
|
|
* Fix redefine a has_and_belongs_to_many inside inherited class
|
|
|
|
Fixing regression case, where redefining the same has_an_belongs_to_many
|
|
|
|
definition into a subclass would raise.
|
|
|
|
|
|
|
|
Fixes #14983.
|
|
|
|
|
|
|
|
*arthurnn*
|
|
|
|
|
2014-05-24 14:03:30 -04:00
|
|
|
* Fix has_and_belongs_to_many public reflection.
|
|
|
|
When defining a has_and_belongs_to_many, internally we convert that to two has_many.
|
|
|
|
But as `reflections` is a public API, people expect to see the right macro.
|
|
|
|
|
|
|
|
Fixes #14682.
|
|
|
|
|
|
|
|
*arthurnn*
|
|
|
|
|
Fixed serialization for records with an attribute named `format`.
* * *
This bug can be triggered when serializing record R (the instance) of type C
(the class), provided that the following conditions are met:
1. The name of one or more columns/attributes on C/R matches an existing private
method on C (e.g. those defined by `Kernel`, such as `format`).
2. The attribute methods have not yet been generated on C.
In this case, the matching private methods will be called by the serialization
code (with no arguments) and their return values will be serialized instead. If
the method requires one or more arguments, it will result in an `ArgumentError`.
This regression is introduced in d1316bb.
* * *
Attribute methods (e.g. `#name` and `#format`, assuming the class has columns
named `name` and `format` in its database table) are lazily defined. Instead of
defining them when a the class is defined (e.g. in the `inherited` hook on
`ActiveRecord::Base`), this operation is deferred until they are first accessed.
The reason behind this is that is defining those methods requires knowing what
columns are defined on the database table, which usually requires a round-trip
to the database. Deferring their definition until the last-possible moment helps
reducing unnessary work, especially in development mode where classes are
redefined and throw away between requests.
Typically, when an attribute is first accessed (e.g. `a_book.format`), it will
fire the `method_missing` hook on the class, which triggers the definition of
the attribute methods. This even works for methods like `format`, because
calling a private method with an explicit receiver will also trigger that hook.
Unfortunately, `read_attribute_for_serialization` is simply an alias to `send`,
which does not respect method visibility. As a result, when serializing a record
with those conflicting attributes, the `method_missing` is not fired, and as a
result the attribute methods are not defined one would expected.
Before d1316bb, this is negated by the fact that calling the `run_callbacks`
method will also trigger a call to `respond_to?`, which is another trigger point
for the class to define its attribute methods. Therefore, when Active Record
tries to run the `after_find` callbacks, it will also define all the attribute
methods thus masking the problem.
* * *
The proper fix for this problem is probably to restrict `read_attribute_for_serialization`
to call public methods only (i.e. alias `read_attribute_for_serialization` to
`public_send` instead of `send`). This however would be quite risky to change
in a patch release and would probably require a full deprecation cycle.
Another approach would be to override `read_attribute_for_serialization` inside
Active Record to force the definition of attribute methods:
def read_attribute_for_serialization(attribute)
self.class.define_attribute_methods
send(attribute)
end
Unfortunately, this is quite likely going to cause a performance degradation.
This patch therefore restores the behaviour from the 4-0-stable branch by
explicitly forcing the class to define its attribute methods in a similar spot
(when records are initialized). This should not cause any extra roundtrips to
the database because the `@columns` should already be cached on the class.
Fixes #15188.
2014-05-22 02:36:35 -04:00
|
|
|
* Fixed serialization for records with an attribute named `format`.
|
|
|
|
|
|
|
|
Fixes #15188.
|
|
|
|
|
|
|
|
*Godfrey Chan*
|
|
|
|
|
2014-05-22 01:17:04 -04:00
|
|
|
* When a `group` is set, `sum`, `size`, `average`, `minimum` and `maximum`
|
|
|
|
on a NullRelation should return a Hash.
|
2014-05-14 15:19:29 -04:00
|
|
|
|
|
|
|
*Kuldeep Aggarwal*
|
|
|
|
|
2014-05-21 11:38:11 -04:00
|
|
|
* Fixed serialized fields returning serialized data after being updated with
|
2014-04-05 13:19:18 -04:00
|
|
|
`update_column`.
|
|
|
|
|
|
|
|
*Simon Hørup Eskildsen*
|
|
|
|
|
2014-04-23 22:51:00 -04:00
|
|
|
* Fixed polymorphic eager loading when using a String as foreign key.
|
|
|
|
|
|
|
|
Fixes #14734.
|
|
|
|
|
|
|
|
*Lauro Caetano*
|
|
|
|
|
2014-05-05 08:24:04 -04:00
|
|
|
* Change belongs_to touch to be consistent with timestamp updates
|
|
|
|
|
2014-05-26 21:34:53 -04:00
|
|
|
If a model is set up with a belongs_to: touch relationship the parent
|
2014-05-05 08:24:04 -04:00
|
|
|
record will only be touched if the record was modified. This makes it
|
|
|
|
consistent with timestamp updating on the record itself.
|
|
|
|
|
|
|
|
*Brock Trappitt*
|
|
|
|
|
2014-05-23 17:45:21 -04:00
|
|
|
* Fixed the inferred table name of a has_and_belongs_to_many auxiliar
|
|
|
|
table inside a schema.
|
2014-05-03 19:13:27 -04:00
|
|
|
|
2014-07-24 08:52:51 -04:00
|
|
|
Fixes #14824.
|
2014-05-03 19:13:27 -04:00
|
|
|
|
|
|
|
*Eric Chahin*
|
|
|
|
|
2014-05-19 13:59:57 -04:00
|
|
|
* Remove unused `:timestamp` type. Transparently alias it to `:datetime`
|
|
|
|
in all cases. Fixes inconsistencies when column types are sent outside of
|
|
|
|
`ActiveRecord`, such as for XML Serialization.
|
|
|
|
|
|
|
|
*Sean Griffin*
|
|
|
|
|
2013-05-29 12:36:57 -04:00
|
|
|
* Fix bug that added `table_name_prefix` and `table_name_suffix` to
|
|
|
|
extension names in PostgreSQL when migrating.
|
|
|
|
|
|
|
|
*Joao Carlos*
|
|
|
|
|
2014-02-20 12:54:13 -05:00
|
|
|
* The `:index` option in migrations, which previously was only available for
|
|
|
|
`references`, now works with any column types.
|
|
|
|
|
|
|
|
*Marc Schütz*
|
|
|
|
|
2014-03-19 12:24:46 -04:00
|
|
|
* Add support for counter name to be passed as parameter on `CounterCache::ClassMethods#reset_counters`.
|
|
|
|
|
|
|
|
*jnormore*
|
|
|
|
|
2014-05-16 20:01:47 -04:00
|
|
|
* Restrict deletion of record when using `delete_all` with `uniq`, `group`, `having`
|
|
|
|
or `offset`.
|
|
|
|
|
2014-05-17 00:59:55 -04:00
|
|
|
In these cases the generated query ignored them and that caused unintended
|
2014-05-16 20:01:47 -04:00
|
|
|
records to be deleted.
|
|
|
|
|
2014-05-17 00:59:55 -04:00
|
|
|
Fixes #11985.
|
|
|
|
|
2014-05-16 20:01:47 -04:00
|
|
|
*Leandro Facchinetti*
|
|
|
|
|
2014-04-17 18:33:10 -04:00
|
|
|
* Floats with limit >= 25 that get turned into doubles in MySQL no longer have
|
|
|
|
their limit dropped from the schema.
|
|
|
|
|
|
|
|
Fixes #14135.
|
|
|
|
|
|
|
|
*Aaron Nelson*
|
|
|
|
|
2014-05-23 17:45:21 -04:00
|
|
|
* Fix how to calculate associated class name when using namespaced has_and_belongs_to_many
|
2014-05-14 20:35:52 -04:00
|
|
|
association.
|
2014-05-13 10:25:21 -04:00
|
|
|
|
|
|
|
Fixes #14709.
|
|
|
|
|
|
|
|
*Kassio Borges*
|
|
|
|
|
2014-05-14 19:29:30 -04:00
|
|
|
* `ActiveRecord::Relation::Merger#filter_binds` now compares equivalent symbols and
|
2014-05-12 17:30:05 -04:00
|
|
|
strings in column names as equal.
|
2014-05-14 19:29:30 -04:00
|
|
|
|
2014-05-12 17:30:05 -04:00
|
|
|
This fixes a rare case in which more bind values are passed than there are
|
|
|
|
placeholders for them in the generated SQL statement, which can make PostgreSQL
|
|
|
|
throw a `StatementInvalid` exception.
|
2014-05-14 19:29:30 -04:00
|
|
|
|
2014-05-12 17:30:05 -04:00
|
|
|
*Nat Budin*
|
|
|
|
|
2014-04-21 18:08:54 -04:00
|
|
|
* Fix `stored_attributes` to correctly merge the details of stored
|
|
|
|
attributes defined in parent classes.
|
|
|
|
|
|
|
|
Fixes #14672.
|
|
|
|
|
|
|
|
*Brad Bennett*, *Jessica Yao*, *Lakshmi Parthasarathy*
|
|
|
|
|
2014-05-12 11:28:45 -04:00
|
|
|
* `change_column_default` allows `[]` as argument to `change_column_default`.
|
|
|
|
|
|
|
|
Fixes #11586.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-05-12 10:39:24 -04:00
|
|
|
* Handle `name` and `"char"` column types in the PostgreSQL adapter.
|
|
|
|
|
|
|
|
`name` and `"char"` are special character types used internally by
|
|
|
|
PostgreSQL and are used by internal system catalogs. These field types
|
|
|
|
can sometimes show up in structure-sniffing queries that feature internal system
|
|
|
|
structures or with certain PostgreSQL extensions.
|
|
|
|
|
|
|
|
*J Smith*, *Yves Senn*
|
|
|
|
|
2013-12-18 16:12:53 -05:00
|
|
|
* Fix `PostgreSQLAdapter::OID::Float#type_cast` to convert Infinity and
|
|
|
|
NaN PostgreSQL values into a native Ruby `Float::INFINITY` and `Float::NAN`
|
|
|
|
|
2014-05-16 03:03:26 -04:00
|
|
|
Before:
|
2013-12-18 16:12:53 -05:00
|
|
|
|
|
|
|
Point.create(value: 1.0/0)
|
|
|
|
Point.last.value # => 0.0
|
|
|
|
|
2014-05-16 03:03:26 -04:00
|
|
|
After:
|
|
|
|
|
2013-12-18 16:12:53 -05:00
|
|
|
Point.create(value: 1.0/0)
|
|
|
|
Point.last.value # => Infinity
|
|
|
|
|
|
|
|
*Innokenty Mikhailov*
|
|
|
|
|
2014-05-23 17:45:21 -04:00
|
|
|
* Allow the PostgreSQL adapter to handle bigserial primary key types again.
|
2013-05-07 14:07:50 -04:00
|
|
|
|
|
|
|
Fixes #10410.
|
|
|
|
|
|
|
|
*Patrick Robertson*
|
|
|
|
|
2014-05-10 07:46:37 -04:00
|
|
|
* Deprecate joining, eager loading and preloading of instance dependent
|
|
|
|
associations without replacement. These operations happen before instances
|
|
|
|
are created. The current behavior is unexpected and can result in broken
|
|
|
|
behavior.
|
|
|
|
|
|
|
|
Fixes #15024.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-05-23 17:45:21 -04:00
|
|
|
* Fixed has_and_belongs_to_many's CollectionAssociation size calculation.
|
2014-05-08 01:57:49 -04:00
|
|
|
|
2014-05-23 17:45:21 -04:00
|
|
|
has_and_belongs_to_many should fall back to using the normal CollectionAssociation's
|
|
|
|
size calculation if the collection is not cached or loaded.
|
2014-05-08 01:57:49 -04:00
|
|
|
|
2014-05-16 03:03:26 -04:00
|
|
|
Fixes #14913, #14914.
|
2014-05-08 01:57:49 -04:00
|
|
|
|
|
|
|
*Fred Wu*
|
|
|
|
|
2014-05-07 17:36:06 -04:00
|
|
|
* Return a non zero status when running `rake db:migrate:status` and migration table does
|
|
|
|
not exist.
|
|
|
|
|
|
|
|
*Paul B.*
|
|
|
|
|
2014-05-02 21:00:53 -04:00
|
|
|
* Add support for module-level `table_name_suffix` in models.
|
|
|
|
|
|
|
|
This makes `table_name_suffix` work the same way as `table_name_prefix` when
|
|
|
|
using namespaced models.
|
|
|
|
|
|
|
|
*Jenner LaFave*
|
|
|
|
|
2014-05-05 12:23:29 -04:00
|
|
|
* Revert the behaviour of `ActiveRecord::Relation#join` changed through 4.0 => 4.1 to 4.0.
|
2014-05-05 03:48:59 -04:00
|
|
|
|
2014-05-05 12:23:29 -04:00
|
|
|
In 4.1.0 `Relation#join` is delegated to `Arel#SelectManager`.
|
|
|
|
In 4.0 series it is delegated to `Array#join`.
|
2014-05-05 03:48:59 -04:00
|
|
|
|
|
|
|
*Bogdan Gusiev*
|
|
|
|
|
2014-05-02 12:32:49 -04:00
|
|
|
* Log nil binary column values correctly.
|
|
|
|
|
|
|
|
When an object with a binary column is updated with a nil value
|
|
|
|
in that column, the SQL logger would throw an exception when trying
|
|
|
|
to log that nil value. This only occurs when updating a record
|
|
|
|
that already has a non-nil value in that column since an initial nil
|
|
|
|
value isn't included in the SQL anyway (at least, when dirty checking
|
|
|
|
is enabled.) The column's new value will now be logged as `<NULL binary data>`
|
|
|
|
to parallel the existing `<N bytes of binary data>` for non-nil values.
|
|
|
|
|
|
|
|
*James Coleman*
|
|
|
|
|
2014-05-03 02:49:24 -04:00
|
|
|
* Rails will now pass a custom validation context through to autosave associations
|
2014-05-01 02:38:15 -04:00
|
|
|
in order to validate child associations with the same context.
|
|
|
|
|
|
|
|
Fixes #13854.
|
|
|
|
|
|
|
|
*Eric Chahin*, *Aaron Nelson*, *Kevin Casey*
|
|
|
|
|
2014-05-23 17:45:21 -04:00
|
|
|
* Stringify all variables keys of MySQL connection configuration.
|
2014-04-28 18:39:47 -04:00
|
|
|
|
2014-05-23 17:45:21 -04:00
|
|
|
When `sql_mode` variable for MySQL adapters set in configuration as `String`
|
|
|
|
was ignored and overwritten by strict mode option.
|
2014-04-28 18:39:47 -04:00
|
|
|
|
2014-05-02 05:56:03 -04:00
|
|
|
Fixes #14895.
|
2014-04-28 18:39:47 -04:00
|
|
|
|
|
|
|
*Paul Nikitochkin*
|
|
|
|
|
2014-01-08 18:08:25 -05:00
|
|
|
* Ensure SQLite3 statements are closed on errors.
|
|
|
|
|
2014-05-02 05:56:03 -04:00
|
|
|
Fixes #13631.
|
2014-01-08 18:08:25 -05:00
|
|
|
|
2014-05-01 13:10:04 -04:00
|
|
|
*Timur Alperovich*
|
2014-01-08 18:08:25 -05:00
|
|
|
|
2014-05-02 05:56:03 -04:00
|
|
|
* Give ActiveRecord::PredicateBuilder private methods the privacy they deserve.
|
2014-05-01 02:16:33 -04:00
|
|
|
|
|
|
|
*Hector Satre*
|
|
|
|
|
2014-04-25 16:34:13 -04:00
|
|
|
* When using a custom `join_table` name on a `habtm`, rails was not saving it
|
|
|
|
on Reflections. This causes a problem when rails loads fixtures, because it
|
|
|
|
uses the reflections to set database with fixtures.
|
|
|
|
|
|
|
|
Fixes #14845.
|
|
|
|
|
|
|
|
*Kassio Borges*
|
|
|
|
|
2014-04-24 13:34:33 -04:00
|
|
|
* Reset the cache when modifying a Relation with cached Arel.
|
|
|
|
Additionally display a warning message to make the user aware.
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2014-04-24 07:20:30 -04:00
|
|
|
* PostgreSQL should internally use `:datetime` consistently for TimeStamp. Assures
|
|
|
|
different spellings of timestamps are treated the same.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
mytimestamp.simplified_type('timestamp without time zone')
|
|
|
|
# => :datetime
|
|
|
|
mytimestamp.simplified_type('timestamp(6) without time zone')
|
|
|
|
# => also :datetime (previously would be :timestamp)
|
|
|
|
|
|
|
|
See #14513.
|
|
|
|
|
|
|
|
*Jefferson Lai*
|
|
|
|
|
2014-04-23 00:37:13 -04:00
|
|
|
* `ActiveRecord::Base.no_touching` no longer triggers callbacks or start empty transactions.
|
|
|
|
|
|
|
|
Fixes #14841.
|
|
|
|
|
|
|
|
*Lucas Mazza*
|
|
|
|
|
2014-04-22 19:17:01 -04:00
|
|
|
* Fix name collision with `Array#select!` with `Relation#select!`.
|
|
|
|
|
|
|
|
Fixes #14752.
|
|
|
|
|
|
|
|
*Earl St Sauver*
|
|
|
|
|
2014-04-02 20:25:16 -04:00
|
|
|
* Fixed unexpected behavior for `has_many :through` associations going through a scoped `has_many`.
|
|
|
|
|
|
|
|
If a `has_many` association is adjusted using a scope, and another `has_many :through`
|
|
|
|
uses this association, then the scope adjustment is unexpectedly neglected.
|
|
|
|
|
|
|
|
Fixes #14537.
|
|
|
|
|
|
|
|
*Jan Habermann*
|
|
|
|
|
2014-04-18 14:31:01 -04:00
|
|
|
* `@destroyed` should always be set to `false` when an object is duped.
|
|
|
|
|
|
|
|
*Kuldeep Aggarwal*
|
|
|
|
|
2014-04-18 01:11:47 -04:00
|
|
|
* Fixed has_many association to make it support irregular inflections.
|
|
|
|
|
|
|
|
Fixes #8928.
|
|
|
|
|
|
|
|
*arthurnn*, *Javier Goizueta*
|
|
|
|
|
2014-04-16 02:27:26 -04:00
|
|
|
* Fixed a problem where count used with a grouping was not returning a Hash.
|
|
|
|
|
|
|
|
Fixes #14721.
|
|
|
|
|
|
|
|
*Eric Chahin*
|
|
|
|
|
2014-06-14 07:48:48 -04:00
|
|
|
* `sanitize_sql_like` helper method to escape a string for safe use in an SQL
|
2014-02-27 13:34:21 -05:00
|
|
|
LIKE statement.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
class Article
|
|
|
|
def self.search(term)
|
|
|
|
where("title LIKE ?", sanitize_sql_like(term))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Article.search("20% _reduction_")
|
|
|
|
# => Query looks like "... title LIKE '20\% \_reduction\_' ..."
|
|
|
|
|
|
|
|
*Rob Gilson*, *Yves Senn*
|
|
|
|
|
2014-04-15 16:24:49 -04:00
|
|
|
* Do not quote uuid default value on `change_column`.
|
|
|
|
|
|
|
|
Fixes #14604.
|
|
|
|
|
|
|
|
*Eric Chahin*
|
|
|
|
|
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
|
2014-06-14 07:48:48 -04:00
|
|
|
generates an SQL statement containing each id of the collection:
|
2014-04-13 05:13:19 -04:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2014-05-16 03:03:26 -04:00
|
|
|
Fixes #11524.
|
2013-08-25 05:22:36 -04:00
|
|
|
|
|
|
|
*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-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 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` or `exists?` is now deprecated.
|
|
|
|
Call `.id` on the object first.
|
2014-03-13 14:40:35 -04:00
|
|
|
|
2014-06-03 23:13:31 -04:00
|
|
|
*Aaron Patterson*
|
|
|
|
|
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-05-20 19:42:46 -04:00
|
|
|
* Only save has_one associations if record has changes.
|
|
|
|
Previously after save related callbacks, such as `#after_commit`, were triggered when the has_one
|
|
|
|
object did not get saved to the db.
|
|
|
|
|
|
|
|
*Alan Kennedy*
|
|
|
|
|
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
|
2014-07-11 05:15:00 -04:00
|
|
|
`has_and_belongs_to_many` associations *and* on `has_many :through`
|
2014-03-05 03:07:12 -05:00
|
|
|
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.
|