プロジェクト

全般

プロフィール

Vote #80467

完了

Invalid association IssueCustomField#issue_custom_values

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Code cleanup/refactoring_30
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
30
version_id:
127
issue_org_id:
32431
author_id:
1006
assigned_to_id:
1
comments:
3
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

This "hm:t :issue_custom_values" association has been defined since the "Initial commit" at 6b7650e2f03156ea1e3985b30c1995e44c317e3d, but actually neither an association named :issue_custom_values nor a model named IssueCustomValue have appeared in the history.

And so referencing this association of course causes an ActiveRecord error:

$ bundle e rails r 'IssueCustomField.new.issues'
Traceback (most recent call last):
    16: from bin/rails:4:in `
' 15: from bin/rails:4:in `require' 14: from .../railties-5.2.3/lib/rails/commands.rb:18:in `' 13: from .../railties-5.2.3/lib/rails/command.rb:46:in `invoke' 12: from .../railties-5.2.3/lib/rails/command/base.rb:65:in `perform' 11: from .../thor-0.20.3/lib/thor.rb:387:in `dispatch' 10: from .../thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' 9: from .../thor-0.20.3/lib/thor/command.rb:27:in `run' 8: from .../railties-5.2.3/lib/rails/commands/runner/runner_command.rb:41:in `perform' 7: from .../railties-5.2.3/lib/rails/commands/runner/runner_command.rb:41:in `eval' 6: from .../railties-5.2.3/lib/rails/commands/runner/runner_command.rb:41:in `
' 5: from .../activerecord-5.2.3/lib/active_record/associations/builder/association.rb:108:in `issues' 4: from .../activerecord-5.2.3/lib/active_record/associations.rb:237:in `association' 3: from .../activerecord-5.2.3/lib/active_record/associations.rb:237:in `new' 2: from .../activerecord-5.2.3/lib/active_record/associations/has_many_through_association.rb:10:in `initialize' 1: from .../activerecord-5.2.3/lib/active_record/associations/association.rb:26:in `initialize' .../activerecord-5.2.3/lib/active_record/reflection.rb:912:in `check_validity!': Could not find the association :issue_custom_values in model IssueCustomField (ActiveRecord::HasManyThroughAssociationNotFoundError)

The attached patch just removes this dead association.


journals

--------------------------------------------------------------------------------
Akira Matsuda wrote:
> This "hm:t :issue_custom_values" association has been defined since the "Initial commit" at 6b7650e2f03156ea1e3985b30c1995e44c317e3d, but actually neither an association named :issue_custom_values nor a model named IssueCustomValue have appeared in the history.

Confirmed. Setting the target version to 4.1.0.
--------------------------------------------------------------------------------
Committed, thanks.
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリCode cleanup/refactoring_30 にセット
  • 対象バージョン4.1.0_127 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0