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/lib/time_entry_patch.rb

34 lines
618 B

# TODO: which require statement to use here? require_dependency breaks stuff
#require 'time_entry'
# Patches Redmine's Users dynamically.
module TimeEntryPatch
def self.included(base) # :nodoc:
base.extend(ClassMethods)
base.send(:include, InstanceMethods)
# Same as typing in the class
base.class_eval do
unloadable
end
end
module ClassMethods
end
module InstanceMethods
def costs
@costs || @costs = self.hours * self.user.rate_at(self.spent_on, self.project_id).rate
rescue
0.0
end
def costs=(value)
@costs = value
end
end
end