Skip to content

Commit

Permalink
Add notable to info requests
Browse files Browse the repository at this point in the history
Fixes #6912
  • Loading branch information
gbp committed Aug 26, 2022
1 parent 56db9bb commit 8f79df0
Showing 4 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/info_request.rb
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ class InfoRequest < ApplicationRecord
include InfoRequest::Sluggable
include InfoRequest::TitleValidation
include Taggable
include Notable

@non_admin_columns = %w(title url_title)
@additional_admin_columns = %w(rejected_incoming_count)
8 changes: 8 additions & 0 deletions app/views/admin_request/show.html.erb
Original file line number Diff line number Diff line change
@@ -416,3 +416,11 @@
<%= render partial: 'admin_censor_rule/show',
locals: { censor_rules: @info_request.applicable_censor_rules,
info_request: @info_request } %>

<hr>

<h2>Notes</h2>

<%= render partial: 'admin/notes/show',
locals: { notes: @info_request.all_notes,
notable: @info_request } %>
2 changes: 2 additions & 0 deletions app/views/request/show.html.erb
Original file line number Diff line number Diff line change
@@ -35,6 +35,8 @@
old_unclassified: @old_unclassified } %>

<div id="left_column" class="left_column">
<%= render_notes(@info_request.all_notes) %>

<% @info_request.info_request_events.each do |info_request_event| %>
<% if info_request_event.visible %>
<%= render partial: 'request/correspondence',
5 changes: 5 additions & 0 deletions spec/models/info_request_spec.rb
Original file line number Diff line number Diff line change
@@ -37,10 +37,15 @@

require 'spec_helper'
require 'models/concerns/info_request/title_validation'
require 'models/concerns/notable'
require 'models/concerns/notable_and_taggable'

RSpec.describe InfoRequest do
it_behaves_like 'concerns/info_request/title_validation',
FactoryBot.build(:info_request)
it_behaves_like 'concerns/notable', FactoryBot.build(:info_request)
it_behaves_like 'concerns/notable_and_taggable',
FactoryBot.build(:info_request)

describe '.internal' do
subject { described_class.internal }

0 comments on commit 8f79df0

Please sign in to comment.