Project

General

Profile

Patch #40538 ยป version_extension.rb

Enzo Pellecchia, 2024-04-08 16:16

 
1
# app/models/version_extension.rb
2
module VersionExtension
3
    def self.included(base)
4
      base.class_eval do
5
        def visible_fixed_issues            
6
            @visible_fixed_issues ||= begin
7
              issues = fixed_issues.visible
8
              # Aggiungi gli issue figlio degli altri progetti
9
              issue_ids = issues.pluck(:id)
10
              child_issues = Issue.where(parent_id: issue_ids).where.not(project_id: project_id)
11
              all_issues = issues + child_issues
12
              all_issues
13
            end
14
        end
15
    
16
      end
17
    end
18
  end
19
  # Includi il modulo nel modello Version
20
  Version.include(VersionExtension)
21
  
    (1-1/1)