Refactor Quote

This commit is contained in:
Hakan Ensari 2015-12-22 19:46:10 +00:00
parent b1bc3ae1c0
commit af9f63f002

View File

@ -9,14 +9,7 @@ class Quote
values do
attribute :base, String, default: DEFAULT_BASE
attribute :date, Date, default: proc { Currency.current_date }
end
def rates
@rates ||= find_rates
end
def attributes
super.merge(rates: rates)
attribute :rates, Hash, default: :find_rates, lazy: true
end
private