aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md54
1 files changed, 37 insertions, 17 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 756a0d7196..04b67cdf3a 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,5 +1,40 @@
## Rails 4.0.0 (unreleased) ##
+* Support for specifying transaction isolation level
+
+ If your database supports setting the isolation level for a transaction, you can set
+ it like so:
+
+ Post.transaction(isolation: :serializable) do
+ # ...
+ end
+
+ Valid isolation levels are:
+
+ * `:read_uncommitted`
+ * `:read_committed`
+ * `:repeatable_read`
+ * `:serializable`
+
+ You should consult the documentation for your database to understand the
+ semantics of these different levels:
+
+ * http://www.postgresql.org/docs/9.1/static/transaction-iso.html
+ * https://dev.mysql.com/doc/refman/5.0/en/set-transaction.html
+
+ An `ActiveRecord::TransactionIsolationError` will be raised if:
+
+ * The adapter does not support setting the isolation level
+ * You are joining an existing open transaction
+ * You are creating a nested (savepoint) transaction
+
+ The mysql, mysql2 and postgresql adapters support setting the transaction
+ isolation level. However, support is disabled for mysql versions below 5,
+ because they are affected by a bug (http://bugs.mysql.com/bug.php?id=39170)
+ which means the isolation level gets persisted outside the transaction.
+
+ *Jon Leighton*
+
* `ActiveModel::ForbiddenAttributesProtection` is included by default
in Active Record models. Check the docs of `ActiveModel::ForbiddenAttributesProtection`
for more details.
@@ -10,7 +45,7 @@
`ActiveModel::MassAssignmentSecurity`, `protected_attributes` gem
should be added to use `attr_accessible`/`attr_protected`. Mass
assignment options has been removed from all the AR methods that
- used it (ex. AR::Base.new, AR::Base.create, AR::Base#update_attributes, etc)
+ used it (ex. `AR::Base.new`, `AR::Base.create`, `AR::Base#update_attributes`, etc).
*Guillermo Iguaran*
@@ -41,21 +76,6 @@
*kennyj*
-* Fix `find_in_batches` when primary_key is set other than id.
- You can now use this method with the primary key which is not integer-based.
-
- Example:
-
- class Post < ActiveRecord::Base
- self.primary_key = :title
- end
-
- Post.find_in_batches(start: 'My First Post') do |batch|
- batch.each { |post| post.author.greeting }
- end
-
- *Toshiyuki Kawanishi*
-
* You can now override the generated accessor methods for stored attributes
and reuse the original behavior with `read_store_attribute` and `write_store_attribute`,
which are counterparts to `read_attribute` and `write_attribute`.
@@ -91,7 +111,7 @@
create_table :table_with_arrays do |t|
t.integer :int_array, array: true
# integer[]
- t.integer :int_array, array: true, :length => 2
+ t.integer :int_array, array: true, length: 2
# smallint[]
t.string :string_array, array: true, length: 30
# char varying(30)[]