Class: Decidim::LastActivity
- Inherits:
-
Query
- Object
- Query
- Decidim::LastActivity
- 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.
Instance Method Summary collapse
-
#initialize(organization) ⇒ LastActivity
constructor
A new instance of LastActivity.
- #query ⇒ Object
Constructor Details
#initialize(organization) ⇒ LastActivity
Returns a new instance of LastActivity.
10 11 12 |
# File 'decidim-core/app/queries/decidim/last_activity.rb', line 10 def initialize(organization) @organization = organization end |
Instance Method Details
#query ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'decidim-core/app/queries/decidim/last_activity.rb', line 14 def query ActionLog .where( organization: @organization, visibility: %w(public-only all) ) .with_new_resource_type("all") .order(created_at: :desc) end |