bullet 5.7.0 → 6.0.0
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 +5 -5
- data/.travis.yml +2 -0
- data/CHANGELOG.md +27 -1
- data/Gemfile.mongoid-7.0 +15 -0
- data/Gemfile.rails-4.0 +1 -1
- data/Gemfile.rails-4.1 +1 -1
- data/Gemfile.rails-4.2 +1 -1
- data/Gemfile.rails-5.0 +1 -1
- data/Gemfile.rails-5.1 +1 -1
- data/Gemfile.rails-5.2 +2 -2
- data/Gemfile.rails-6.0 +15 -0
- data/Guardfile +1 -1
- data/README.md +10 -5
- data/Rakefile +5 -5
- data/bullet.gemspec +12 -6
- data/lib/bullet/active_record4.rb +10 -14
- data/lib/bullet/active_record41.rb +8 -14
- data/lib/bullet/active_record42.rb +16 -22
- data/lib/bullet/active_record5.rb +69 -49
- data/lib/bullet/active_record52.rb +40 -40
- data/lib/bullet/active_record60.rb +245 -0
- data/lib/bullet/bullet_xhr.js +58 -0
- data/lib/bullet/dependency.rb +19 -5
- data/lib/bullet/detector/association.rb +18 -16
- data/lib/bullet/detector/base.rb +2 -0
- data/lib/bullet/detector/counter_cache.rb +13 -10
- data/lib/bullet/detector/n_plus_one_query.rb +21 -19
- data/lib/bullet/detector/unused_eager_loading.rb +27 -22
- data/lib/bullet/detector.rb +2 -0
- data/lib/bullet/ext/object.rb +9 -5
- data/lib/bullet/ext/string.rb +3 -1
- data/lib/bullet/mongoid4x.rb +7 -2
- data/lib/bullet/mongoid5x.rb +7 -2
- data/lib/bullet/mongoid6x.rb +11 -6
- data/lib/bullet/mongoid7x.rb +61 -0
- data/lib/bullet/notification/base.rb +21 -15
- data/lib/bullet/notification/counter_cache.rb +2 -0
- data/lib/bullet/notification/n_plus_one_query.rb +6 -4
- data/lib/bullet/notification/unused_eager_loading.rb +6 -4
- data/lib/bullet/notification.rb +2 -0
- data/lib/bullet/notification_collector.rb +2 -1
- data/lib/bullet/rack.rb +52 -31
- data/lib/bullet/registry/association.rb +2 -0
- data/lib/bullet/registry/base.rb +2 -0
- data/lib/bullet/registry/object.rb +2 -0
- data/lib/bullet/registry.rb +2 -0
- data/lib/bullet/stack_trace_filter.rb +57 -21
- data/lib/bullet/version.rb +2 -1
- data/lib/bullet.rb +48 -31
- data/lib/generators/bullet/install_generator.rb +5 -3
- data/perf/benchmark.rb +9 -7
- data/rails/init.rb +2 -0
- data/spec/bullet/detector/association_spec.rb +2 -0
- data/spec/bullet/detector/base_spec.rb +2 -0
- data/spec/bullet/detector/counter_cache_spec.rb +2 -0
- data/spec/bullet/detector/n_plus_one_query_spec.rb +33 -8
- data/spec/bullet/detector/unused_eager_loading_spec.rb +2 -0
- data/spec/bullet/ext/object_spec.rb +12 -5
- data/spec/bullet/ext/string_spec.rb +2 -0
- data/spec/bullet/notification/base_spec.rb +8 -6
- data/spec/bullet/notification/counter_cache_spec.rb +3 -1
- data/spec/bullet/notification/n_plus_one_query_spec.rb +3 -1
- data/spec/bullet/notification/unused_eager_loading_spec.rb +3 -1
- data/spec/bullet/notification_collector_spec.rb +2 -0
- data/spec/bullet/rack_spec.rb +22 -12
- data/spec/bullet/registry/association_spec.rb +4 -2
- data/spec/bullet/registry/base_spec.rb +5 -3
- data/spec/bullet/registry/object_spec.rb +2 -0
- data/spec/bullet_spec.rb +9 -7
- data/spec/integration/active_record/association_spec.rb +70 -19
- data/spec/integration/counter_cache_spec.rb +5 -3
- data/spec/integration/mongoid/association_spec.rb +2 -0
- data/spec/models/address.rb +2 -0
- data/spec/models/author.rb +2 -0
- data/spec/models/base_user.rb +2 -0
- data/spec/models/category.rb +2 -0
- data/spec/models/city.rb +2 -0
- data/spec/models/client.rb +4 -0
- data/spec/models/comment.rb +2 -0
- data/spec/models/company.rb +2 -0
- data/spec/models/country.rb +2 -0
- data/spec/models/document.rb +2 -0
- data/spec/models/entry.rb +2 -0
- data/spec/models/firm.rb +3 -0
- data/spec/models/folder.rb +2 -0
- data/spec/models/group.rb +4 -0
- data/spec/models/mongoid/address.rb +3 -1
- data/spec/models/mongoid/category.rb +4 -2
- data/spec/models/mongoid/comment.rb +3 -1
- data/spec/models/mongoid/company.rb +3 -1
- data/spec/models/mongoid/entry.rb +3 -1
- data/spec/models/mongoid/post.rb +6 -4
- data/spec/models/mongoid/user.rb +2 -0
- data/spec/models/newspaper.rb +2 -0
- data/spec/models/page.rb +2 -0
- data/spec/models/person.rb +2 -0
- data/spec/models/pet.rb +2 -0
- data/spec/models/post.rb +17 -0
- data/spec/models/relationship.rb +2 -0
- data/spec/models/reply.rb +2 -0
- data/spec/models/student.rb +2 -0
- data/spec/models/submission.rb +2 -0
- data/spec/models/teacher.rb +2 -0
- data/spec/models/user.rb +2 -0
- data/spec/models/writer.rb +2 -0
- data/spec/spec_helper.rb +3 -1
- data/spec/support/bullet_ext.rb +2 -0
- data/spec/support/mongo_seed.rb +32 -30
- data/spec/support/rack_double.rb +9 -16
- data/spec/support/sqlite_seed.rb +84 -75
- data/tasks/bullet_tasks.rake +2 -0
- data/test.sh +2 -0
- data/update.sh +1 -0
- metadata +17 -9
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'spec_helper'
|
|
2
4
|
|
|
3
5
|
if active_record?
|
|
@@ -122,7 +124,7 @@ if active_record?
|
|
|
122
124
|
end
|
|
123
125
|
|
|
124
126
|
it 'should detect preload with category => posts => comments' do
|
|
125
|
-
Category.includes(
|
|
127
|
+
Category.includes(posts: :comments).each do |category|
|
|
126
128
|
category.posts.each do |post|
|
|
127
129
|
post.comments.map(&:name)
|
|
128
130
|
end
|
|
@@ -134,7 +136,7 @@ if active_record?
|
|
|
134
136
|
end
|
|
135
137
|
|
|
136
138
|
it 'should detect preload with category => posts => comments with posts.id > 0' do
|
|
137
|
-
Category.includes(
|
|
139
|
+
Category.includes(posts: :comments).where('posts.id > 0').references(:posts).each do |category|
|
|
138
140
|
category.posts.each do |post|
|
|
139
141
|
post.comments.map(&:name)
|
|
140
142
|
end
|
|
@@ -146,7 +148,7 @@ if active_record?
|
|
|
146
148
|
end
|
|
147
149
|
|
|
148
150
|
it 'should detect unused preload with category => posts => comments' do
|
|
149
|
-
Category.includes(
|
|
151
|
+
Category.includes(posts: :comments).map(&:name)
|
|
150
152
|
Bullet::Detector::UnusedEagerLoading.check_unused_preload_associations
|
|
151
153
|
expect(Bullet::Detector::Association).to be_unused_preload_associations_for(Post, :comments)
|
|
152
154
|
|
|
@@ -154,7 +156,7 @@ if active_record?
|
|
|
154
156
|
end
|
|
155
157
|
|
|
156
158
|
it 'should detect unused preload with post => commnets, no category => posts' do
|
|
157
|
-
Category.includes(
|
|
159
|
+
Category.includes(posts: :comments).each do |category|
|
|
158
160
|
category.posts.map(&:name)
|
|
159
161
|
end
|
|
160
162
|
Bullet::Detector::UnusedEagerLoading.check_unused_preload_associations
|
|
@@ -190,7 +192,7 @@ if active_record?
|
|
|
190
192
|
end
|
|
191
193
|
|
|
192
194
|
it 'should detect preload with category => [posts, entries]' do
|
|
193
|
-
Category.includes([
|
|
195
|
+
Category.includes(%i[posts entries]).each do |category|
|
|
194
196
|
category.posts.map(&:name)
|
|
195
197
|
category.entries.map(&:name)
|
|
196
198
|
end
|
|
@@ -201,7 +203,7 @@ if active_record?
|
|
|
201
203
|
end
|
|
202
204
|
|
|
203
205
|
it 'should detect unused preload with category => [posts, entries]' do
|
|
204
|
-
Category.includes([
|
|
206
|
+
Category.includes(%i[posts entries]).map(&:name)
|
|
205
207
|
Bullet::Detector::UnusedEagerLoading.check_unused_preload_associations
|
|
206
208
|
expect(Bullet::Detector::Association).to be_unused_preload_associations_for(Category, :posts)
|
|
207
209
|
expect(Bullet::Detector::Association).to be_unused_preload_associations_for(Category, :entries)
|
|
@@ -210,7 +212,7 @@ if active_record?
|
|
|
210
212
|
end
|
|
211
213
|
|
|
212
214
|
it 'should detect unused preload with category => entries, but not with category => posts' do
|
|
213
|
-
Category.includes([
|
|
215
|
+
Category.includes(%i[posts entries]).each do |category|
|
|
214
216
|
category.posts.map(&:name)
|
|
215
217
|
end
|
|
216
218
|
Bullet::Detector::UnusedEagerLoading.check_unused_preload_associations
|
|
@@ -224,7 +226,7 @@ if active_record?
|
|
|
224
226
|
context 'post => comment' do
|
|
225
227
|
it 'should detect unused preload with post => comments' do
|
|
226
228
|
Post.includes(:comments).each do |post|
|
|
227
|
-
post.comments.first
|
|
229
|
+
post.comments.first&.name
|
|
228
230
|
end
|
|
229
231
|
Bullet::Detector::UnusedEagerLoading.check_unused_preload_associations
|
|
230
232
|
expect(Bullet::Detector::Association).not_to be_unused_preload_associations_for(Post, :comments)
|
|
@@ -244,7 +246,7 @@ if active_record?
|
|
|
244
246
|
category = Category.first
|
|
245
247
|
category.draft_post.destroy!
|
|
246
248
|
post = category.draft_post
|
|
247
|
-
post.
|
|
249
|
+
post.update!(link: true)
|
|
248
250
|
Bullet::Detector::UnusedEagerLoading.check_unused_preload_associations
|
|
249
251
|
expect(Bullet::Detector::Association).not_to be_has_unused_preload_associations
|
|
250
252
|
|
|
@@ -257,7 +259,7 @@ if active_record?
|
|
|
257
259
|
|
|
258
260
|
context 'category => posts => writer' do
|
|
259
261
|
it 'should not detect unused preload associations' do
|
|
260
|
-
category = Category.includes(
|
|
262
|
+
category = Category.includes(posts: :writer).order('id DESC').find_by_name('first')
|
|
261
263
|
category.posts.map do |post|
|
|
262
264
|
post.name
|
|
263
265
|
post.writer.name
|
|
@@ -329,7 +331,7 @@ if active_record?
|
|
|
329
331
|
expect(Bullet::Detector::Association).to be_completely_preloading_associations
|
|
330
332
|
end
|
|
331
333
|
|
|
332
|
-
it 'should
|
|
334
|
+
it 'should detect preload with comment => post' do
|
|
333
335
|
Comment.includes(:post).each do |comment|
|
|
334
336
|
comment.post.name
|
|
335
337
|
end
|
|
@@ -354,6 +356,17 @@ if active_record?
|
|
|
354
356
|
|
|
355
357
|
expect(Bullet::Detector::Association).to be_completely_preloading_associations
|
|
356
358
|
end
|
|
359
|
+
|
|
360
|
+
it 'should not detect newly assigned object in an after_save' do
|
|
361
|
+
new_post = Post.new(category: Category.first)
|
|
362
|
+
|
|
363
|
+
new_post.trigger_after_save = true
|
|
364
|
+
new_post.save!
|
|
365
|
+
Bullet::Detector::UnusedEagerLoading.check_unused_preload_associations
|
|
366
|
+
expect(Bullet::Detector::Association).not_to be_has_unused_preload_associations
|
|
367
|
+
|
|
368
|
+
expect(Bullet::Detector::Association).to be_completely_preloading_associations
|
|
369
|
+
end
|
|
357
370
|
end
|
|
358
371
|
|
|
359
372
|
context 'comment => post => category' do
|
|
@@ -387,7 +400,7 @@ if active_record?
|
|
|
387
400
|
end
|
|
388
401
|
|
|
389
402
|
it 'should not detect unpreload association' do
|
|
390
|
-
Comment.includes(:
|
|
403
|
+
Comment.includes(post: :category).each do |comment|
|
|
391
404
|
comment.post.category.name
|
|
392
405
|
end
|
|
393
406
|
Bullet::Detector::UnusedEagerLoading.check_unused_preload_associations
|
|
@@ -399,7 +412,7 @@ if active_record?
|
|
|
399
412
|
|
|
400
413
|
context 'comment => author, post => writer' do
|
|
401
414
|
it 'should detect non preloaded writer' do
|
|
402
|
-
Comment.includes([
|
|
415
|
+
Comment.includes(%i[author post]).where(['base_users.id = ?', BaseUser.first]).references(:base_users).each do |comment|
|
|
403
416
|
comment.post.writer.name
|
|
404
417
|
end
|
|
405
418
|
Bullet::Detector::UnusedEagerLoading.check_unused_preload_associations
|
|
@@ -409,7 +422,7 @@ if active_record?
|
|
|
409
422
|
end
|
|
410
423
|
|
|
411
424
|
it 'should detect unused preload with comment => author' do
|
|
412
|
-
Comment.includes([:author, { :
|
|
425
|
+
Comment.includes([:author, { post: :writer }]).where(['base_users.id = ?', BaseUser.first]).references(:base_users).each do |comment|
|
|
413
426
|
comment.post.writer.name
|
|
414
427
|
end
|
|
415
428
|
Bullet::Detector::UnusedEagerLoading.check_unused_preload_associations
|
|
@@ -419,7 +432,7 @@ if active_record?
|
|
|
419
432
|
end
|
|
420
433
|
|
|
421
434
|
it 'should detect non preloading with writer => newspaper' do
|
|
422
|
-
Comment.includes(:
|
|
435
|
+
Comment.includes(post: :writer).where("posts.name like '%first%'").references(:posts).each do |comment|
|
|
423
436
|
comment.post.writer.newspaper.name
|
|
424
437
|
end
|
|
425
438
|
Bullet::Detector::UnusedEagerLoading.check_unused_preload_associations
|
|
@@ -430,10 +443,10 @@ if active_record?
|
|
|
430
443
|
|
|
431
444
|
it 'should not raise a stack error from posts to category' do
|
|
432
445
|
expect {
|
|
433
|
-
Comment.includes(
|
|
446
|
+
Comment.includes(post: :category).each do |com|
|
|
434
447
|
com.post.category
|
|
435
448
|
end
|
|
436
|
-
}.not_to raise_error
|
|
449
|
+
}.not_to raise_error
|
|
437
450
|
end
|
|
438
451
|
end
|
|
439
452
|
end
|
|
@@ -526,6 +539,44 @@ if active_record?
|
|
|
526
539
|
expect(Bullet::Detector::Association).to be_completely_preloading_associations
|
|
527
540
|
end
|
|
528
541
|
end
|
|
542
|
+
|
|
543
|
+
context 'firm => clients => groups' do
|
|
544
|
+
it 'should detect non preload associations' do
|
|
545
|
+
Firm.all.each do |firm|
|
|
546
|
+
firm.groups.map(&:name)
|
|
547
|
+
end
|
|
548
|
+
Bullet::Detector::UnusedEagerLoading.check_unused_preload_associations
|
|
549
|
+
expect(Bullet::Detector::Association).not_to be_has_unused_preload_associations
|
|
550
|
+
|
|
551
|
+
expect(Bullet::Detector::Association).to be_detecting_unpreloaded_association_for(Firm, :groups)
|
|
552
|
+
end
|
|
553
|
+
|
|
554
|
+
it 'should detect preload associations' do
|
|
555
|
+
Firm.includes(:groups).each do |firm|
|
|
556
|
+
firm.groups.map(&:name)
|
|
557
|
+
end
|
|
558
|
+
Bullet::Detector::UnusedEagerLoading.check_unused_preload_associations
|
|
559
|
+
expect(Bullet::Detector::Association).not_to be_has_unused_preload_associations
|
|
560
|
+
|
|
561
|
+
expect(Bullet::Detector::Association).to be_completely_preloading_associations
|
|
562
|
+
end
|
|
563
|
+
|
|
564
|
+
it 'should not detect preload associations' do
|
|
565
|
+
Firm.all.map(&:name)
|
|
566
|
+
Bullet::Detector::UnusedEagerLoading.check_unused_preload_associations
|
|
567
|
+
expect(Bullet::Detector::Association).not_to be_has_unused_preload_associations
|
|
568
|
+
|
|
569
|
+
expect(Bullet::Detector::Association).to be_completely_preloading_associations
|
|
570
|
+
end
|
|
571
|
+
|
|
572
|
+
it 'should detect unused preload associations' do
|
|
573
|
+
Firm.includes(:groups).map(&:name)
|
|
574
|
+
Bullet::Detector::UnusedEagerLoading.check_unused_preload_associations
|
|
575
|
+
expect(Bullet::Detector::Association).to be_unused_preload_associations_for(Firm, :groups)
|
|
576
|
+
|
|
577
|
+
expect(Bullet::Detector::Association).to be_completely_preloading_associations
|
|
578
|
+
end
|
|
579
|
+
end
|
|
529
580
|
end
|
|
530
581
|
|
|
531
582
|
describe Bullet::Detector::Association, 'has_one' do
|
|
@@ -720,7 +771,7 @@ if active_record?
|
|
|
720
771
|
end
|
|
721
772
|
|
|
722
773
|
context 'whitelist n plus one query' do
|
|
723
|
-
before { Bullet.add_whitelist :
|
|
774
|
+
before { Bullet.add_whitelist type: :n_plus_one_query, class_name: 'Post', association: :comments }
|
|
724
775
|
after { Bullet.clear_whitelist }
|
|
725
776
|
|
|
726
777
|
it 'should not detect n plus one query' do
|
|
@@ -743,7 +794,7 @@ if active_record?
|
|
|
743
794
|
end
|
|
744
795
|
|
|
745
796
|
context 'whitelist unused eager loading' do
|
|
746
|
-
before { Bullet.add_whitelist :
|
|
797
|
+
before { Bullet.add_whitelist type: :unused_eager_loading, class_name: 'Post', association: :comments }
|
|
747
798
|
after { Bullet.clear_whitelist }
|
|
748
799
|
|
|
749
800
|
it 'should not detect unused eager loading' do
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'spec_helper'
|
|
2
4
|
|
|
3
5
|
if !mongoid? && active_record?
|
|
@@ -36,7 +38,7 @@ if !mongoid? && active_record?
|
|
|
36
38
|
expect(Bullet.collected_counter_cache_notifications).to be_empty
|
|
37
39
|
end
|
|
38
40
|
|
|
39
|
-
if active_record5?
|
|
41
|
+
if active_record5? || active_record6?
|
|
40
42
|
it 'should not need counter cache for has_many through' do
|
|
41
43
|
Client.all.each do |client|
|
|
42
44
|
client.firms.size
|
|
@@ -54,7 +56,7 @@ if !mongoid? && active_record?
|
|
|
54
56
|
|
|
55
57
|
it 'should not need counter cache with part of cities' do
|
|
56
58
|
Country.all.each do |country|
|
|
57
|
-
country.cities.where(:
|
|
59
|
+
country.cities.where(name: 'first').size
|
|
58
60
|
end
|
|
59
61
|
expect(Bullet.collected_counter_cache_notifications).to be_empty
|
|
60
62
|
end
|
|
@@ -72,7 +74,7 @@ if !mongoid? && active_record?
|
|
|
72
74
|
end
|
|
73
75
|
|
|
74
76
|
context 'whitelist' do
|
|
75
|
-
before { Bullet.add_whitelist :
|
|
77
|
+
before { Bullet.add_whitelist type: :counter_cache, class_name: 'Country', association: :cities }
|
|
76
78
|
after { Bullet.clear_whitelist }
|
|
77
79
|
|
|
78
80
|
it 'should not detect counter cache' do
|
data/spec/models/address.rb
CHANGED
data/spec/models/author.rb
CHANGED
data/spec/models/base_user.rb
CHANGED
data/spec/models/category.rb
CHANGED
data/spec/models/city.rb
CHANGED
data/spec/models/client.rb
CHANGED
data/spec/models/comment.rb
CHANGED
data/spec/models/company.rb
CHANGED
data/spec/models/country.rb
CHANGED
data/spec/models/document.rb
CHANGED
data/spec/models/entry.rb
CHANGED
data/spec/models/firm.rb
CHANGED
data/spec/models/folder.rb
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class Mongoid::Category
|
|
2
4
|
include Mongoid::Document
|
|
3
5
|
|
|
4
6
|
field :name
|
|
5
7
|
|
|
6
|
-
has_many :posts, :
|
|
7
|
-
has_many :entries, :
|
|
8
|
+
has_many :posts, class_name: 'Mongoid::Post'
|
|
9
|
+
has_many :entries, class_name: 'Mongoid::Entry'
|
|
8
10
|
end
|
data/spec/models/mongoid/post.rb
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class Mongoid::Post
|
|
2
4
|
include Mongoid::Document
|
|
3
5
|
|
|
4
6
|
field :name
|
|
5
7
|
|
|
6
|
-
has_many :comments, :
|
|
7
|
-
belongs_to :category, :
|
|
8
|
+
has_many :comments, class_name: 'Mongoid::Comment'
|
|
9
|
+
belongs_to :category, class_name: 'Mongoid::Category'
|
|
8
10
|
|
|
9
|
-
embeds_many :users, :
|
|
11
|
+
embeds_many :users, class_name: 'Mongoid::User'
|
|
10
12
|
|
|
11
|
-
scope :preload_comments,
|
|
13
|
+
scope :preload_comments, -> { includes(:comments) }
|
|
12
14
|
end
|
data/spec/models/mongoid/user.rb
CHANGED
data/spec/models/newspaper.rb
CHANGED
data/spec/models/page.rb
CHANGED
data/spec/models/person.rb
CHANGED
data/spec/models/pet.rb
CHANGED
data/spec/models/post.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class Post < ActiveRecord::Base
|
|
2
4
|
belongs_to :category, inverse_of: :posts
|
|
3
5
|
belongs_to :writer
|
|
@@ -12,4 +14,19 @@ class Post < ActiveRecord::Base
|
|
|
12
14
|
def link=(*)
|
|
13
15
|
comments.new
|
|
14
16
|
end
|
|
17
|
+
|
|
18
|
+
# see association_spec.rb 'should not detect newly assigned object in an after_save'
|
|
19
|
+
attr_accessor :trigger_after_save
|
|
20
|
+
after_save do
|
|
21
|
+
next unless trigger_after_save
|
|
22
|
+
|
|
23
|
+
temp_comment = Comment.new(post: self)
|
|
24
|
+
# this triggers self to be "possible", even though it's
|
|
25
|
+
# not saved yet
|
|
26
|
+
temp_comment.post
|
|
27
|
+
|
|
28
|
+
# category should NOT whine about not being pre-loaded, because
|
|
29
|
+
# it's obviously attached to a new object
|
|
30
|
+
category
|
|
31
|
+
end
|
|
15
32
|
end
|
data/spec/models/relationship.rb
CHANGED
data/spec/models/reply.rb
CHANGED
data/spec/models/student.rb
CHANGED
data/spec/models/submission.rb
CHANGED
data/spec/models/teacher.rb
CHANGED
data/spec/models/user.rb
CHANGED
data/spec/models/writer.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'rspec'
|
|
2
4
|
begin
|
|
3
5
|
require 'active_record'
|
|
@@ -33,7 +35,7 @@ Dir[File.join(SUPPORT, '*.rb')].reject { |filename| filename =~ /_seed.rb$/ }.so
|
|
|
33
35
|
RSpec.configure do |config|
|
|
34
36
|
config.extend Bullet::Dependency
|
|
35
37
|
|
|
36
|
-
config.filter_run :
|
|
38
|
+
config.filter_run focus: true
|
|
37
39
|
config.run_all_when_everything_filtered = true
|
|
38
40
|
end
|
|
39
41
|
|