Class: Decidim::LastActivity

Inherits:
Query
  • Object
show all
Defined in:
decidim-core/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

PublicActivities

Instance Method Summary collapse

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 'decidim-core/app/queries/decidim/last_activity.rb', line 10

def initialize(organization, options = {})
  @organization = organization
  @current_user = options[:current_user]
end

Instance Method Details

#queryObject



15
16
17
18
19
20
21
22
23
# File 'decidim-core/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