Skip to content

Commit

Permalink
Nicer display of who makes a change
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Sep 11, 2024
1 parent 6d0179b commit 4c37280
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
6 changes: 5 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ gem "rgeo-geojson"
gem "terser"

# For versioning changes in the admin panel
gem "administrate-field-paper_trail"
# Using forked version so we can get access to
# https://github.com/IrvanFza/administrate-field-paper_trail/pull/1/files
# TODO: Move to upstream once this gets merged
gem "administrate-field-paper_trail", github: "DaanVanVugt/administrate-field-paper_trail",
branch: "feature/link-to-whodunnit"
gem "paper_trail"

group :test do
Expand Down
16 changes: 11 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
GIT
remote: https://github.com/DaanVanVugt/administrate-field-paper_trail.git
revision: d523f0b55e426efa978a08aa3bd2f30ccbd1ebfc
branch: feature/link-to-whodunnit
specs:
administrate-field-paper_trail (0.1.0)
administrate (>= 0.2.2)
paper_trail (>= 2.7.2)
rails (>= 5.0)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -90,10 +100,6 @@ GEM
kaminari (~> 1.2.2)
sassc-rails (~> 2.1)
selectize-rails (~> 0.6)
administrate-field-paper_trail (0.1.0)
administrate (>= 0.2.2)
paper_trail (>= 2.7.2)
rails (>= 5.0)
airbrussh (1.5.2)
sshkit (>= 1.6.1, != 1.7.0)
ast (2.4.2)
Expand Down Expand Up @@ -767,7 +773,7 @@ DEPENDENCIES
active_record_doctor
activerecord-postgis-adapter
administrate (~> 0.20.0)
administrate-field-paper_trail
administrate-field-paper_trail!
autoprefixer-rails
aws-sdk-s3
axe-core-capybara
Expand Down
7 changes: 7 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ def name_with_fallback
name.presence || email
end

# This is for the benefit of
# https://github.com/IrvanFza/administrate-field-paper_trail/pull/1/files
sig { returns(String) }
def to_s
name_with_fallback
end

sig { void }
def send_activation_instructions
Users::ActivationMailer.notify(self, set_reset_password_token).deliver_later!
Expand Down

0 comments on commit 4c37280

Please sign in to comment.