Files
redmine_contracts/app/models/payment_term.rb
Eric Davis a2b810a4d8 [#4410] Replace Payment Terms with an Enumeration
Instead of using a hard coded value for Payment Terms, they will use
Redmine's Enumeration table.  This provides an admin gui to managing
the value as well as ordering them.
2010-08-12 09:26:09 -07:00

20 lines
329 B
Ruby

class PaymentTerm < Enumeration
unloadable
has_many :contracts, :foreign_key => 'payment_term_id'
OptionName = :enumeration_payment_term
def option_name
OptionName
end
def objects_count
contracts.count
end
def transfer_relations(to)
contracts.update_all("payment_term_id = #{to.id}")
end
end