is_this_used 0.1.9 → 0.1.12

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: 7333e18fec859a0754f59c6ae4c7abc28318a6d20397c2ffbc82296f648a8cbd
4
- data.tar.gz: 7017a6db53df6f0ef4272fb8c261a49b20afebe7b0cd751642489032ce2a984b
3
+ metadata.gz: 2b45e5ae45262a6793a2d31dbc938dc1ca7dce14c41badab9f098281010c0fd7
4
+ data.tar.gz: 83027360fc9f6ea7eb6f5209bf76e26f812acc1a6f017d25ae8c102e8dc384d5
5
5
  SHA512:
6
- metadata.gz: b78237aeeec84048d107a105c65ea685c051dbf468155cd4b06444507d0b5ef19114a50d609f2268cab16fd461515468e0866082a6fad829a30cbe4908b9f4b0
7
- data.tar.gz: b9b4701f1d3b36b7f1a9876772f2e0386ac34c861698a7c35095ea1b15d4cd9626fcc1bd191a3be78712234d142a3c07be1672499895d358a7f03d6d307de91b
6
+ metadata.gz: 7a563b281bf91261a8796ee3cf96ca7b93856f40e97db803aff7139bf554cfbf9fb9965bee06afa7e8b27f1571d14067aa6f9fbce087cb070dabeaad7c143e37
7
+ data.tar.gz: 0116de239d46752d0240b6b76aadc56c7962f3e64b7e19f39080e7fa1a11eee73d9f7bd8a61287eb53b71d24604706f303529e0b6bd1d3a0941cc2719221ab78
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- is_this_used (0.1.9)
4
+ is_this_used (0.1.12)
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.9)
4
+ is_this_used (0.1.12)
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.9)
4
+ is_this_used (0.1.12)
5
5
  activerecord (>= 5.2)
6
6
 
7
7
  GEM
@@ -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|
@@ -109,7 +111,11 @@ module IsThisUsed
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?'
115
+ )
116
+ rescue NoMethodError
117
+ Rails.logger.warn(
118
+ 'There was an error recording potential cruft. Have migrations been run?'
113
119
  )
114
120
  rescue Mysql2::Error::ConnectionError, ActiveRecord::ConnectionNotEstablished
115
121
  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.9'
4
+ VERSION = '0.1.12'
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.9
4
+ version: 0.1.12
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