diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-17 23:03:06 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-19 19:58:27 +0300 |
commit | 928acba4c0ae31626dac621f0f240f18cbad548a (patch) | |
tree | 2ef135225db8a550fd735647c002a2067f03270b /app/models/concerns/sortable.rb | |
parent | 8379fbcd47930320bf4dd6a3ac41c6efd427a91a (diff) |
Use keyword arguments on Sortable#highest_label_priority
Diffstat (limited to 'app/models/concerns/sortable.rb')
-rw-r--r-- | app/models/concerns/sortable.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/concerns/sortable.rb b/app/models/concerns/sortable.rb index 83e551fd152..12b23f00769 100644 --- a/app/models/concerns/sortable.rb +++ b/app/models/concerns/sortable.rb @@ -38,13 +38,13 @@ module Sortable private - def highest_label_priority(object_types, project_field, condition_field, excluded_labels: []) + def highest_label_priority(target_type:, target_column:, project_column:, excluded_labels: []) query = Label.select(LabelPriority.arel_table[:priority].minimum). left_join_priorities. joins(:label_links). - where(label_links: { target_type: object_types }). - where("label_priorities.project_id = #{project_field}"). - where("label_links.target_id = #{condition_field}"). + where("label_priorities.project_id = #{project_column}"). + where(label_links: { target_type: target_type }). + where("label_links.target_id = #{target_column}"). reorder(nil) query.where.not(title: excluded_labels) if excluded_labels.present? |