Browse Source

Nettoyage des appels map, pour utiliser la syntaxe &:

recurrent
echarp 8 years ago
parent
commit
cc8369a0f8
  1. 2
      app/controllers/tags_controller.rb
  2. 2
      app/helpers/events_helper.rb

2
app/controllers/tags_controller.rb

@ -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 }

2
app/helpers/events_helper.rb

@ -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…
Cancel
Save