Skip to content

Commit

Permalink
Merge pull request #3973 from cben/dont-ask-category-of-category-Tag
Browse files Browse the repository at this point in the history
mapping.tag is a category Tag, calling .category is ill-defined
  • Loading branch information
martinpovolny committed May 24, 2018
2 parents 169064b + 0d3c824 commit da1580e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/controllers/ops_controller/settings/label_tag_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,17 @@ def entity_options

def label_tag_mapping_get_all
# Current UI only supports any-value -> category mappings
mapping = ContainerLabelTagMapping.in_my_region.where(:label_value => nil)
mappings = ContainerLabelTagMapping.in_my_region.where(:label_value => nil)

# This renders into label_tag_mapping_form view, fields are different from other
# functions here, notably `:entity` is the translated ui name.
@lt_mapping = []
mapping.each do |m|
mappings.each do |m|
lt_map = {}
lt_map[:id] = m.id
lt_map[:entity] = entity_ui_name_or_all(m.labeled_resource_type)
lt_map[:label_name] = m.label_name
lt_map[:category] = m.tag.category.description
lt_map[:category] = m.tag.classification.description
@lt_mapping.push(lt_map)
end
end
Expand All @@ -127,7 +127,7 @@ def lt_map_set_form_vars
@edit[:key] = "label_tag_mapping_edit__#{@lt_map.id || "new"}"
@edit[:new][:entity] = @lt_map.labeled_resource_type
@edit[:new][:label_name] = @lt_map.label_name
@edit[:new][:category] = @lt_map.tag.category.description
@edit[:new][:category] = @lt_map.tag.classification.description
@edit[:current] = copy_hash(@edit[:new])
@edit[:new][:options] = entity_options
session[:edit] = @edit
Expand Down Expand Up @@ -222,7 +222,7 @@ def label_tag_mapping_update(id, cat_description)

def label_tag_mapping_delete
mapping = ContainerLabelTagMapping.find(params[:id])
category = mapping.tag.category
category = mapping.tag.classification
label_name = mapping.label_name

deleted = false
Expand Down

0 comments on commit da1580e

Please sign in to comment.