aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
authorToshiyuki Kawanishi <toshi.kawanishi@gmail.com>2012-09-15 17:39:11 +0900
committerToshiyuki Kawanishi <toshi.kawanishi@gmail.com>2012-09-16 20:02:23 +0900
commit761bc751d31c22e2c2fdae2b4cdd435b68b6d783 (patch)
tree3be6eea9bbeef057a0ab55796e1e693e76af0226 /activerecord/CHANGELOG.md
parent56c60cab563a1adf778e18c5c8d0935fac26b6b8 (diff)
downloadrails-761bc751d31c22e2c2fdae2b4cdd435b68b6d783.tar.gz
rails-761bc751d31c22e2c2fdae2b4cdd435b68b6d783.tar.bz2
rails-761bc751d31c22e2c2fdae2b4cdd435b68b6d783.zip
Fix find_in_batches with customized primary_key
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 8c99a3929e..71dc960309 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,5 +1,20 @@
## Rails 4.0.0 (unreleased) ##
+* 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`.