paper_trail-rails 0.2.2 → 0.2.3

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: f5bb565d9f1560cbced48f6e7267b0f5bfd71a126aab0abca1552593051ef778
4
- data.tar.gz: bea208743f7f24e024fb31166235b37d494408a1147dc6adad860802d3208dc4
3
+ metadata.gz: a14851db42cf2986af3baf39c5735dd9745bfc6f459f20e4aedc2f8ecf022649
4
+ data.tar.gz: 9ea747250109546f8c95c54f9b06fc46bc21a7fb0f257da2623fe2821c4106db
5
5
  SHA512:
6
- metadata.gz: e82586b772678e3457ce068ac2aa54daab949702d4cddef94abbeae360eb57360cb8bc5fb5564d4196e4406cbdeabf05b2877e6260b3178117e0d0c79cf40f8d
7
- data.tar.gz: d3f121829e868e56ec1d1efc19be968a631e64a3b5def419c7781b6a8a60c472e711a3769a0777b5e1b00751bfe388248f8c042a5fa398906a94e1c213d2fc2a
6
+ metadata.gz: 7201ea122f32641ed01a86f08121429a6ef3e42fa34a4a91383b90b7664cfb3d17492d548f23219fb26cf3537fb88c8639420ceb8769b83c7066a27369d804e3
7
+ data.tar.gz: 786a7924be70ba0e01cd468af291057b5f988fefc25e6db83c5e0d48ab27082b7befaf52d82bf13f8561bc3f12a5b976f93bba74d585b5ce78d26dfc4b740f0b
@@ -1,3 +1,8 @@
1
+ ## 0.3.0 (2019-09-16)
2
+ - Fix: When running db:migrate:redo, command got recorded as "rails db:migrate:redo VERSION=2019…"
3
+ instead of as "rails db:migrate: MigrationName (up)" as intended.
4
+ - Add `config.source_location_filter`
5
+
1
6
  ## 0.2.2 (2019-07-18)
2
7
  - Fix: undefined method `user_for_test' when running `rails console -e test`
3
8
 
@@ -30,7 +30,7 @@ module PaperTrail
30
30
  command: "#{File.basename($PROGRAM_NAME)} #{ARGV.join ' '}",
31
31
  source_location: caller.find { |line|
32
32
  line.starts_with? ::Rails.root.to_s and
33
- !line.starts_with? __FILE__
33
+ config.source_location_filter.(line)
34
34
  }
35
35
  )
36
36
  end
@@ -6,6 +6,7 @@ module PaperTrail
6
6
 
7
7
  config.select_user_filter = :itself
8
8
  config.select_user_other_allowed_values = ['system', 'admin']
9
+ config.source_location_filter = ->(line) { !line.match /paper_trail/ }
9
10
  end
10
11
 
11
12
  # Filter proc to use to show a list of users in select_user helper. For example:
@@ -16,6 +17,8 @@ module PaperTrail
16
17
  attr_accessor :select_user_filter
17
18
 
18
19
  attr_accessor :select_user_other_allowed_values
20
+
21
+ attr_accessor :source_location_filter
19
22
  end
20
23
  end
21
24
  end
@@ -2,6 +2,8 @@ module PaperTrail
2
2
  module Rails
3
3
  module RecordMigrationNameInVersion
4
4
  def exec_migration(conn, direction)
5
+ PaperTrail.request.whodunnit = nil
6
+ PaperTrail::Rails.set_default_metadata
5
7
  PaperTrail.update_metadata(
6
8
  command: "rails db:migrate: #{self.name} (#{direction})"
7
9
  )
@@ -1,7 +1,7 @@
1
1
  module PaperTrail
2
2
  module Rails
3
3
  def self.version
4
- "0.2.2"
4
+ "0.2.3"
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.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Rick
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-18 00:00:00.000000000 Z
11
+ date: 2019-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paper_trail