File tree Expand file tree Collapse file tree 2 files changed +0
-17
lines changed Expand file tree Collapse file tree 2 files changed +0
-17
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,4 @@ class WorkshopSponsor < ApplicationRecord
3
3
belongs_to :workshop
4
4
5
5
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 ) }
9
6
end
Original file line number Diff line number Diff line change 6
6
. with_message ( 'already a sponsor' )
7
7
end
8
8
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
23
9
end
You can’t perform that action at this time.
0 commit comments