bullet 7.1.4 → 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: 5f9b086db84fa8fdafa36938f0b7bf8f54d7a9c2602df6eb1359fb8754c73e99
4
- data.tar.gz: 10b7f19f4b16f083bda3fb76c79ed7f46511e9be1f64a11b80f8b3560a93ace2
3
+ metadata.gz: 752fed6e96f9ea5c1baefca2e9a80ea3aefa13c279d24688f3341d18c8334afc
4
+ data.tar.gz: 78edabbca2c71e9c6d2c793bd3786d5b826f4530664aa18e7cd42cb059a85373
5
5
  SHA512:
6
- metadata.gz: 35caac02b6152db8d67dbe2ea35df8d2f60171f4855eb12143edf64b76fdb14bc52b59e4d2eb730d57ed5e84d7c7d98cda297e039a62bc857cd0a00b765b1e4c
7
- data.tar.gz: ad948041bbf2b075de093c9e751118e0b44e1196feb43a95073f6f6b036944f144233374f0142af0add48150cb6735af458713c7c684f6fe7955a492caf67f80
6
+ metadata.gz: 5cad943f3641de44f17da3fe2062ed83525d0bbb1d4321208f55b4d05d6a43840f25fe0728fa4e10f42701dd8ef4eaa2322ca9ab8c8d6a2e7d7067c70d0d3186
7
+ data.tar.gz: a58309dcbfaadbb9f67352c0a1730be8397c2522ef403093fcf58a8fdcc596b45e961d39b239e40412d46d98a50033ed02398efc70df4314631bd16e220a7c88
data/CHANGELOG.md CHANGED
@@ -1,12 +1,20 @@
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
+
7
+ ## 7.1.5 (01/05/2024)
8
+
9
+ * Fix mongoid8
10
+
3
11
  ## 7.1.4 (11/17/2023)
4
12
 
5
13
  * Call association also on through reflection
6
14
 
7
15
  ## 7.1.3 (11/05/2023)
8
16
 
9
- * Call NPlusOneQuery's call_association when calling count on collection assocation
17
+ * Call NPlusOneQuery's call_association when calling count on collection association
10
18
 
11
19
  ## 7.1.2 (10/13/2023)
12
20
 
@@ -264,7 +272,7 @@
264
272
 
265
273
  ## 4.5.0 (03/24/2013)
266
274
 
267
- * Add api way to access captured associatioin
275
+ * Add api way to access captured association
268
276
  * Allow disable n_plus_one_query, unused_eager_loading and counter_cache respectively
269
277
  * Add whitelist
270
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.
@@ -8,14 +8,14 @@ module Bullet
8
8
  alias_method :origin_each, :each
9
9
  alias_method :origin_eager_load, :eager_load
10
10
 
11
- def first(opts = {})
12
- result = origin_first(opts)
11
+ def first(limit = nil)
12
+ result = origin_first(limit)
13
13
  Bullet::Detector::NPlusOneQuery.add_impossible_object(result) if result
14
14
  result
15
15
  end
16
16
 
17
- def last(opts = {})
18
- result = origin_last(opts)
17
+ def last(limit = nil)
18
+ result = origin_last(limit)
19
19
  Bullet::Detector::NPlusOneQuery.add_impossible_object(result) if result
20
20
  result
21
21
  end
@@ -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.4'
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.4
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: 2023-11-17 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
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  - !ruby/object:Gem::Version
112
112
  version: 1.3.6
113
113
  requirements: []
114
- rubygems_version: 3.4.20
114
+ rubygems_version: 3.5.3
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: help to kill N+1 queries and unused eager loading.