Skip to content

Commit 8d54e7a

Browse files
committed
Chore: remove unused scopes on workshop_sponsor model
These scopes have been replaced by the new query so they're not needed and neither are the tests
1 parent 32e4973 commit 8d54e7a

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

app/models/workshop_sponsor.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,4 @@ class WorkshopSponsor < ApplicationRecord
33
belongs_to :workshop
44

55
validates :sponsor_id, uniqueness: { scope: :workshop_id, message: :already_sponsoring }
6-
7-
scope :hosts, -> { where('workshop_sponsors.host = ?', true) }
8-
scope :for_workshop, ->(workshop_id) { where('workshop_sponsors.workshop_id = ?', workshop_id) }
96
end

spec/models/workshop_sponsor_spec.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,4 @@
66
.with_message('already a sponsor')
77
end
88
end
9-
10-
context '#scopes' do
11-
context '#hosts' do
12-
it 'includes workshops with hosts' do
13-
workshop_sponsor = Fabricate(:workshop_sponsor, host: true)
14-
15-
expect(WorkshopSponsor.hosts).to include(workshop_sponsor)
16-
end
17-
18-
it 'excludes workshops without hosts' do
19-
expect(WorkshopSponsor.hosts).to eq []
20-
end
21-
end
22-
end
239
end

0 commit comments

Comments
 (0)