Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/controllers/thredded/moderation_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def history
.send(Kaminari.config.page_method_name, current_page)
.preload(:messageboard, :post_user, :moderator, post: :postable)
.preload_first_topic_post
authorize @post_moderation_records
end

def activity
Expand Down
14 changes: 14 additions & 0 deletions app/policies/thredded/post_moderation_record_policy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

module Thredded
class PostModerationRecordPolicy
def initialize(user, scope)
@user = user
@scope = scope
end

def history?
true
end
end
end
10 changes: 10 additions & 0 deletions spec/controllers/thredded/moderation_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,14 @@
expect(response).to be_successful
expect(assigns(:posts).to_a.length).to eq(1)
end

it 'GET #history' do
create(:topic, with_posts: 1)
get :history
end

it 'GET #activity' do
create(:topic, with_posts: 1)
get :activity
end
end