Adds activity tab for system emails
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class Admin::ActivityController < Admin::BaseController
|
||||
has_filters %w{all on_users on_proposals on_debates on_comments}
|
||||
has_filters %w{all on_users on_proposals on_debates on_comments on_system_emails}
|
||||
|
||||
def show
|
||||
@activity = Activity.for_render.send(@current_filter)
|
||||
|
||||
@@ -11,6 +11,7 @@ class Activity < ActiveRecord::Base
|
||||
scope :on_users, -> { where(actionable_type: 'User') }
|
||||
scope :on_comments, -> { where(actionable_type: 'Comment') }
|
||||
scope :on_budget_investments, -> { where(actionable_type: 'Budget::Investment') }
|
||||
scope :on_system_emails, -> { where(actionable_type: 'ProposalNotification') }
|
||||
scope :for_render, -> { includes(user: [:moderator, :administrator]).includes(:actionable) }
|
||||
|
||||
def self.log(user, action, actionable)
|
||||
|
||||
@@ -10,6 +10,7 @@ class ProposalNotification < ActiveRecord::Base
|
||||
validates :proposal, presence: true
|
||||
validate :minimum_interval
|
||||
|
||||
scope :with_hidden, -> { all }
|
||||
scope :public_for_api, -> { where(proposal_id: Proposal.public_for_api.pluck(:id)) }
|
||||
scope :sort_by_created_at, -> { reorder(created_at: :desc) }
|
||||
scope :sort_by_moderated, -> { reorder(moderated: :desc) }
|
||||
|
||||
Reference in New Issue
Block a user