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
class TagsController < InheritedResources::Base
has_scope :region, :locality, :tag, :daylimit
has_scope :period, type: :hash, using: [:year, :week]
def index
@tags = Event
@tags = apply_scopes(Event.moderated)
.pluck(:tags).map(&:split).flatten
.group_by { |i| i }
.map { |k, v| [k, v.size] }
......@@ -15,7 +18,7 @@ class TagsController < InheritedResources::Base
end
def show
@events_future = Event.moderated.future.tag params[:id]
@events_past = Event.moderated.past.tag params[:id]
@events_future = apply_scopes(Event).moderated.future.tag params[:id]
@events_past = apply_scopes(Event).moderated.past.tag params[:id]
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