1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-23 17:01:13 +00:00

Moved Version#fixed_issues extension to a module (#30115).

Patch by Jérôme BATAILLE.

git-svn-id: http://svn.redmine.org/redmine/trunk@17754 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2018-12-16 16:01:00 +00:00
parent 22f93b566d
commit 537f162f27

View File

@ -15,15 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class Version < ActiveRecord::Base
include Redmine::SafeAttributes
after_update :update_issues_from_sharing_change
after_save :update_default_project_version
before_destroy :nullify_projects_default_version
belongs_to :project
has_many :fixed_issues, :class_name => 'Issue', :foreign_key => 'fixed_version_id', :dependent => :nullify do
module FixedIssuesExtension
# Returns the total estimated time for this version
# (sum of leaves estimated_hours)
def estimated_hours
@ -114,6 +106,16 @@ class Version < ActiveRecord::Base
end
end
class Version < ActiveRecord::Base
include Redmine::SafeAttributes
after_update :update_issues_from_sharing_change
after_save :update_default_project_version
before_destroy :nullify_projects_default_version
belongs_to :project
has_many :fixed_issues, :class_name => 'Issue', :foreign_key => 'fixed_version_id', :dependent => :nullify, :extend => FixedIssuesExtension
acts_as_customizable
acts_as_attachable :view_permission => :view_files,
:edit_permission => :manage_files,