rails_spotlight 0.3.2 → 0.3.5

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: cad3b5a0625c0bbe18a749bd2ea5ea2fda11d235917b2c518125364aaf540562
4
+ data.tar.gz: dcd4f115cec94cca2671df28ac6f111bd305e00e00391f7fdf1b4e6d2c9846a1
5
5
  SHA512:
6
- metadata.gz: 1a332f557220d87fcd3c01feb4479d926e9a4f837da8bbf269ef9e410fb6b0879879ae43bae2b57ad279f194fa025f61e299617b9633096fb79b0d4036951e71
7
- data.tar.gz: 18439c9382b8ee6f7dbd67a5a31238dfcfcda883bfe1bf5274aeb7e87ea8a2be9ed0c9ec0237545386c7ed340c579f3d2f6f2eedf28aa3a369e12c7d60b4e575
6
+ metadata.gz: b82a68c8915d42c93370d8007c9c8b2bed94cf253c6cd4c82b728cb514ef11d0e3d8f3d96dd478f851afcb18e04f89d99c48e4d6b691205ddd7a1c6d1abcbd63
7
+ data.tar.gz: 56119e84a018d3f2e6370c70204d2648d644211d89bac1327735ebf356556f8ac0e3ddb538c321702bf85e1a191dbe7c5075168cbf3c828d0e64dcc148a091fe
@@ -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', 'db:rollback')
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)
@@ -6,7 +6,12 @@ require 'erb'
6
6
  module RailsSpotlight
7
7
  class Configuration # rubocop:disable Metrics/ClassLength
8
8
  DEFAULT_NOT_ENCODABLE_EVENT_VALUES = {
9
- 'ActiveRecord' => ['ActiveRecord::ConnectionAdapters::AbstractAdapter'],
9
+ 'ActiveRecord' => [
10
+ 'ActiveRecord::ConnectionAdapters::AbstractAdapter',
11
+ 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter',
12
+ 'ActiveRecord::ConnectionAdapters::RealTransaction',
13
+ 'ActiveRecord::SchemaMigration'
14
+ ],
10
15
  'ActionDispatch' => ['ActionDispatch::Request', 'ActionDispatch::Response']
11
16
  }.freeze
12
17
 
@@ -47,7 +47,7 @@ module RailsSpotlight
47
47
  begin
48
48
  value.to_json(methods: [:duration])
49
49
  new_value = value
50
- rescue StandardError
50
+ rescue StandardError, SystemStackError
51
51
  new_value = NOT_JSON_ENCODABLE
52
52
  end
53
53
  hash[key] = new_value
@@ -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.5'
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.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pawel Niemczyk