0

I'm using the following scope in a Rails 3.2 application:

scope :consumable, lambda { where('expiration_date > ?', Date.today) }

What is the correct syntax to achieve the same in Rails 4 with Ruby 2.0?

1
  • This is actually not due to Rails 4, it is Ruby version dependent. Commented Jul 16, 2013 at 16:01

1 Answer 1

2
scope :consumable, -> { where('expiration_date > ?', Date.today) }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.