lib/printreleaf/transaction.rb in printreleaf-1.0.3 vs lib/printreleaf/transaction.rb in printreleaf-1.3.0
- old
+ new
@@ -9,14 +9,14 @@
property :id
property :account_id
property :project_id
property :certificate_id
+ property :quote_id
property :date, transform_with: Transforms::Date
+ property :pages, transform_with: Transforms::Integer
property :trees, transform_with: Transforms::Float
- property :items
- coerce_key :items, Array[TransactionItem]
def account
@account ||= Account.find(account_id)
end
@@ -24,9 +24,14 @@
@project ||= Forestry::Project.find(project_id)
end
def certificate
@certificate ||= Certificate.find(certificate_id)
+ end
+
+ def quote
+ return nil if quote_id.nil?
+ @quote ||= Quote.find(quote_id)
end
end
end