Skip to content
Extraits de code Groupes Projets
Valider a00fb8aa rédigé par echarp's avatar echarp
Parcourir les fichiers

Tags can also be scoped by region and week/year

parent 11191169
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
# Manage event tags # Manage event tags
class TagsController < InheritedResources::Base class TagsController < InheritedResources::Base
has_scope :region, :locality, :tag, :daylimit
has_scope :period, type: :hash, using: [:year, :week]
def index def index
@tags = Event @tags = apply_scopes(Event.moderated)
.pluck(:tags).map(&:split).flatten .pluck(:tags).map(&:split).flatten
.group_by { |i| i } .group_by { |i| i }
.map { |k, v| [k, v.size] } .map { |k, v| [k, v.size] }
...@@ -15,7 +18,7 @@ class TagsController < InheritedResources::Base ...@@ -15,7 +18,7 @@ class TagsController < InheritedResources::Base
end end
def show def show
@events_future = Event.moderated.future.tag params[:id] @events_future = apply_scopes(Event).moderated.future.tag params[:id]
@events_past = Event.moderated.past.tag params[:id] @events_past = apply_scopes(Event).moderated.past.tag params[:id]
end end
end end
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter