aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/CHANGELOG')
-rw-r--r--activerecord/CHANGELOG18
1 files changed, 18 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index 6b3d408720..93eb42a52c 100644
--- a/activerecord/CHANGELOG
+++ b/activerecord/CHANGELOG
@@ -1,5 +1,23 @@
*Rails 3.1.0 (unreleased)*
+* Passing a proc (or other object that responds to #call) to scope is deprecated. If you need your
+ scope to be lazily evaluated, or takes parameters, please define it as a normal class method
+ instead. For example, change this:
+
+ class Post < ActiveRecord::Base
+ scope :unpublished, lambda { where('published_at > ?', Time.now) }
+ end
+
+ To this:
+
+ class Post < ActiveRecord::Base
+ def self.unpublished
+ where('published_at > ?', Time.now)
+ end
+ end
+
+ [Jon Leighton]
+
* Default scopes are now evaluated at the latest possible moment, to avoid problems where
scopes would be created which would implicitly contain the default scope, which would then
be impossible to get rid of via Model.unscoped.