Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/models/ranked_choice_decision.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class RankedChoiceDecision < ApplicationRecord

validates :decision, inclusion: { in: DECISIONS }
validates :reason, inclusion: { in: REASONS, allow_nil: true }
validates :signup_ranked_choice, presence: { unless: ->(record) { record.decision == "skip_user" } }

private

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def generate_csv_cell(decision)
ilike_column_filter :title, association_name: :event

def generate_csv_cell(decision)
decision.event.title
decision.event&.title
end
end

Expand Down
4 changes: 2 additions & 2 deletions app/services/user_signup_constraints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ def at_maximum_signups?
def concurrent_signups_for_run(run)
current_signups_including_not_counted.select do |signup|
other_run = signup.run
!other_run.event.can_play_concurrently? && run.overlaps?(other_run)
other_run == run || (!other_run.event.can_play_concurrently? && run.overlaps?(other_run))
end
end

def concurrent_signup_requests_for_run(run)
pending_signup_requests_including_not_counted.select do |signup_request|
other_run = signup_request.target_run
!other_run.event.can_play_concurrently? && run.overlaps?(other_run)
other_run == run || (!other_run.event.can_play_concurrently? && run.overlaps?(other_run))
end
end

Expand Down
19 changes: 19 additions & 0 deletions db/migrate/20260409003354_make_lottery_number_index_deferrable.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class MakeLotteryNumberIndexDeferrable < ActiveRecord::Migration[8.1]
def up
remove_index :user_con_profiles, %i[convention_id lottery_number], unique: true
execute <<~SQL
ALTER TABLE user_con_profiles
ADD CONSTRAINT index_user_con_profiles_on_convention_id_and_lottery_number
UNIQUE (convention_id, lottery_number)
DEFERRABLE INITIALLY DEFERRED;
SQL
end

def down
execute <<~SQL
ALTER TABLE user_con_profiles
DROP CONSTRAINT index_user_con_profiles_on_convention_id_and_lottery_number;
SQL
add_index :user_con_profiles, %i[convention_id lottery_number], unique: true
end
end
16 changes: 9 additions & 7 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3742,6 +3742,14 @@ ALTER TABLE ONLY public.forms
ADD CONSTRAINT forms_pkey PRIMARY KEY (id);


--
-- Name: user_con_profiles index_user_con_profiles_on_convention_id_and_lottery_number; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.user_con_profiles
ADD CONSTRAINT index_user_con_profiles_on_convention_id_and_lottery_number UNIQUE (convention_id, lottery_number) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: maximum_event_provided_tickets_overrides maximum_event_provided_tickets_overrides_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -5117,13 +5125,6 @@ CREATE INDEX index_user_activity_alerts_on_convention_id ON public.user_activity
CREATE INDEX index_user_activity_alerts_on_user_id ON public.user_activity_alerts USING btree (user_id);


--
-- Name: index_user_con_profiles_on_convention_id_and_lottery_number; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_user_con_profiles_on_convention_id_and_lottery_number ON public.user_con_profiles USING btree (convention_id, lottery_number);


--
-- Name: index_user_con_profiles_on_convention_id_and_user_id; Type: INDEX; Schema: public; Owner: -
--
Expand Down Expand Up @@ -6140,6 +6141,7 @@ ALTER TABLE ONLY public.cms_files_pages
SET search_path TO "$user", public;

INSERT INTO "schema_migrations" (version) VALUES
('20260409003354'),
('20260321193050'),
('20260315200824'),
('20260315182359'),
Expand Down
Loading