Patch #32431

Invalid association IssueCustomField#issue_custom_values

Added by Akira Matsuda 12 days ago. Updated 9 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Code cleanup/refactoring
Target version:4.1.0

Description

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 `<main>'
    15: from bin/rails:4:in `require'
    14: from .../railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>'
    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 `<main>'
     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.

issue_custom_values.patch Magnifier (972 Bytes) Akira Matsuda, 2019-11-07 06:42

Associated revisions

Revision 19061
Added by Jean-Philippe Lang 9 days ago

Removed invalid association IssueCustomField#issue_custom_values (#32431).

Patch by Akira Matsuda.

Revision 19062
Added by Jean-Philippe Lang 9 days ago

Merged r19061 to 4.1-stable (#32431).

History

#1 Updated by Go MAEDA 10 days ago

  • Description updated (diff)

#2 Updated by Go MAEDA 10 days ago

  • Target version set to 4.1.0

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.

#3 Updated by Jean-Philippe Lang 9 days ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang

Committed, thanks.

Also available in: Atom PDF