OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/test/exemplars/cost_rate_exemplar.rb

13 lines
300 B

Rate.class_eval do
generator_for :valid_from, :method => :next_valid_from
generator_for :rate, 10
generator_for :cost_type, :method => :next_cost_type
def self.next_cost_type
CostType.last || CostType.generate!
end
def self.next_valid_from
1.year.ago + Rate.count
end
end