debugbar 0.3.0 → 0.3.1

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: 21eb9bf1086b2890a2b6d0ecdcc04e901ef902b5de0593630320ee107ab8ea2a
4
- data.tar.gz: 94e7e6f98f27b86ff2f28bbc915b20086ac5350b349c138d796fe051323141a1
3
+ metadata.gz: 9533b2b578ca8071254a691d573f41708598945ab8ee666d45655f65f6b30730
4
+ data.tar.gz: 4aba711679f6a65212f6fa88d543108e64c9a33f3fd99c59a3566d032f67e26b
5
5
  SHA512:
6
- metadata.gz: c352157d378dae219d2a84f2482ebb102f552891af731f44d44357514cee04b5fd2d83ad766e21b5dfd5b9d7abe47b16250ea964e19c7fe1b89e85e005fa7bcd
7
- data.tar.gz: 5be2a2ff6dd67a5aa27d7daf00cebd0cc161d956235192b1f4a10691e6437fd5828006d996ea11627e6eb56e5da4354c3ea4fb95a7de3f88c24abb0c9ea1e095
6
+ metadata.gz: 92d5d50ff82b3087cd332133e5c87733a7b2dc4eaa46c65fe4f5cac909d064a4a1c65612650a1eb10b18350272c8ae3f205663571793635c64a59369cb8aa545
7
+ data.tar.gz: fd282177ec09843ab1a90ab9a71bb0838225e9958e2d443175faa3f60b8c5b87f7f78ca11bf8a867f671d906d045a0f87508ccc2c777e126f965fdd00161a3d2
data/CHANGELOG.md CHANGED
@@ -1,11 +1,40 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.3.1 - 2024-05-01
4
+
5
+ * Add `active_record.adapter` config to help frontend format SQL queries - See [#35](https://github.com/julienbourdeau/debugbar/pull/35)
6
+ * Add `minimized` config key to start the debugbar minimized - See [2046b054](https://github.com/julienbourdeau/debugbar/commit/0178443d268d2a740a0d73b4039a03dd)
7
+ * Use `:null_session` to disable forgery protection when using polling - See [#27](https://github.com/julienbourdeau/debugbar/pull/27)
8
+
3
9
  ## v0.3.0 - 2024-03-31
4
10
 
5
11
  * Add support for Turbo Drive - See [#25](https://github.com/julienbourdeau/debugbar/pull/25) and [#26](https://github.com/julienbourdeau/debugbar/pull/26)
6
12
  * Fix error "undefined method `adapter_name' for ActiveJob:Module" for Rails < 7.1 - See [#24](https://github.com/julienbourdeau/debugbar/pull/24)
7
13
  * Limit the number of request to 25, configurable with `maxRequests` option - See [664f2c11](https://github.com/julienbourdeau/debugbar/commit/664f2c11e56f18a7c3e4a9fb83ba5b7e19fbb9a9)
8
14
 
15
+ ### Breaking changes
16
+
17
+ In order to support Turbo Drive, I had to split the helper into two parts. Before the JavaScript file was loaded,
18
+ directly in the body, but it has to be loaded in the head now.
19
+
20
+ If you were passing configuation t `debugbar_javascript`, you must now pass it to `debugbar_body`.
21
+
22
+ ```diff
23
+ <!DOCTYPE html>
24
+ <html>
25
+ <head>
26
+ ...
27
+ + <%= debugbar_head %>
28
+ </head>
29
+
30
+ <body>
31
+ ...
32
+ - <%= debugbar_javascript %>
33
+ + <%= debugbar_body %>
34
+ </body>
35
+ </html>
36
+ ```
37
+
9
38
  ## v0.2.0 - 2024-02-28
10
39
 
11
40
  * Introduce polling in case someone cannot use ActiveCable - See [8b262be7](https://github.com/julienbourdeau/debugbar/commit/8b262be7b644c7b587a6c3348bb02076053a344f)
@@ -1,6 +1,6 @@
1
1
  module Debugbar
2
2
  class PollingController < ApplicationController
3
- skip_before_action :verify_authenticity_token, only: [:confirm]
3
+ protect_from_forgery with: :null_session
4
4
  before_action :cors_set_access_control_headers
5
5
 
6
6
  def poll
@@ -13,6 +13,10 @@ module Debugbar::TagHelpers
13
13
  opt[:mode] = 'poll'
14
14
  end
15
15
 
16
+ if opt[:active_record].nil?
17
+ opt[:active_record] = { adapter: db_adapter }
18
+ end
19
+
16
20
  html = <<-HTML
17
21
  <div id="__debugbar" data-turbo-permanent></div>
18
22
  HTML
@@ -35,4 +39,10 @@ module Debugbar::TagHelpers
35
39
  errors << ""
36
40
  raise errors.join("\n")
37
41
  end
42
+
43
+ private
44
+
45
+ def db_adapter
46
+ ActiveRecord::Base.connection.adapter_name.downcase
47
+ end
38
48
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Debugbar
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end