Skip to content

Commit

Permalink
Add Notable to InfoRequest
Browse files Browse the repository at this point in the history
Allow requests to have notes either concrete or tagged notes.
  • Loading branch information
gbp committed Aug 11, 2022
1 parent 43292df commit b0fb86f
Show file tree
Hide file tree
Showing 3 changed files with 14 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 @@ -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)
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 } %>
5 changes: 5 additions & 0 deletions spec/models/info_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,14 @@
#

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

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

Expand Down

0 comments on commit b0fb86f

Please sign in to comment.