diff --git a/Gemfile b/Gemfile index f19a85255..5c24d6f1e 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index 64d3f1627..f956057a1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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: @@ -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) @@ -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 diff --git a/app/models/user.rb b/app/models/user.rb index 6472cf381..4b1510902 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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!