mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-10-29 23:32:35 +01:00
14 lines
221 B
Ruby
14 lines
221 B
Ruby
|
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
|