Project

General

Profile

Actions

Patch #32431

closed

Invalid association IssueCustomField#issue_custom_values

Added by Akira Matsuda over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

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.


Files

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

Updated by Go MAEDA over 4 years ago

  • Description updated (diff)
Actions #2

Updated by Go MAEDA over 4 years 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.

Actions #3

Updated by Jean-Philippe Lang over 4 years ago

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

Committed, thanks.

Actions

Also available in: Atom PDF