diff options
author | Joshua Wood <josh@hintmedia.com> | 2012-03-02 17:59:23 -0800 |
---|---|---|
committer | Joshua Wood <josh@hintmedia.com> | 2012-04-14 14:18:42 -0700 |
commit | ca0af8221a3b704fa289afe7030a96dc8cec8a95 (patch) | |
tree | c3100645cc5ef8e41d5d7fdd86b100a5c6efa85b /activerecord/CHANGELOG.md | |
parent | d55eea15008bc4674f761b2494b33c22eb9e15e9 (diff) | |
download | rails-ca0af8221a3b704fa289afe7030a96dc8cec8a95.tar.gz rails-ca0af8221a3b704fa289afe7030a96dc8cec8a95.tar.bz2 rails-ca0af8221a3b704fa289afe7030a96dc8cec8a95.zip |
Automatically create indexes for references/belongs_to statements in migrations.
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 85cb3e0e20..44ff403582 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,5 +1,27 @@ ## Rails 4.0.0 (unreleased) ## +* Added an :index option to automatically create indexes for references + and belongs_to statements in migrations. + + The `references` and `belongs_to` methods now support an `index` + option that receives either a boolean value or an options hash + that is identical to options available to the add_index method: + + create_table :messages do |t| + t.references :person, :index => true + end + + Is the same as: + + create_table :messages do |t| + t.references :person + end + add_index :messages, :person_id + + Generators have also been updated to use the new syntax. + + [Joshua Wood] + * Added bang methods for mutating `ActiveRecord::Relation` objects. For example, while `foo.where(:bar)` will return a new object leaving `foo` unchanged, `foo.where!(:bar)` will mutate the foo |