rails_spotlight 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe2bf391180544902b468c6ed68f371272495fa84ccf644d190c1ec0e4f5a868
4
- data.tar.gz: 5d83732d8e23910855b239f91252b080734465242a562bea4062e7b6556df53c
3
+ metadata.gz: 251b10d3b271c26da91b3d6c6b41f84eb49f4b6f732d89c4e0f377ead50ae797
4
+ data.tar.gz: bf48a45b74e5fd78f81e7f3b4250f339c7cd39c2ce230efefa4bf2d847898b83
5
5
  SHA512:
6
- metadata.gz: 1a332f557220d87fcd3c01feb4479d926e9a4f837da8bbf269ef9e410fb6b0879879ae43bae2b57ad279f194fa025f61e299617b9633096fb79b0d4036951e71
7
- data.tar.gz: 18439c9382b8ee6f7dbd67a5a31238dfcfcda883bfe1bf5274aeb7e87ea8a2be9ed0c9ec0237545386c7ed340c579f3d2f6f2eedf28aa3a369e12c7d60b4e575
6
+ metadata.gz: 3ec1fe5f5e842f5eb8975e6d19d5eb923b8dfe6425a86c85b650b1781d2f060a61fc866c159d0e940cb488c2d38cb9e72b9c26034d79638b1a7c2319f9c2fe9f
7
+ data.tar.gz: 9ab3ecb3de8b864c850b5b398e82c121cde1a4ecf9184170bb4e2c6f7229cb2306e4df21516f5d8fa60873fbb1bde1901f66358b6a098969ae6f86e0a48cca2f
@@ -62,6 +62,9 @@ module RailsSpotlight
62
62
  # Subscribe to all events relevant to RailsPanel
63
63
  #
64
64
  def self.subscribe
65
+ # Skip RailsSpotlight subscriptions during migrations
66
+ return if migrating?
67
+
65
68
  new
66
69
  .subscribe('rsl.notification.log')
67
70
  .subscribe('sql.active_record', &SQL_BLOCK)
@@ -92,6 +95,12 @@ module RailsSpotlight
92
95
  # such as the collection name and the partial being used to render each item.
93
96
  end
94
97
 
98
+ def self.migrating?
99
+ defined?(Rake) && Rake.application.top_level_tasks.any? do |task|
100
+ task.start_with?('db:migrate', 'db:schema:load')
101
+ end
102
+ end
103
+
95
104
  def subscribe(event_name)
96
105
  ActiveSupport::Notifications.subscribe(event_name) do |*args|
97
106
  event = block_given? ? yield(*args) : Event.new(*args)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsSpotlight
4
- VERSION = '0.3.2'
4
+ VERSION = '0.3.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_spotlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pawel Niemczyk