is_this_used 0.1.8 → 0.1.11

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: 6d99ea88778f65e0685fa42ec856e9a61b5414ad87e1963f21f8d8941ee62eea
4
- data.tar.gz: 7f5bf7cb77f3688c14035480a1ed16130998f004a6add05afc125bd18f21b6fa
3
+ metadata.gz: 4abf2fd80c83d0bb580066755b650e74538f9f3b77494d400528b33efa03eedb
4
+ data.tar.gz: 90185ef813d1d14182b20d1a4cbf4ea6d358867edd8e8b958c8f06ec82636ffe
5
5
  SHA512:
6
- metadata.gz: 5e7acfe828e892998c319ca07bc6bc2ff2bf91c5c2e9e65debbb67f7aacd9c07f9561af8e2fc37dfc140f2ade3d97530fcaf5b9e65a5c13b8a15c60320cc0c92
7
- data.tar.gz: dc4363da4d9030568766e2d37cf2c932f5b5bf35d8c5b20d6587c45f12f3c4953357048155e9664523059da54e4d3f8e534578ebd9bc76d9e601c55bb46888b6
6
+ metadata.gz: 9f8139f3bdc1006462040512f875697043079c9acdf70738b8388afa1108bc7cb44b89e17f38b40b6d8dfac9138317cbaff645f42fa07b4c9782b1a821c32e3b
7
+ data.tar.gz: 6d569fafa4e91e7d29727989e35386981a5f095b384cd4b38f230db22aead2d87dd125a6bbf364ae10a8b92fddf48f6cfbbd8be57087318ff62df24aaada795b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- is_this_used (0.1.7)
4
+ is_this_used (0.1.11)
5
5
  activerecord (>= 5.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- is_this_used (0.1.7)
4
+ is_this_used (0.1.11)
5
5
  activerecord (>= 5.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- is_this_used (0.1.7)
4
+ is_this_used (0.1.11)
5
5
  activerecord (>= 5.2)
6
6
 
7
7
  GEM
@@ -8,6 +8,9 @@ module IsThisUsed
8
8
  potential_cruft.update(deleted_at: Time.current)
9
9
  end
10
10
  end
11
+ rescue StandardError
12
+ # I'm actively ignoring all errors. Chances are, these are due to something like running rake
13
+ # tasks in CI when the DB doesn't already exist.
11
14
  end
12
15
  end
13
16
  end
@@ -87,6 +87,8 @@ module IsThisUsed
87
87
  method_type: method_type
88
88
  )
89
89
 
90
+ potential_cruft.update(deleted_at: nil) if potential_cruft.deleted_at.present?
91
+
90
92
  IsThisUsed::Registry.instance << potential_cruft
91
93
 
92
94
  target_method.owner.define_method target_method.name do |*args|
@@ -105,11 +107,11 @@ module IsThisUsed
105
107
  end
106
108
  end
107
109
  end
108
- rescue ActiveRecord::StatementInvalid => e
110
+ rescue ActiveRecord::StatementInvalid, NoMethodError => e
109
111
  raise unless e.cause.present? && e.cause.instance_of?(Mysql2::Error)
110
112
 
111
113
  Rails.logger.warn(
112
- 'There was an error recording potential cruft. Does the potential_crufts table exist?'
114
+ 'There was an error recording potential cruft. Does the potential_crufts table exist? Have migrations been run?'
113
115
  )
114
116
  rescue Mysql2::Error::ConnectionError, ActiveRecord::ConnectionNotEstablished
115
117
  Rails.logger.warn(
@@ -5,7 +5,9 @@ module IsThisUsed
5
5
  initializer "is_this_used_railtie.configure_post_initialize_cleanup" do
6
6
 
7
7
  config.after_initialize do
8
- IsThisUsed::CruftCleaner.clean🧹
8
+ if Rails.application.config.eager_load
9
+ IsThisUsed::CruftCleaner.clean🧹
10
+ end
9
11
  end
10
12
 
11
13
  rescue StandardError
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IsThisUsed
4
- VERSION = '0.1.8'
4
+ VERSION = '0.1.11'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: is_this_used
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug Hughes
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-08 00:00:00.000000000 Z
11
+ date: 2022-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord