プロジェクト

全般

プロフィール

Vote #80969

完了

Remove an unused variable in Query#add_chained_custom_field_filters

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

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

0%

予定工数:
category_id:
30
version_id:
152
issue_org_id:
33728
author_id:
259873
assigned_to_id:
332
comments:
5
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

It's a very small change that remove unused variable.


diff --git a/app/models/query.rb b/app/models/query.rb
index 61c47bdda..77004dbb5 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -1378,7 +1378,6 @@ class Query < ActiveRecord::Base
         options = chained.query_filter_options(self)
 
         filter_id = "cf_#{field.id}.cf_#{chained.id}"
-        filter_name = chained.name
 
         add_available_filter filter_id, options.merge({
           :name => l(:label_attribute_of_object, :name => chained.name, :object_name => field.name),

journals

Thank you for reporting the issue. I prefer the following fix because filter_id and filter_name are used as a pair at another line in query.rb (source:tags/4.1.1/app/models/query.rb#L1328).

<pre><code class="diff">
diff --git a/app/models/query.rb b/app/models/query.rb
index 6da317514..c41f64cd5 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -1390,7 +1390,7 @@ class Query < ActiveRecord::Base
options.merge(
{
:name => l(:label_attribute_of_object,
- :name => chained.name,
+ :name => filter_name,
:object_name => field.name),
:field => chained,
:through => field
</code></pre>
--------------------------------------------------------------------------------
Go MAEDA wrote:
> Thank you for reporting the issue. I prefer the following fix because filter_id and filter_name are used as a pair at another line in query.rb (source:tags/4.1.1/app/models/query.rb#L1328).

OK, I think either solution is fine.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Setting the target version to 4.2.0.
--------------------------------------------------------------------------------
Committed the patch. Thank you.
--------------------------------------------------------------------------------

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

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

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

いいね!0
いいね!0