We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d94ade3 commit 044bbb3Copy full SHA for 044bbb3
app/helpers/catalog_helper/textual_summary.rb
@@ -1,7 +1,7 @@
1
module CatalogHelper::TextualSummary
2
def tags_from_record
3
tags = []
4
- tag_categories = {}
+ tag_categories = Hash.new { |h, k| h[k] = [] }
5
@record.tags.each do |tag|
6
values = tag.name.split('/')
7
p = tags.find { |x| x[:label] == values[2].humanize }
@@ -10,11 +10,7 @@ def tags_from_record
10
p[:value].push(value)
11
else
12
name = Classification.find_by(:id => Classification.find_by(:tag_id => tag.id).parent_id).description
13
- if tag_categories[name].nil?
14
- tag_categories[name] = [value]
15
- else
16
- tag_categories[name].append(value)
17
- end
+ tag_categories[name] << value
18
end
19
20
tag_categories.each do |tag_category, tag_values|
0 commit comments