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/version_patch.rb

14 lines
385 B

module VersionPatch
def self.included(base) # :nodoc:
# Same as typing in the class
base.class_eval do
unloadable
# Returns the total reported time for this version
def spent_hours
@spent_hours ||= TimeEntry.visible.sum(:hours, :include => :issue, :conditions => ["#{Issue.table_name}.fixed_version_id = ?", id]).to_f
end
end
end
end