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 Sep 1, 2022
1 parent 8330241 commit fdf8b46
Show file tree
Hide file tree
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
Expand Up @@ -49,6 +49,7 @@ class InfoRequest < ApplicationRecord
include InfoRequest::Sluggable
include InfoRequest::TitleValidation
include Taggable
include Notable

admin_columns exclude: %i[title url_title],
include: %i[rejected_incoming_count]
Expand Down
8 changes: 8 additions & 0 deletions app/views/admin_request/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -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',
Expand Down
5 changes: 5 additions & 0 deletions spec/models/info_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit fdf8b46

Please sign in to comment.