paper_trail-rails 0.4.0 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46c7ec10c6ff25dde513b4bbc0201aa897d8d6dab53eb68403704c687ba67050
4
- data.tar.gz: 75825da982f15ad55fec3e28bd233d2553f4b80f70c5ec37e5f2ce64d0730bd2
3
+ metadata.gz: e89af0157d160e6aab5edf01697d9528223a25d583aff72d03452296967adfce
4
+ data.tar.gz: 3fc1fb341feb826de4b06e78b9dec334dac3ea7d797730eb2851200bdb8ffb92
5
5
  SHA512:
6
- metadata.gz: e2e4b492d8a3015449bedfe712c97a66d30fa3157a4b62a45d6e65d91c89044adc5ad384b8fe3258ad1ca9a8b306f764c8ffac9fd327ff5bca9d794b8a7b4235
7
- data.tar.gz: d5878b0446630d09ade880658c9b8a4cedfca0c79c3af55d420d989a852f6f8acd5f28b8dca313aae79d433d040113a05e2e4e4648c9bdc77172fa281d212864
6
+ metadata.gz: b8d1e399f0afbcaac11dea522ebe1988c8ab2e079f0704e2f3f8ff465c0fecbac51c14adb324bc37b2329a438b6d00ad175202af049bda6d2d8c588b8102f25a
7
+ data.tar.gz: 9f372e1d62f07604002833c18ea03f18500c7aaa11679e62260dbe06ac5f700c3ec4fb4e6752b95e15b0296a1b82e6a625fc879871f5e572a5689ab3472d918f
@@ -50,7 +50,7 @@ module PaperTrail
50
50
  end
51
51
  end
52
52
 
53
- class Engine
53
+ class Railtie
54
54
  initializer "paper_trail-rails.set_default_metadata" do |app|
55
55
  # There's no way to set up deferred evaluation of PaperTrail.request.controller_info from
56
56
  # here like we can with whodunnit, so abuse that property of PaperTrail.request.whodunnit to
@@ -80,10 +80,10 @@ module PaperTrail
80
80
  end
81
81
  )
82
82
 
83
- if config.console.ask_for_reason
83
+ if config.console.ask_for_reason && PaperTrail.request.controller_info[:reason].nil?
84
84
  @paper_trail_reason ||= PaperTrail::Rails.get_reason(required: config.console.require_reason)
85
+ PaperTrail.update_metadata reason: @paper_trail_reason
85
86
  end
86
- PaperTrail.update_metadata reason: @paper_trail_reason
87
87
 
88
88
  @paper_trail_whodunnit
89
89
  }
@@ -1,12 +1,14 @@
1
- # paper_trail gem also provides a Railtie (Engine) in this require. It seems to
2
- # work to just add initializers to that existing Railtie. If needed, though, we
3
- # could define a different one, like "Railtie".
4
1
  require 'rails'
5
- require 'paper_trail/frameworks/rails/engine'
2
+ require 'paper_trail/frameworks/rails'
6
3
 
7
4
  module PaperTrail
8
5
  module Rails
9
- class Engine
6
+ # lib/paper_trail/rails/console.rb adds an initializer to this Railtie.
7
+ #
8
+ # paper_trail gem also provides a Railtie, PaperTrail::Railtie
9
+ # (paper_trail/frameworks/rails/railtie.rb), but that is different from this one.
10
+ #
11
+ class Railtie < ::Rails::Railtie
10
12
  end
11
13
  end
12
14
  end
@@ -1,7 +1,7 @@
1
1
  module PaperTrail
2
2
  module Rails
3
3
  def self.version
4
- "0.4.0"
4
+ "0.5.2"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paper_trail-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Rick
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-24 00:00:00.000000000 Z
11
+ date: 2022-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paper_trail
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  - !ruby/object:Gem::Version
129
129
  version: '0'
130
130
  requirements: []
131
- rubygems_version: 3.0.3
131
+ rubygems_version: 3.3.3
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Integrate with rails console and migrations. In rails console, ask who is