You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The Vote schema defines a changeset/2 function that casts no fields and validates nothing (cast(attrs, []) + validate_required([])), providing zero input validation. However, the app never uses this changeset votes are inserted directly via %Vote{…} |> Repo.insert().
Expected behavior
Schema changesets should enforce required fields and proper casting/validation (e.g. cast(attrs, [:dealt_card_id, :player_id]) + validate_required([:dealt_card_id, :player_id])) to prevent invalid data, follow Ecto best practices, and protect against future misuse.
Additional context
Not currently exploitable DB foreign-key constraints + direct struct insertion prevent bad data today. Still poor practice / technical debt: empty changeset violates Ecto conventions and creates risk if anyone later starts using Vote.changeset/2 (e.g. API, admin form, bulk insert). Fix recommended for maintainability and defense-in-depth.
Describe the bug
The
Voteschema defines achangeset/2function that casts no fields and validates nothing (cast(attrs, [])+validate_required([])), providing zero input validation. However, the app never uses this changeset votes are inserted directly via%Vote{…} |> Repo.insert().Expected behavior
Schema changesets should enforce required fields and proper casting/validation (e.g.
cast(attrs, [:dealt_card_id, :player_id])+validate_required([:dealt_card_id, :player_id])) to prevent invalid data, follow Ecto best practices, and protect against future misuse.Desktop (please complete the following information):
OS: N/A (server-side schema / code quality issue)
Browser: N/A (server-side schema / code quality issue)
Version: N/A (server-side schema / code quality issue)
Additional context
Not currently exploitable DB foreign-key constraints + direct struct insertion prevent bad data today. Still poor practice / technical debt: empty changeset violates Ecto conventions and creates risk if anyone later starts using
Vote.changeset/2(e.g. API, admin form, bulk insert). Fix recommended for maintainability and defense-in-depth.