Class: Decidim::LastActivity
- Defined in:
- app/queries/decidim/last_activity.rb
Overview
This query finds the public ActionLog entries that can be shown in the activities views of the application within a Decidim Organization. It is intended to be used in the “Last activities” content block in the homepage, and also in the “Last activities” page, to retrieve public activity of this organization.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(organization, options = {}) ⇒ LastActivity
constructor
A new instance of LastActivity.
- #query ⇒ Object
Methods inherited from Query
#cached_query, #each, #eager?, #exists?, merge, #none?, #relation?, #|
Constructor Details
#initialize(organization, options = {}) ⇒ LastActivity
Returns a new instance of LastActivity.
10 11 12 13 |
# File 'app/queries/decidim/last_activity.rb', line 10 def initialize(organization, = {}) @organization = organization @current_user = [:current_user] end |
Instance Method Details
#query ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'app/queries/decidim/last_activity.rb', line 15 def query @query ||= begin query = base_query query = filter_moderated(query) query = filter_spaces(query) query = filter_deleted(query) query.with_new_resource_type("all") end end |