From 5b8b9771d7c8b45eb9f0c0ca640420eb91b8f037 Mon Sep 17 00:00:00 2001 From: Trevor Turk Date: Thu, 28 Feb 2013 15:53:24 -0600 Subject: Document that scopes require a callable object --- guides/source/upgrading_ruby_on_rails.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'guides/source') diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md index dc0bc5bea1..77a09cd5f0 100644 --- a/guides/source/upgrading_ruby_on_rails.md +++ b/guides/source/upgrading_ruby_on_rails.md @@ -47,8 +47,16 @@ Rails 4.0 no longer supports loading plugins from `vendor/plugins`. You must rep * Rails 4.0 has removed `attr_accessible` and `attr_protected` feature in favor of Strong Parameters. You can use the [Protected Attributes gem](https://github.com/rails/protected_attributes) to a smoothly upgrade path. -* Rails 4.0 has deprecated `ActiveRecord::Fixtures` in favor of `ActiveRecord::FixtureSet`. +* Rails 4.0 requires that scopes use a callable object such as a Proc or lambda: + +```ruby + scope :active, where(active: true) + # becomes + scope :active, -> { where active: true } +``` + +* Rails 4.0 has deprecated `ActiveRecord::Fixtures` in favor of `ActiveRecord::FixtureSet`. * Rails 4.0 has deprecated `ActiveRecord::TestCase` in favor of `ActiveSupport::TestCase`. ### Active Resource -- cgit v1.2.3