frankfurter/lib/db.rb

14 lines
221 B
Ruby
Raw Normal View History

2012-11-20 17:36:12 +01:00
require 'sequel'
Sequel.connect ENV['DATABASE_URL'] || 'postgres://localhost/fixer'
class Currency < Sequel::Model
def self.last_date
order(:date).last.date
end
def to_hash
{ iso_code => rate }
end
end