Filter using an expression

This commit is contained in:
hakanensari 2014-03-17 10:09:32 +00:00
parent 043dd4d4be
commit 39164022e6

View File

@ -9,7 +9,7 @@ class Snapshot
def quote
self.date = if date
Currency.where("date <= '#{date}'").order(:date).last.date
Currency.where{date <= date}.order(:date).last.date
else
Currency.last_date
end