diff --git a/app/models/estimate.rb b/app/models/estimate.rb index 6de04b3..c93212a 100644 --- a/app/models/estimate.rb +++ b/app/models/estimate.rb @@ -14,6 +14,11 @@ class Estimate < ActiveRecord::Base belongs_to :customer validates_presence_of :doc_number, :id self.primary_key = :id + + # returns a human readable string + def to_s + return self[:doc_number] + end # sync all estimates def self.sync diff --git a/app/models/invoice.rb b/app/models/invoice.rb index 264895c..47b1460 100644 --- a/app/models/invoice.rb +++ b/app/models/invoice.rb @@ -14,6 +14,11 @@ class Invoice < ActiveRecord::Base belongs_to :customer validates_presence_of :doc_number, :id, :customer_id, :txn_date self.primary_key = :id + + # returns a human readable string + def to_s + return self[:doc_number] + end # sync ALL the invoices def self.sync