bullet 7.1.5 → 7.1.6

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: 4ab16fc9ca893dbbc4fe755f9abe72e769f2e03b8405edf3189f0b92a17a75b5
4
- data.tar.gz: 1072d72f4e58e28fa6e1a9f6337980e34a07897a146e3d9d5b060fa7e7923816
3
+ metadata.gz: 752fed6e96f9ea5c1baefca2e9a80ea3aefa13c279d24688f3341d18c8334afc
4
+ data.tar.gz: 78edabbca2c71e9c6d2c793bd3786d5b826f4530664aa18e7cd42cb059a85373
5
5
  SHA512:
6
- metadata.gz: 10b11f86e3f57dfe5e58b64b384f90b86eb98ed71768c077f07af802b0a1646c4ddbb2bca876e8ff8a5ecd9a8dc008a41cece6c4c26819e04c386855ffd3d23d
7
- data.tar.gz: 12629a5920c40d5471a2737d6b9ac0148b852127f796b2534a5cf87958ad24a5d69dfdc9c6cd7b4a66f807f492884a32be5af19cbeee7f364515d1f213a97882
6
+ metadata.gz: 5cad943f3641de44f17da3fe2062ed83525d0bbb1d4321208f55b4d05d6a43840f25fe0728fa4e10f42701dd8ef4eaa2322ca9ab8c8d6a2e7d7067c70d0d3186
7
+ data.tar.gz: a58309dcbfaadbb9f67352c0a1730be8397c2522ef403093fcf58a8fdcc596b45e961d39b239e40412d46d98a50033ed02398efc70df4314631bd16e220a7c88
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Next Release
2
2
 
3
+ ## 7.1.6 (01/16/2024)
4
+
5
+ * Allow apps to not include the user in a notification
6
+
3
7
  ## 7.1.5 (01/05/2024)
4
8
 
5
9
  * Fix mongoid8
@@ -10,7 +14,7 @@
10
14
 
11
15
  ## 7.1.3 (11/05/2023)
12
16
 
13
- * Call NPlusOneQuery's call_association when calling count on collection assocation
17
+ * Call NPlusOneQuery's call_association when calling count on collection association
14
18
 
15
19
  ## 7.1.2 (10/13/2023)
16
20
 
@@ -268,7 +272,7 @@
268
272
 
269
273
  ## 4.5.0 (03/24/2013)
270
274
 
271
- * Add api way to access captured associatioin
275
+ * Add api way to access captured association
272
276
  * Allow disable n_plus_one_query, unused_eager_loading and counter_cache respectively
273
277
  * Add whitelist
274
278
 
data/README.md CHANGED
@@ -102,6 +102,7 @@ The code above will enable all of the Bullet notification systems:
102
102
  * `Bullet.slack`: add notifications to slack
103
103
  * `Bullet.raise`: raise errors, useful for making your specs fail unless they have optimized queries
104
104
  * `Bullet.always_append_html_body`: always append the html body even if no notifications are present. Note: `console` or `add_footer` must also be true. Useful for Single Page Applications where the initial page load might not have any notifications present.
105
+ * `Bullet.skip_user_in_notification`: exclude the OS user (`whoami`) from notifications.
105
106
 
106
107
 
107
108
  Bullet also allows you to disable any of its detectors.
@@ -51,11 +51,22 @@ module Bullet
51
51
  end
52
52
 
53
53
  def short_notice
54
- [whoami.presence, url, title, body].compact.join(' ')
54
+ parts = []
55
+ parts << whoami.presence unless Bullet.skip_user_in_notification
56
+ parts << url
57
+ parts << title
58
+ parts << body
59
+
60
+ parts.compact.join(' ')
55
61
  end
56
62
 
57
63
  def notification_data
58
- { user: whoami, url: url, title: title, body: body_with_caller }
64
+ hash = {}
65
+ hash[:user] = whoami unless Bullet.skip_user_in_notification
66
+ hash[:url] = url
67
+ hash[:title] = title
68
+ hash[:body] = body_with_caller
69
+ hash
59
70
  end
60
71
 
61
72
  def eql?(other)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bullet
4
- VERSION = '7.1.5'
4
+ VERSION = '7.1.6'
5
5
  end
data/lib/bullet.rb CHANGED
@@ -40,7 +40,11 @@ module Bullet
40
40
  :stacktrace_excludes,
41
41
  :skip_html_injection
42
42
  attr_reader :safelist
43
- attr_accessor :add_footer, :orm_patches_applied, :skip_http_headers, :always_append_html_body
43
+ attr_accessor :add_footer,
44
+ :orm_patches_applied,
45
+ :skip_http_headers,
46
+ :always_append_html_body,
47
+ :skip_user_in_notification
44
48
 
45
49
  available_notifiers =
46
50
  UniformNotifier::AVAILABLE_NOTIFIERS.select { |notifier| notifier != :raise }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.1.5
4
+ version: 7.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-05 00:00:00.000000000 Z
11
+ date: 2024-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport