Organisations with no tags do not disturb the form anymore

This commit is contained in:
echarp 2016-06-25 18:47:08 +02:00
parent f2105006ef
commit 9c55f58254

View File

@ -36,7 +36,7 @@ class TagsController < InheritedResources::Base
# Splits, groups, rejects the less used
def organise_tags(tags)
tags.pluck(:tags).map(&:split).flatten
tags.where.not(tags: '').pluck(:tags).map(&:split).flatten
.group_by { |i| i }
.map { |k, v| [k, v.size] }
.reject { |_k, v| v <= 3 }