frankfurter/lib/db.rb

16 lines
253 B
Ruby
Raw Normal View History

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