Project

General

Profile

Patch #38645 ยป 0001-fix-Project-fix-RuntimeError-when-calling-Project-de.patch

Nishida Yuya, 2023-06-01 17:54

View differences:

app/models/project.rb
29 29
  # Maximum length for project identifiers
30 30
  IDENTIFIER_MAX_LENGTH = 100
31 31

  
32
  # Specific overridden Activities
33
  has_many :time_entry_activities, :dependent => :destroy
34 32
  has_many :memberships, :class_name => 'Member', :inverse_of => :project
35 33
  # Memberships of active users only
36 34
  has_many :members,
......
43 41
  belongs_to :default_version, :class_name => 'Version'
44 42
  belongs_to :default_assigned_to, :class_name => 'Principal'
45 43
  has_many :time_entries, :dependent => :destroy
44
  # Specific overridden Activities
45
  has_many :time_entry_activities, :dependent => :destroy
46 46
  has_many :queries, :dependent => :destroy
47 47
  has_many :documents, :dependent => :destroy
48 48
  has_many :news, lambda {includes(:author)}, :dependent => :destroy
test/unit/project_test.rb
236 236
    # generate some dependent objects
237 237
    overridden_activity = TimeEntryActivity.new({:name => "Project", :project => @ecookbook})
238 238
    assert overridden_activity.save!
239
    issue = @ecookbook.issues.first!
240
    issue.time_entries.create!(
241
      :comments => "overridden activity time entry",
242
      :activity => overridden_activity,
243
      :author => issue.author,
244
      :user => issue.author,
245
      :spent_on => issue.start_date,
246
      :hours => 8
247
    )
239 248

  
240 249
    query = IssueQuery.generate!(:project => @ecookbook, :visibility => Query::VISIBILITY_ROLES, :roles => Role.where(:id => [1, 3]).to_a)
241 250

  
    (1-1/1)