mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-22 02:52:49 +01:00
16 lines
253 B
Ruby
16 lines
253 B
Ruby
require 'sequel'
|
|
|
|
Sequel.connect ENV['DATABASE_URL'] || 'postgres://localhost/fixer'
|
|
|
|
#Sequel.single_threaded = true
|
|
|
|
class Currency < Sequel::Model
|
|
def self.last_date
|
|
order(:date).last.date
|
|
end
|
|
|
|
def to_hash
|
|
{ iso_code => rate }
|
|
end
|
|
end
|