Skip to content

Commit c70a044

Browse files
authored
Merge pull request #65 from amatsuda/mask_email
Mask from address emails on messages
2 parents c572ac8 + 13aa433 commit c70a044

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ gem "stimulus-rails"
2626

2727
gem 'tailwindcss-rails'
2828

29+
gem 'active_decorator'
30+
2931
# Use Redis adapter to run Action Cable in production
3032
# gem "redis", ">= 4.0.1"
3133

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ GEM
4444
erubi (~> 1.11)
4545
rails-dom-testing (~> 2.2)
4646
rails-html-sanitizer (~> 1.6)
47+
active_decorator (1.5.1)
48+
activesupport
4749
activejob (8.0.3)
4850
activesupport (= 8.0.3)
4951
globalid (>= 0.3.6)
@@ -347,6 +349,7 @@ PLATFORMS
347349
x86_64-linux-musl
348350

349351
DEPENDENCIES
352+
active_decorator
350353
aws-sdk-s3 (~> 1)
351354
bootsnap
352355
brakeman
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
module MessageDecorator
4+
def from
5+
super&.gsub(/@[a-zA-Z.\-]+/, '@...')
6+
end
7+
end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# frozen_string_literal: true
2+
3+
require 'test_helper'
4+
5+
class MessageDecoratorTest < ActiveSupport::TestCase
6+
def setup
7+
@message = Message.new.extend MessageDecorator
8+
end
9+
10+
# test "the truth" do
11+
# assert true
12+
# end
13+
end

0 commit comments

Comments
 (0)