bullet 6.1.3 → 7.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/main.yml +82 -0
  3. data/CHANGELOG.md +36 -0
  4. data/Gemfile.rails-7.0 +10 -0
  5. data/MIT-LICENSE +1 -1
  6. data/README.md +31 -26
  7. data/lib/bullet/active_record41.rb +1 -0
  8. data/lib/bullet/active_record42.rb +1 -0
  9. data/lib/bullet/active_record5.rb +6 -4
  10. data/lib/bullet/active_record52.rb +18 -22
  11. data/lib/bullet/active_record60.rb +17 -21
  12. data/lib/bullet/active_record61.rb +17 -21
  13. data/lib/bullet/active_record70.rb +277 -0
  14. data/lib/bullet/bullet_xhr.js +3 -2
  15. data/lib/bullet/dependency.rb +10 -0
  16. data/lib/bullet/detector/base.rb +2 -1
  17. data/lib/bullet/detector/counter_cache.rb +2 -2
  18. data/lib/bullet/detector/n_plus_one_query.rb +5 -5
  19. data/lib/bullet/detector/unused_eager_loading.rb +2 -2
  20. data/lib/bullet/mongoid7x.rb +34 -19
  21. data/lib/bullet/notification.rb +2 -1
  22. data/lib/bullet/rack.rb +7 -4
  23. data/lib/bullet/stack_trace_filter.rb +7 -8
  24. data/lib/bullet/version.rb +1 -1
  25. data/lib/bullet.rb +23 -24
  26. data/lib/generators/bullet/install_generator.rb +0 -1
  27. data/perf/benchmark.rb +4 -1
  28. data/spec/bullet/detector/n_plus_one_query_spec.rb +1 -1
  29. data/spec/bullet/detector/unused_eager_loading_spec.rb +6 -2
  30. data/spec/bullet/ext/object_spec.rb +1 -1
  31. data/spec/bullet/notification/base_spec.rb +4 -4
  32. data/spec/bullet/rack_spec.rb +90 -19
  33. data/spec/bullet_spec.rb +15 -15
  34. data/spec/integration/active_record/association_spec.rb +36 -9
  35. data/spec/integration/counter_cache_spec.rb +4 -4
  36. data/spec/integration/mongoid/association_spec.rb +1 -1
  37. data/spec/models/deal.rb +5 -0
  38. data/spec/models/folder.rb +2 -1
  39. data/spec/models/group.rb +2 -1
  40. data/spec/models/page.rb +2 -1
  41. data/spec/models/post.rb +2 -0
  42. data/spec/models/role.rb +7 -0
  43. data/spec/models/user.rb +1 -0
  44. data/spec/models/writer.rb +2 -1
  45. data/spec/spec_helper.rb +0 -2
  46. data/spec/support/mongo_seed.rb +1 -0
  47. data/spec/support/sqlite_seed.rb +30 -0
  48. data/test.sh +2 -0
  49. metadata +10 -4
  50. data/.travis.yml +0 -33
@@ -21,6 +21,13 @@ module Support
21
21
  post2 = category2.posts.create(name: 'second', writer: writer2)
22
22
  post3 = category2.posts.create(name: 'third', writer: writer2)
23
23
 
24
+ deal1 = Deal.new(name: 'Deal 1')
25
+ deal1.posts << post1
26
+ deal1.posts << post2
27
+ deal2 = Deal.new(name: 'Deal 2')
28
+ post1.deals << deal1
29
+ post1.deals << deal2
30
+
24
31
  comment1 = post1.comments.create(name: 'first', author: writer1)
25
32
  comment2 = post1.comments.create(name: 'first2', author: writer1)
26
33
  comment3 = post1.comments.create(name: 'first3', author: writer1)
@@ -85,9 +92,16 @@ module Support
85
92
  page3 = Page.create(name: 'page3', parent_id: folder2.id, author_id: author2.id)
86
93
  page4 = Page.create(name: 'page4', parent_id: folder2.id, author_id: author2.id)
87
94
 
95
+ role1 = Role.create(name: 'Admin')
96
+ role2 = Role.create(name: 'User')
97
+
88
98
  user1 = User.create(name: 'user1', category: category1)
89
99
  user2 = User.create(name: 'user2', category: category1)
90
100
 
101
+ user1.roles << role1
102
+ user1.roles << role2
103
+ user2.roles << role2
104
+
91
105
  submission1 = user1.create_submission(name: 'submission1')
92
106
  submission2 = user2.create_submission(name: 'submission2')
93
107
 
@@ -156,6 +170,11 @@ module Support
156
170
  t.column :hotel_id, :integer
157
171
  end
158
172
 
173
+ create_table :deals_posts do |t|
174
+ t.column :deal_id, :integer
175
+ t.column :post_id, :integer
176
+ end
177
+
159
178
  create_table :documents do |t|
160
179
  t.string :name
161
180
  t.string :type
@@ -234,6 +253,17 @@ module Support
234
253
  t.column :submission_id, :integer
235
254
  end
236
255
 
256
+ create_table :roles do |t|
257
+ t.column :name, :string
258
+ t.column :resource_id, :integer
259
+ t.column :resource_type, :string
260
+ end
261
+
262
+ create_table :roles_users do |t|
263
+ t.column :role_id, :integer
264
+ t.column :user_id, :integer
265
+ end
266
+
237
267
  create_table :submissions do |t|
238
268
  t.column :name, :string
