-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
just like activerecord, the scope should always be chainable, so we can write
scope :before_date, ->(date) { where(:date.lt => date) if date}
instead of
scope :before_date, ->(date) { date ? where(:date.lt => date) : all}