Files
redmine_contracts/db/migrate/010_populate_payment_terms.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

15 lines
333 B
Ruby

class PopulatePaymentTerms < ActiveRecord::Migration
def self.up
[0, 15, 30, 45, 60, 75, 90].each_with_index do |days, index|
name = "Net #{days}"
unless PaymentTerm.find_by_name(name)
PaymentTerm.create!(:name => name, :position => index + 1)
end
end
end
def self.down
# No-op
end
end