239
269
  t.column :user_id, :integer
data/test.sh CHANGED
@@ -1,5 +1,7 @@
1
1
  #bundle update rails && bundle exec rspec spec
2
2
  #BUNDLE_GEMFILE=Gemfile.mongoid bundle update mongoid && BUNDLE_GEMFILE=Gemfile.mongoid bundle exec rspec spec
3
+ BUNDLE_GEMFILE=Gemfile.rails-7.0 bundle && BUNDLE_GEMFILE=Gemfile.rails-7.0 bundle exec rspec spec
4
+ BUNDLE_GEMFILE=Gemfile.rails-6.1 bundle && BUNDLE_GEMFILE=Gemfile.rails-6.1 bundle exec rspec spec
3
5
  BUNDLE_GEMFILE=Gemfile.rails-6.0 bundle && BUNDLE_GEMFILE=Gemfile.rails-6.0 bundle exec rspec spec
4
6
  BUNDLE_GEMFILE=Gemfile.rails-5.2 bundle && BUNDLE_GEMFILE=Gemfile.rails-5.2 bundle exec rspec spec
5
7
  BUNDLE_GEMFILE=Gemfile.rails-5.1 bundle && BUNDLE_GEMFILE=Gemfile.rails-5.1 bundle exec rspec spec
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: 6.1.3
4
+ version: 7.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-20 00:00:00.000000000 Z
11
+ date: 2022-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -45,9 +45,9 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
+ - ".github/workflows/main.yml"
48
49
  - ".gitignore"
49
50
  - ".rspec"
50
- - ".travis.yml"
51
51
  - CHANGELOG.md
52
52
  - Gemfile
53
53
  - Gemfile.mongoid
@@ -63,6 +63,7 @@ files:
63
63
  - Gemfile.rails-5.2
64
64
  - Gemfile.rails-6.0
65
65
  - Gemfile.rails-6.1
66
+ - Gemfile.rails-7.0
66
67
  - Guardfile
67
68
  - Hacking.md
68
69
  - MIT-LICENSE
@@ -78,6 +79,7 @@ files:
78
79
  - lib/bullet/active_record52.rb
79
80
  - lib/bullet/active_record60.rb
80
81
  - lib/bullet/active_record61.rb
82
+ - lib/bullet/active_record70.rb
81
83
  - lib/bullet/bullet_xhr.js
82
84
  - lib/bullet/dependency.rb
83
85
  - lib/bullet/detector.rb
@@ -138,6 +140,7 @@ files:
138
140
  - spec/models/comment.rb
139
141
  - spec/models/company.rb
140
142
  - spec/models/country.rb
143
+ - spec/models/deal.rb
141
144
  - spec/models/document.rb
142
145
  - spec/models/entry.rb
143
146
  - spec/models/firm.rb
@@ -157,6 +160,7 @@ files:
157
160
  - spec/models/post.rb
158
161
  - spec/models/relationship.rb
159
162
  - spec/models/reply.rb
163
+ - spec/models/role.rb
160
164
  - spec/models/student.rb
161
165
  - spec/models/submission.rb
162
166
  - spec/models/teacher.rb
@@ -191,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
195
  - !ruby/object:Gem::Version
192
196
  version: 1.3.6
193
197
  requirements: []
194
- rubygems_version: 3.1.4
198
+ rubygems_version: 3.3.22
195
199
  signing_key:
196
200
  specification_version: 4
197
201
  summary: help to kill N+1 queries and unused eager loading.
@@ -226,6 +230,7 @@ test_files:
226
230
  - spec/models/comment.rb
227
231
  - spec/models/company.rb
228
232
  - spec/models/country.rb
233
+ - spec/models/deal.rb
229
234
  - spec/models/document.rb
230
235
  - spec/models/entry.rb
231
236
  - spec/models/firm.rb
@@ -245,6 +250,7 @@ test_files:
245
250
  - spec/models/post.rb
246
251
  - spec/models/relationship.rb
247
252
  - spec/models/reply.rb
253
+ - spec/models/role.rb
248
254
  - spec/models/student.rb
249
255
  - spec/models/submission.rb
250
256
  - spec/models/teacher.rb
data/.travis.yml DELETED
@@ -1,33 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.3.0
4
- - 2.6.0
5
- gemfile:
6
- - Gemfile.rails-6.0
7
- - Gemfile.rails-5.2
8
- - Gemfile.rails-5.1
9
- - Gemfile.rails-5.0
10
- - Gemfile.rails-4.2
11
- - Gemfile.rails-4.1
12
- - Gemfile.rails-4.0
13
- matrix:
14
- exclude:
15
- - rvm: 2.3.0
16
- gemfile: Gemfile.rails-6.0
17
- - rvm: 2.6.0
18
- gemfile: Gemfile.rails-5.2
19
- - rvm: 2.6.0
20
- gemfile: Gemfile.rails-5.1
21
- - rvm: 2.6.0
22
- gemfile: Gemfile.rails-5.0
23
- - rvm: 2.6.0
24
- gemfile: Gemfile.rails-4.2
25
- - rvm: 2.6.0
26
- gemfile: Gemfile.rails-4.1
27
- - rvm: 2.6.0
28
- gemfile: Gemfile.rails-4.0
29
- env:
30
- - DB=sqlite
31
- before_install:
32
- - "find /home/travis/.rvm/rubies -wholename '*default/bundler-*.gemspec' -delete"
33
- - gem install bundler -v '< 2'