bullet 7.0.7 → 7.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -1
- data/README.md +6 -3
- data/lib/bullet/active_record4.rb +10 -0
- data/lib/bullet/active_record41.rb +10 -0
- data/lib/bullet/active_record42.rb +10 -0
- data/lib/bullet/active_record5.rb +18 -0
- data/lib/bullet/active_record52.rb +18 -0
- data/lib/bullet/active_record60.rb +18 -0
- data/lib/bullet/active_record61.rb +18 -0
- data/lib/bullet/active_record70.rb +32 -8
- data/lib/bullet/active_record71.rb +308 -0
- data/lib/bullet/dependency.rb +12 -0
- data/lib/bullet/detector/n_plus_one_query.rb +2 -5
- data/lib/bullet/detector/unused_eager_loading.rb +5 -2
- data/lib/bullet/ext/object.rb +14 -3
- data/lib/bullet/mongoid8x.rb +59 -0
- data/lib/bullet/notification/base.rb +9 -8
- data/lib/bullet/notification/counter_cache.rb +1 -1
- data/lib/bullet/rack.rb +4 -2
- data/lib/bullet/registry/association.rb +2 -1
- data/lib/bullet/stack_trace_filter.rb +3 -2
- data/lib/bullet/version.rb +1 -1
- data/lib/bullet.rb +7 -2
- metadata +7 -155
- data/.github/workflows/main.yml +0 -82
- data/.gitignore +0 -15
- data/.rspec +0 -2
- data/Gemfile +0 -24
- data/Gemfile.mongoid +0 -12
- data/Gemfile.mongoid-4.0 +0 -15
- data/Gemfile.mongoid-5.0 +0 -15
- data/Gemfile.mongoid-6.0 +0 -15
- data/Gemfile.mongoid-7.0 +0 -15
- data/Gemfile.rails-4.0 +0 -16
- data/Gemfile.rails-4.1 +0 -16
- data/Gemfile.rails-4.2 +0 -16
- data/Gemfile.rails-5.0 +0 -15
- data/Gemfile.rails-5.1 +0 -15
- data/Gemfile.rails-5.2 +0 -15
- data/Gemfile.rails-6.0 +0 -15
- data/Gemfile.rails-6.1 +0 -15
- data/Gemfile.rails-7.0 +0 -10
- data/Guardfile +0 -8
- data/Hacking.md +0 -75
- data/Rakefile +0 -51
- data/bullet.gemspec +0 -33
- data/perf/benchmark.rb +0 -118
- data/rails/init.rb +0 -3
- data/spec/bullet/detector/association_spec.rb +0 -28
- data/spec/bullet/detector/base_spec.rb +0 -10
- data/spec/bullet/detector/counter_cache_spec.rb +0 -58
- data/spec/bullet/detector/n_plus_one_query_spec.rb +0 -150
- data/spec/bullet/detector/unused_eager_loading_spec.rb +0 -126
- data/spec/bullet/ext/object_spec.rb +0 -44
- data/spec/bullet/ext/string_spec.rb +0 -15
- data/spec/bullet/notification/base_spec.rb +0 -94
- data/spec/bullet/notification/counter_cache_spec.rb +0 -14
- data/spec/bullet/notification/n_plus_one_query_spec.rb +0 -29
- data/spec/bullet/notification/unused_eager_loading_spec.rb +0 -18
- data/spec/bullet/notification_collector_spec.rb +0 -34
- data/spec/bullet/rack_spec.rb +0 -296
- data/spec/bullet/registry/association_spec.rb +0 -28
- data/spec/bullet/registry/base_spec.rb +0 -46
- data/spec/bullet/registry/object_spec.rb +0 -26
- data/spec/bullet/stack_trace_filter_spec.rb +0 -26
- data/spec/bullet_spec.rb +0 -136
- data/spec/integration/active_record/association_spec.rb +0 -822
- data/spec/integration/counter_cache_spec.rb +0 -68
- data/spec/integration/mongoid/association_spec.rb +0 -246
- data/spec/models/address.rb +0 -5
- data/spec/models/attachment.rb +0 -5
- data/spec/models/author.rb +0 -5
- data/spec/models/base_user.rb +0 -7
- data/spec/models/category.rb +0 -12
- data/spec/models/city.rb +0 -5
- data/spec/models/client.rb +0 -8
- data/spec/models/comment.rb +0 -8
- data/spec/models/company.rb +0 -5
- data/spec/models/country.rb +0 -5
- data/spec/models/deal.rb +0 -5
- data/spec/models/document.rb +0 -7
- data/spec/models/entry.rb +0 -5
- data/spec/models/firm.rb +0 -7
- data/spec/models/folder.rb +0 -4
- data/spec/models/group.rb +0 -4
- data/spec/models/mongoid/address.rb +0 -9
- data/spec/models/mongoid/category.rb +0 -10
- data/spec/models/mongoid/comment.rb +0 -9
- data/spec/models/mongoid/company.rb +0 -9
- data/spec/models/mongoid/entry.rb +0 -9
- data/spec/models/mongoid/post.rb +0 -14
- data/spec/models/mongoid/user.rb +0 -7
- data/spec/models/newspaper.rb +0 -5
- data/spec/models/page.rb +0 -4
- data/spec/models/person.rb +0 -5
- data/spec/models/pet.rb +0 -5
- data/spec/models/post.rb +0 -34
- data/spec/models/relationship.rb +0 -6
- data/spec/models/reply.rb +0 -5
- data/spec/models/role.rb +0 -7
- data/spec/models/student.rb +0 -5
- data/spec/models/submission.rb +0 -7
- data/spec/models/teacher.rb +0 -5
- data/spec/models/user.rb +0 -8
- data/spec/models/writer.rb +0 -4
- data/spec/spec_helper.rb +0 -97
- data/spec/support/bullet_ext.rb +0 -56
- data/spec/support/mongo_seed.rb +0 -59
- data/spec/support/rack_double.rb +0 -49
- data/spec/support/sqlite_seed.rb +0 -284
- data/test.sh +0 -15
- data/update.sh +0 -10
@@ -10,7 +10,7 @@ module Bullet
|
|
10
10
|
# check if there are unused preload associations.
|
11
11
|
# get related_objects from eager_loadings associated with object and associations
|
12
12
|
# get call_object_association from associations of call_object_associations whose object is in related_objects
|
13
|
-
# if association not in call_object_association, then the object => association - call_object_association is
|
13
|
+
# if association not in call_object_association, then the object => association - call_object_association is unused preload associations
|
14
14
|
def check_unused_preload_associations
|
15
15
|
return unless Bullet.start?
|
16
16
|
return unless Bullet.unused_eager_loading_enable?
|
@@ -65,7 +65,10 @@ module Bullet
|
|
65
65
|
private
|
66
66
|
|
67
67
|
def create_notification(callers, klazz, associations)
|
68
|
-
notify_associations = Array.wrap(associations) - Bullet.get_safelist_associations(
|
68
|
+
notify_associations = Array.wrap(associations) - Bullet.get_safelist_associations(
|
69
|
+
:unused_eager_loading,
|
70
|
+
klazz
|
71
|
+
)
|
69
72
|
|
70
73
|
if notify_associations.present?
|
71
74
|
notice = Bullet::Notification::UnusedEagerLoading.new(callers, klazz, notify_associations)
|
data/lib/bullet/ext/object.rb
CHANGED
@@ -9,11 +9,22 @@ class Object
|
|
9
9
|
return if respond_to?(:persisted?) && !persisted?
|
10
10
|
|
11
11
|
if self.class.respond_to?(:primary_keys) && self.class.primary_keys
|
12
|
-
self.class.primary_keys
|
12
|
+
primary_key = self.class.primary_keys
|
13
13
|
elsif self.class.respond_to?(:primary_key) && self.class.primary_key
|
14
|
-
|
14
|
+
primary_key = self.class.primary_key
|
15
15
|
else
|
16
|
-
id
|
16
|
+
primary_key = :id
|
17
17
|
end
|
18
|
+
|
19
|
+
bullet_join_potential_composite_primary_key(primary_key)
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def bullet_join_potential_composite_primary_key(primary_keys)
|
25
|
+
return send(primary_keys) unless primary_keys.is_a?(Enumerable)
|
26
|
+
|
27
|
+
primary_keys.map { |primary_key| send primary_key }
|
28
|
+
.join(',')
|
18
29
|
end
|
19
30
|
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module Bullet
|
2
|
+
module Mongoid
|
3
|
+
def self.enable
|
4
|
+
require 'mongoid'
|
5
|
+
::Mongoid::Contextual::Mongo.class_eval do
|
6
|
+
alias_method :origin_first, :first
|
7
|
+
alias_method :origin_last, :last
|
8
|
+
alias_method :origin_each, :each
|
9
|
+
alias_method :origin_eager_load, :eager_load
|
10
|
+
|
11
|
+
def first(opts = {})
|
12
|
+
result = origin_first(opts)
|
13
|
+
Bullet::Detector::NPlusOneQuery.add_impossible_object(result) if result
|
14
|
+
result
|
15
|
+
end
|
16
|
+
|
17
|
+
def last(opts = {})
|
18
|
+
result = origin_last(opts)
|
19
|
+
Bullet::Detector::NPlusOneQuery.add_impossible_object(result) if result
|
20
|
+
result
|
21
|
+
end
|
22
|
+
|
23
|
+
def each(&block)
|
24
|
+
return to_enum unless block_given?
|
25
|
+
|
26
|
+
records = []
|
27
|
+
origin_each { |record| records << record }
|
28
|
+
if records.length > 1
|
29
|
+
Bullet::Detector::NPlusOneQuery.add_possible_objects(records)
|
30
|
+
elsif records.size == 1
|
31
|
+
Bullet::Detector::NPlusOneQuery.add_impossible_object(records.first)
|
32
|
+
end
|
33
|
+
records.each(&block)
|
34
|
+
end
|
35
|
+
|
36
|
+
def eager_load(docs)
|
37
|
+
associations = criteria.inclusions.map(&:name)
|
38
|
+
docs.each do |doc|
|
39
|
+
Bullet::Detector::NPlusOneQuery.add_object_associations(doc, associations)
|
40
|
+
end
|
41
|
+
Bullet::Detector::UnusedEagerLoading.add_eager_loadings(docs, associations)
|
42
|
+
origin_eager_load(docs)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
::Mongoid::Association::Accessors.class_eval do
|
47
|
+
alias_method :origin_get_relation, :get_relation
|
48
|
+
|
49
|
+
def get_relation(name, association, object, reload = false)
|
50
|
+
result = origin_get_relation(name, association, object, reload)
|
51
|
+
unless association.embedded?
|
52
|
+
Bullet::Detector::NPlusOneQuery.call_association(self, name)
|
53
|
+
end
|
54
|
+
result
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -28,13 +28,13 @@ module Bullet
|
|
28
28
|
def whoami
|
29
29
|
@user ||=
|
30
30
|
ENV['USER'].presence ||
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
31
|
+
(
|
32
|
+
begin
|
33
|
+
`whoami`.chomp
|
34
|
+
rescue StandardError
|
35
|
+
''
|
36
|
+
end
|
37
|
+
)
|
38
38
|
@user.present? ? "user: #{@user}" : ''
|
39
39
|
end
|
40
40
|
|
@@ -73,7 +73,8 @@ module Bullet
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def associations_str
|
76
|
-
".includes(#{@associations.map { |a| a.to_s.to_sym }
|
76
|
+
".includes(#{@associations.map { |a| a.to_s.to_sym }
|
77
|
+
.inspect})"
|
77
78
|
end
|
78
79
|
end
|
79
80
|
end
|
data/lib/bullet/rack.rb
CHANGED
@@ -18,7 +18,7 @@ module Bullet
|
|
18
18
|
|
19
19
|
response_body = nil
|
20
20
|
|
21
|
-
if Bullet.notification?
|
21
|
+
if Bullet.notification? || Bullet.always_append_html_body
|
22
22
|
if Bullet.inject_into_page? && !file?(headers) && !sse?(headers) && !empty?(response) && status == 200
|
23
23
|
if html_request?(headers, response)
|
24
24
|
response_body = response_body(response)
|
@@ -49,6 +49,7 @@ module Bullet
|
|
49
49
|
# response may be ["Not Found"], ["Move Permanently"], etc, but
|
50
50
|
# those should not happen if the status is 200
|
51
51
|
return true if !response.respond_to?(:body) && !response.respond_to?(:first)
|
52
|
+
|
52
53
|
body = response_body(response)
|
53
54
|
body.nil? || body.empty?
|
54
55
|
end
|
@@ -135,7 +136,8 @@ module Bullet
|
|
135
136
|
end
|
136
137
|
|
137
138
|
def with_security_policy_nonce(headers)
|
138
|
-
|
139
|
+
csp = headers['Content-Security-Policy'] || headers['Content-Security-Policy-Report-Only'] || ''
|
140
|
+
matched = csp.match(NONCE_MATCHER)
|
139
141
|
nonce = matched[:nonce] if matched
|
140
142
|
|
141
143
|
if nonce
|
@@ -8,7 +8,8 @@ module Bullet
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def similarly_associated(base, associations)
|
11
|
-
@registry.select { |key, value| key.include?(base) && value == associations }
|
11
|
+
@registry.select { |key, value| key.include?(base) && value == associations }
|
12
|
+
.collect(&:first).flatten
|
12
13
|
end
|
13
14
|
end
|
14
15
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "bundler"
|
3
4
|
|
4
5
|
module Bullet
|
@@ -14,8 +15,8 @@ module Bullet
|
|
14
15
|
caller_path = location_as_path(location)
|
15
16
|
caller_path.include?(Bullet.app_root) && !caller_path.include?(vendor_root) &&
|
16
17
|
!caller_path.include?(bundler_path) || Bullet.stacktrace_includes.any? { |include_pattern|
|
17
|
-
|
18
|
-
|
18
|
+
pattern_matches?(location, include_pattern)
|
19
|
+
}
|
19
20
|
end
|
20
21
|
end
|
21
22
|
|
data/lib/bullet/version.rb
CHANGED
data/lib/bullet.rb
CHANGED
@@ -40,10 +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
|
43
|
+
attr_accessor :add_footer, :orm_patches_applied, :skip_http_headers, :always_append_html_body
|
44
44
|
|
45
45
|
available_notifiers =
|
46
|
-
UniformNotifier::AVAILABLE_NOTIFIERS.select { |notifier| notifier != :raise }
|
46
|
+
UniformNotifier::AVAILABLE_NOTIFIERS.select { |notifier| notifier != :raise }
|
47
|
+
.map { |notifier| "#{notifier}=" }
|
47
48
|
available_notifiers_options = { to: UniformNotifier }
|
48
49
|
delegate(*available_notifiers, **available_notifiers_options)
|
49
50
|
|
@@ -70,10 +71,14 @@ module Bullet
|
|
70
71
|
end
|
71
72
|
end
|
72
73
|
|
74
|
+
alias enabled= enable=
|
75
|
+
|
73
76
|
def enable?
|
74
77
|
!!@enable
|
75
78
|
end
|
76
79
|
|
80
|
+
alias enabled? enable?
|
81
|
+
|
77
82
|
# Rails.root might be nil if `railties` is a dependency on a project that does not use Rails
|
78
83
|
def app_root
|
79
84
|
@app_root ||= (defined?(::Rails.root) && !::Rails.root.nil? ? Rails.root.to_s : Dir.pwd).to_s
|
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.
|
4
|
+
version: 7.1.3
|
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
|
+
date: 2023-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -45,31 +45,9 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
- ".github/workflows/main.yml"
|
49
|
-
- ".gitignore"
|
50
|
-
- ".rspec"
|
51
48
|
- CHANGELOG.md
|
52
|
-
- Gemfile
|
53
|
-
- Gemfile.mongoid
|
54
|
-
- Gemfile.mongoid-4.0
|
55
|
-
- Gemfile.mongoid-5.0
|
56
|
-
- Gemfile.mongoid-6.0
|
57
|
-
- Gemfile.mongoid-7.0
|
58
|
-
- Gemfile.rails-4.0
|
59
|
-
- Gemfile.rails-4.1
|
60
|
-
- Gemfile.rails-4.2
|
61
|
-
- Gemfile.rails-5.0
|
62
|
-
- Gemfile.rails-5.1
|
63
|
-
- Gemfile.rails-5.2
|
64
|
-
- Gemfile.rails-6.0
|
65
|
-
- Gemfile.rails-6.1
|
66
|
-
- Gemfile.rails-7.0
|
67
|
-
- Guardfile
|
68
|
-
- Hacking.md
|
69
49
|
- MIT-LICENSE
|
70
50
|
- README.md
|
71
|
-
- Rakefile
|
72
|
-
- bullet.gemspec
|
73
51
|
- lib/bullet.rb
|
74
52
|
- lib/bullet/active_job.rb
|
75
53
|
- lib/bullet/active_record4.rb
|
@@ -80,6 +58,7 @@ files:
|
|
80
58
|
- lib/bullet/active_record60.rb
|
81
59
|
- lib/bullet/active_record61.rb
|
82
60
|
- lib/bullet/active_record70.rb
|
61
|
+
- lib/bullet/active_record71.rb
|
83
62
|
- lib/bullet/bullet_xhr.js
|
84
63
|
- lib/bullet/dependency.rb
|
85
64
|
- lib/bullet/detector.rb
|
@@ -94,6 +73,7 @@ files:
|
|
94
73
|
- lib/bullet/mongoid5x.rb
|
95
74
|
- lib/bullet/mongoid6x.rb
|
96
75
|
- lib/bullet/mongoid7x.rb
|
76
|
+
- lib/bullet/mongoid8x.rb
|
97
77
|
- lib/bullet/notification.rb
|
98
78
|
- lib/bullet/notification/base.rb
|
99
79
|
- lib/bullet/notification/counter_cache.rb
|
@@ -109,78 +89,12 @@ files:
|
|
109
89
|
- lib/bullet/stack_trace_filter.rb
|
110
90
|
- lib/bullet/version.rb
|
111
91
|
- lib/generators/bullet/install_generator.rb
|
112
|
-
- perf/benchmark.rb
|
113
|
-
- rails/init.rb
|
114
|
-
- spec/bullet/detector/association_spec.rb
|
115
|
-
- spec/bullet/detector/base_spec.rb
|
116
|
-
- spec/bullet/detector/counter_cache_spec.rb
|
117
|
-
- spec/bullet/detector/n_plus_one_query_spec.rb
|
118
|
-
- spec/bullet/detector/unused_eager_loading_spec.rb
|
119
|
-
- spec/bullet/ext/object_spec.rb
|
120
|
-
- spec/bullet/ext/string_spec.rb
|
121
|
-
- spec/bullet/notification/base_spec.rb
|
122
|
-
- spec/bullet/notification/counter_cache_spec.rb
|
123
|
-
- spec/bullet/notification/n_plus_one_query_spec.rb
|
124
|
-
- spec/bullet/notification/unused_eager_loading_spec.rb
|
125
|
-
- spec/bullet/notification_collector_spec.rb
|
126
|
-
- spec/bullet/rack_spec.rb
|
127
|
-
- spec/bullet/registry/association_spec.rb
|
128
|
-
- spec/bullet/registry/base_spec.rb
|
129
|
-
- spec/bullet/registry/object_spec.rb
|
130
|
-
- spec/bullet/stack_trace_filter_spec.rb
|
131
|
-
- spec/bullet_spec.rb
|
132
|
-
- spec/integration/active_record/association_spec.rb
|
133
|
-
- spec/integration/counter_cache_spec.rb
|
134
|
-
- spec/integration/mongoid/association_spec.rb
|
135
|
-
- spec/models/address.rb
|
136
|
-
- spec/models/attachment.rb
|
137
|
-
- spec/models/author.rb
|
138
|
-
- spec/models/base_user.rb
|
139
|
-
- spec/models/category.rb
|
140
|
-
- spec/models/city.rb
|
141
|
-
- spec/models/client.rb
|
142
|
-
- spec/models/comment.rb
|
143
|
-
- spec/models/company.rb
|
144
|
-
- spec/models/country.rb
|
145
|
-
- spec/models/deal.rb
|
146
|
-
- spec/models/document.rb
|
147
|
-
- spec/models/entry.rb
|
148
|
-
- spec/models/firm.rb
|
149
|
-
- spec/models/folder.rb
|
150
|
-
- spec/models/group.rb
|
151
|
-
- spec/models/mongoid/address.rb
|
152
|
-
- spec/models/mongoid/category.rb
|
153
|
-
- spec/models/mongoid/comment.rb
|
154
|
-
- spec/models/mongoid/company.rb
|
155
|
-
- spec/models/mongoid/entry.rb
|
156
|
-
- spec/models/mongoid/post.rb
|
157
|
-
- spec/models/mongoid/user.rb
|
158
|
-
- spec/models/newspaper.rb
|
159
|
-
- spec/models/page.rb
|
160
|
-
- spec/models/person.rb
|
161
|
-
- spec/models/pet.rb
|
162
|
-
- spec/models/post.rb
|
163
|
-
- spec/models/relationship.rb
|
164
|
-
- spec/models/reply.rb
|
165
|
-
- spec/models/role.rb
|
166
|
-
- spec/models/student.rb
|
167
|
-
- spec/models/submission.rb
|
168
|
-
- spec/models/teacher.rb
|
169
|
-
- spec/models/user.rb
|
170
|
-
- spec/models/writer.rb
|
171
|
-
- spec/spec_helper.rb
|
172
|
-
- spec/support/bullet_ext.rb
|
173
|
-
- spec/support/mongo_seed.rb
|
174
|
-
- spec/support/rack_double.rb
|
175
|
-
- spec/support/sqlite_seed.rb
|
176
92
|
- tasks/bullet_tasks.rake
|
177
|
-
- test.sh
|
178
|
-
- update.sh
|
179
93
|
homepage: https://github.com/flyerhzm/bullet
|
180
94
|
licenses:
|
181
95
|
- MIT
|
182
96
|
metadata:
|
183
|
-
changelog_uri: https://github.com/flyerhzm/bullet/blob/
|
97
|
+
changelog_uri: https://github.com/flyerhzm/bullet/blob/main/CHANGELOG.md
|
184
98
|
source_code_uri: https://github.com/flyerhzm/bullet
|
185
99
|
post_install_message:
|
186
100
|
rdoc_options: []
|
@@ -197,70 +111,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
197
111
|
- !ruby/object:Gem::Version
|
198
112
|
version: 1.3.6
|
199
113
|
requirements: []
|
200
|
-
rubygems_version: 3.4.
|
114
|
+
rubygems_version: 3.4.20
|
201
115
|
signing_key:
|
202
116
|
specification_version: 4
|
203
117
|
summary: help to kill N+1 queries and unused eager loading.
|
204
|
-
test_files:
|
205
|
-
- spec/bullet/detector/association_spec.rb
|
206
|
-
- spec/bullet/detector/base_spec.rb
|
207
|
-
- spec/bullet/detector/counter_cache_spec.rb
|
208
|
-
- spec/bullet/detector/n_plus_one_query_spec.rb
|
209
|
-
- spec/bullet/detector/unused_eager_loading_spec.rb
|
210
|
-
- spec/bullet/ext/object_spec.rb
|
211
|
-
- spec/bullet/ext/string_spec.rb
|
212
|
-
- spec/bullet/notification/base_spec.rb
|
213
|
-
- spec/bullet/notification/counter_cache_spec.rb
|
214
|
-
- spec/bullet/notification/n_plus_one_query_spec.rb
|
215
|
-
- spec/bullet/notification/unused_eager_loading_spec.rb
|
216
|
-
- spec/bullet/notification_collector_spec.rb
|
217
|
-
- spec/bullet/rack_spec.rb
|
218
|
-
- spec/bullet/registry/association_spec.rb
|
219
|
-
- spec/bullet/registry/base_spec.rb
|
220
|
-
- spec/bullet/registry/object_spec.rb
|
221
|
-
- spec/bullet/stack_trace_filter_spec.rb
|
222
|
-
- spec/bullet_spec.rb
|
223
|
-
- spec/integration/active_record/association_spec.rb
|
224
|
-
- spec/integration/counter_cache_spec.rb
|
225
|
-
- spec/integration/mongoid/association_spec.rb
|
226
|
-
- spec/models/address.rb
|
227
|
-
- spec/models/attachment.rb
|
228
|
-
- spec/models/author.rb
|
229
|
-
- spec/models/base_user.rb
|
230
|
-
- spec/models/category.rb
|
231
|
-
- spec/models/city.rb
|
232
|
-
- spec/models/client.rb
|
233
|
-
- spec/models/comment.rb
|
234
|
-
- spec/models/company.rb
|
235
|
-
- spec/models/country.rb
|
236
|
-
- spec/models/deal.rb
|
237
|
-
- spec/models/document.rb
|
238
|
-
- spec/models/entry.rb
|
239
|
-
- spec/models/firm.rb
|
240
|
-
- spec/models/folder.rb
|
241
|
-
- spec/models/group.rb
|
242
|
-
- spec/models/mongoid/address.rb
|
243
|
-
- spec/models/mongoid/category.rb
|
244
|
-
- spec/models/mongoid/comment.rb
|
245
|
-
- spec/models/mongoid/company.rb
|
246
|
-
- spec/models/mongoid/entry.rb
|
247
|
-
- spec/models/mongoid/post.rb
|
248
|
-
- spec/models/mongoid/user.rb
|
249
|
-
- spec/models/newspaper.rb
|
250
|
-
- spec/models/page.rb
|
251
|
-
- spec/models/person.rb
|
252
|
-
- spec/models/pet.rb
|
253
|
-
- spec/models/post.rb
|
254
|
-
- spec/models/relationship.rb
|
255
|
-
- spec/models/reply.rb
|
256
|
-
- spec/models/role.rb
|
257
|
-
- spec/models/student.rb
|
258
|
-
- spec/models/submission.rb
|
259
|
-
- spec/models/teacher.rb
|
260
|
-
- spec/models/user.rb
|
261
|
-
- spec/models/writer.rb
|
262
|
-
- spec/spec_helper.rb
|
263
|
-
- spec/support/bullet_ext.rb
|
264
|
-
- spec/support/mongo_seed.rb
|
265
|
-
- spec/support/rack_double.rb
|
266
|
-
- spec/support/sqlite_seed.rb
|
118
|
+
test_files: []
|
data/.github/workflows/main.yml
DELETED
@@ -1,82 +0,0 @@
|
|
1
|
-
# This workflow uses actions that are not certified by GitHub.
|
2
|
-
# They are provided by a third-party and are governed by
|
3
|
-
# separate terms of service, privacy policy, and support
|
4
|
-
# documentation.
|
5
|
-
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
-
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
-
|
8
|
-
name: CI
|
9
|
-
|
10
|
-
on:
|
11
|
-
push:
|
12
|
-
branches: [ main ]
|
13
|
-
pull_request:
|
14
|
-
branches: [ main ]
|
15
|
-
|
16
|
-
jobs:
|
17
|
-
test_rails_4:
|
18
|
-
runs-on: ubuntu-latest
|
19
|
-
strategy:
|
20
|
-
matrix:
|
21
|
-
gemfile: ['Gemfile.rails-4.0', 'Gemfile.rails-4.1', 'Gemfile.rails-4.2']
|
22
|
-
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
|
23
|
-
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
|
24
|
-
steps:
|
25
|
-
- uses: actions/checkout@v2
|
26
|
-
- name: Set up Ruby
|
27
|
-
uses: ruby/setup-ruby@v1
|
28
|
-
with:
|
29
|
-
ruby-version: 2.3
|
30
|
-
bundler: 1
|
31
|
-
bundler-cache: true
|
32
|
-
- name: Run tests
|
33
|
-
run: bundle exec rake
|
34
|
-
test_rails_5:
|
35
|
-
runs-on: ubuntu-latest
|
36
|
-
strategy:
|
37
|
-
matrix:
|
38
|
-
gemfile: ['Gemfile.rails-5.0', 'Gemfile.rails-5.1', 'Gemfile.rails-5.2']
|
39
|
-
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
|
40
|
-
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
|
41
|
-
steps:
|
42
|
-
- uses: actions/checkout@v2
|
43
|
-
- name: Set up Ruby
|
44
|
-
uses: ruby/setup-ruby@v1
|
45
|
-
with:
|
46
|
-
ruby-version: 2.5
|
47
|
-
bundler: 1
|
48
|
-
bundler-cache: true
|
49
|
-
- name: Run tests
|
50
|
-
run: bundle exec rake
|
51
|
-
test_rails_6:
|
52
|
-
runs-on: ubuntu-latest
|
53
|
-
strategy:
|
54
|
-
matrix:
|
55
|
-
gemfile: ['Gemfile.rails-6.0', 'Gemfile.rails-6.1']
|
56
|
-
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
|
57
|
-
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
|
58
|
-
steps:
|
59
|
-
- uses: actions/checkout@v2
|
60
|
-
- name: Set up Ruby
|
61
|
-
uses: ruby/setup-ruby@v1
|
62
|
-
with:
|
63
|
-
ruby-version: 2.7
|
64
|
-
bundler-cache: true
|
65
|
-
- name: Run tests
|
66
|
-
run: bundle exec rake
|
67
|
-
test_rails_7:
|
68
|
-
runs-on: ubuntu-latest
|
69
|
-
strategy:
|
70
|
-
matrix:
|
71
|
-
gemfile: ['Gemfile.rails-7.0']
|
72
|
-
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
|
73
|
-
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
|
74
|
-
steps:
|
75
|
-
- uses: actions/checkout@v2
|
76
|
-
- name: Set up Ruby
|
77
|
-
uses: ruby/setup-ruby@v1
|
78
|
-
with:
|
79
|
-
ruby-version: 3.1
|
80
|
-
bundler-cache: true
|
81
|
-
- name: Run tests
|
82
|
-
run: bundle exec rake
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/Gemfile
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
git_source(:github) do |repo_name|
|
4
|
-
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/')
|
5
|
-
"https://github.com/#{repo_name}.git"
|
6
|
-
end
|
7
|
-
|
8
|
-
gemspec
|
9
|
-
|
10
|
-
gem 'rails', github: 'rails'
|
11
|
-
gem 'sqlite3', platforms: [:ruby]
|
12
|
-
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
|
13
|
-
gem 'activerecord-import'
|
14
|
-
|
15
|
-
gem 'rspec'
|
16
|
-
gem 'guard'
|
17
|
-
gem 'guard-rspec'
|
18
|
-
|
19
|
-
gem 'coveralls', require: false
|
20
|
-
|
21
|
-
platforms :rbx do
|
22
|
-
gem 'rubysl', '~> 2.0'
|
23
|
-
gem 'rubinius-developer_tools'
|
24
|
-
end
|
data/Gemfile.mongoid
DELETED
data/Gemfile.mongoid-4.0
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
source "https://rubygems.org"
|
2
|
-
|
3
|
-
gemspec
|
4
|
-
|
5
|
-
gem 'rails', '~> 4.0.0'
|
6
|
-
gem 'sqlite3', platforms: [:ruby]
|
7
|
-
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
|
8
|
-
gem 'mongoid', '~> 4.0.0'
|
9
|
-
|
10
|
-
gem "rspec"
|
11
|
-
|
12
|
-
platforms :rbx do
|
13
|
-
gem 'rubysl', '~> 2.0'
|
14
|
-
gem 'rubinius-developer_tools'
|
15
|
-
end
|
data/Gemfile.mongoid-5.0
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
source "https://rubygems.org"
|
2
|
-
|
3
|
-
gemspec
|
4
|
-
|
5
|
-
gem 'rails', '~> 4.0.0'
|
6
|
-
gem 'sqlite3', platforms: [:ruby]
|
7
|
-
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
|
8
|
-
gem 'mongoid', '~> 5.1.0'
|
9
|
-
|
10
|
-
gem "rspec"
|
11
|
-
|
12
|
-
platforms :rbx do
|
13
|
-
gem 'rubysl', '~> 2.0'
|
14
|
-
gem 'rubinius-developer_tools'
|
15
|
-
end
|
data/Gemfile.mongoid-6.0
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
source "https://rubygems.org"
|
2
|
-
|
3
|
-
gemspec
|
4
|
-
|
5
|
-
gem 'rails', '~> 5.0.0'
|
6
|
-
gem 'sqlite3', platforms: [:ruby]
|
7
|
-
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
|
8
|
-
gem 'mongoid', '~> 6.0.0'
|
9
|
-
|
10
|
-
gem "rspec"
|
11
|
-
|
12
|
-
platforms :rbx do
|
13
|
-
gem 'rubysl', '~> 2.0'
|
14
|
-
gem 'rubinius-developer_tools'
|
15
|
-
end
|
data/Gemfile.mongoid-7.0
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
source "https://rubygems.org"
|
2
|
-
|
3
|
-
gemspec
|
4
|
-
|
5
|
-
gem 'rails', '~> 5.0'
|
6
|
-
gem 'sqlite3', platforms: [:ruby]
|
7
|
-
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
|
8
|
-
gem 'mongoid', '~> 7.0.0'
|
9
|
-
|
10
|
-
gem "rspec"
|
11
|
-
|
12
|
-
platforms :rbx do
|
13
|
-
gem 'rubysl', '~> 2.0'
|
14
|
-
gem 'rubinius-developer_tools'
|
15
|
-
end
|
data/Gemfile.rails-4.0
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
source "https://rubygems.org"
|
2
|
-
|
3
|
-
gemspec
|
4
|
-
|
5
|
-
gem 'rails', '~> 4.0.0'
|
6
|
-
gem 'sqlite3', '~> 1.3.6', platforms: [:ruby]
|
7
|
-
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
|
8
|
-
gem 'activerecord-import'
|
9
|
-
gem 'tins', '~> 1.6.0', platforms: [:ruby_19]
|
10
|
-
|
11
|
-
gem "rspec"
|
12
|
-
|
13
|
-
platforms :rbx do
|
14
|
-
gem 'rubysl', '~> 2.0'
|
15
|
-
gem 'rubinius-developer_tools'
|
16
|
-
end
|