Skip to content

Commit

Permalink
Extract stripping prominence_reason attribute
Browse files Browse the repository at this point in the history
This is shared across all classes which include `MessageProminence` so
can be extracted.
  • Loading branch information
gbp committed Oct 7, 2022
1 parent 05849aa commit 1e1e401
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 6 deletions.
1 change: 1 addition & 0 deletions app/models/concerns/message_prominence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module MessageProminence
extend ActiveSupport::Concern

included do
strip_attributes only: [:prominence_reason]
validates_inclusion_of :prominence, in: self.prominence_states
end

Expand Down
2 changes: 0 additions & 2 deletions app/models/foi_attachment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
class FoiAttachment < ApplicationRecord
include MessageProminence

strip_attributes only: [:prominence_reason]

belongs_to :incoming_message,
:inverse_of => :foi_attachments

Expand Down
2 changes: 0 additions & 2 deletions app/models/incoming_message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ class IncomingMessage < ApplicationRecord
include CacheAttributesFromRawEmail
include Taggable

strip_attributes only: [:prominence_reason]

MAX_ATTACHMENT_TEXT_CLIPPED = 1000000 # 1Mb ish

belongs_to :info_request,
Expand Down
2 changes: 0 additions & 2 deletions app/models/outgoing_message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ class OutgoingMessage < ApplicationRecord
include LinkToHelper
include Taggable

strip_attributes only: [:prominence_reason]

STATUS_TYPES = %w(ready sent failed).freeze
MESSAGE_TYPES = %w(initial_request followup).freeze
WHAT_DOING_VALUES = %w(normal_sort
Expand Down

0 comments on commit 1e1e401

Please sign in to comment.