Skip to content
Merged
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
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ gem "stimulus-rails"

gem 'tailwindcss-rails'

gem 'active_decorator'

# Use Redis adapter to run Action Cable in production
# gem "redis", ">= 4.0.1"

Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ GEM
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
active_decorator (1.5.1)
activesupport
activejob (8.0.3)
activesupport (= 8.0.3)
globalid (>= 0.3.6)
Expand Down Expand Up @@ -347,6 +349,7 @@ PLATFORMS
x86_64-linux-musl

DEPENDENCIES
active_decorator
aws-sdk-s3 (~> 1)
bootsnap
brakeman
Expand Down
7 changes: 7 additions & 0 deletions app/decorators/message_decorator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

module MessageDecorator
def from
super&.gsub(/@[a-zA-Z.\-]+/, '@...')
end
end
13 changes: 13 additions & 0 deletions test/decorators/message_decorator_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

require 'test_helper'

class MessageDecoratorTest < ActiveSupport::TestCase
def setup
@message = Message.new.extend MessageDecorator
end

# test "the truth" do
# assert true
# end
end