aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md80
1 files changed, 73 insertions, 7 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 130d0f05d2..0a2e7a127c 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,8 +1,74 @@
## Rails 4.0.0 (unreleased) ##
+* Allow `Relation#where` with no arguments to be chained with new `not` query method.
+
+ Example:
+
+ Developer.where.not(name: 'Aaron')
+
+ *Akira Matsuda*
+
+* Unscope `update_column(s)` query to ignore default scope.
+
+ When applying `default_scope` to a class with a where clause, using
+ `update_column(s)` could generate a query that would not properly update
+ the record due to the where clause from the `default_scope` being applied
+ to the update query.
+
+ class User < ActiveRecord::Base
+ default_scope where(active: true)
+ end
+
+ user = User.first
+ user.active = false
+ user.save!
+
+ user.update_column(:active, true) # => false
+
+ In this situation we want to skip the default_scope clause and just
+ update the record based on the primary key. With this change:
+
+ user.update_column(:active, true) # => true
+
+ Fixes #8436.
+
+ *Carlos Antonio da Silva*
+
+* SQLite adapter no longer corrupts binary data if the data contains `%00`.
+
+ *Chris Feist*
+
+* Add migration history to `schema.rb` dump. Loading `schema.rb` with full migration
+ history restores the exact list of migrations that created that schema (including names
+ and fingerprints). This avoids possible mistakes caused by assuming all migrations with
+ a lower version have been run when loading `schema.rb`. Old `schema.rb` files without
+ migration history but with the `:version` setting still work as before.
+
+ *Josh Susser*
+
+* Add metadata columns to `schema_migrations` table. New columns are:
+
+ * `migrated_at`: timestamp
+ * `fingerprint`: md5 hash of migration source
+ * `name`: filename minus version and extension
+
+ *Josh Susser*
+
+* Fix performance problem with `primary_key` method in PostgreSQL adapter when having many schemas.
+ Uses `pg_constraint` table instead of `pg_depend` table which has many records in general.
+ Fix #8414
+
+ *kennyj*
+
+* Do not instantiate intermediate Active Record objects when eager loading.
+ These records caused `after_find` to run more than expected.
+ Fix #3313
+
+ *Yves Senn*
+
* Add STI support to init and building associations.
- Allows you to do BaseClass.new(:type => "SubClass") as well as
- parent.children.build(:type => "SubClass") or parent.build_child
+ Allows you to do `BaseClass.new(:type => "SubClass")` as well as
+ `parent.children.build(:type => "SubClass")` or `parent.build_child`
to initialize an STI subclass. Ensures that the class name is a
valid class and that it is in the ancestors of the super class
that the association is expecting.
@@ -776,7 +842,7 @@
end
person.pets.delete("1") # => [#<Pet id: 1>]
- person.pets.delete(2, 3) # => [#<Pet id: 2>, #<Pet id: 3>]
+ person.pets.delete(2, 3) # => [#<Pet id: 2>, #<Pet id: 3>]
*Francesco Rodriguez*
@@ -1047,11 +1113,11 @@
Note that you do not need to explicitly specify references in the
following cases, as they can be automatically inferred:
- Post.where(comments: { name: 'foo' })
- Post.where('comments.name' => 'foo')
- Post.order('comments.name')
+ Post.includes(:comments).where(comments: { name: 'foo' })
+ Post.includes(:comments).where('comments.name' => 'foo')
+ Post.includes(:comments).order('comments.name')
- You also do not need to worry about this unless you are doing eager
+ You do not need to worry about this unless you are doing eager
loading. Basically, don't worry unless you see a deprecation warning
or (in future releases) an SQL error due to a missing JOIN.