Nettoyage des appels map, pour utiliser la syntaxe &:
This commit is contained in:
parent
ef0f237f60
commit
cc8369a0f8
@ -2,7 +2,7 @@
|
||||
class TagsController < InheritedResources::Base
|
||||
def index
|
||||
@tags = Event
|
||||
.pluck(:tags).map { |e| e.split }.flatten
|
||||
.pluck(:tags).map(&:split).flatten
|
||||
.group_by { |i| i }
|
||||
.map { |k, v| [k, v.size] }
|
||||
.reject { |_k, v| v < 2 }
|
||||
|
@ -3,7 +3,7 @@ module EventsHelper
|
||||
def set_events_meta
|
||||
set_meta_tags \
|
||||
description: t('layouts.application.subtitle'),
|
||||
keywords: @events.map { |e| e.tags }.join(' ').split.group_by { |i| i }
|
||||
keywords: @events.map(&:tags).join(' ').split.group_by { |i| i }
|
||||
.reject { |_k, v| v.size < 2 }.map { |k, _v| k },
|
||||
DC: {
|
||||
title: t('layouts.application.title'),
|
||||
|
Loading…
Reference in New Issue
Block a user