This repository was archived by the owner on Jul 24, 2020. It is now read-only.
This repository was archived by the owner on Jul 24, 2020. It is now read-only.
Review validations code #573
Closed
Description
We should review the code in models/reservation_validations.rb, and clean it up. Some functions may not be used any more (no_overdue_reservations? ?), we should use scopes where they exist rather than duplicate SQL queries, edge cases which say "return true" to avoid errors should maybe be reevaluated (not_renewable?), and we should make sure validations run over the correct sets rather than over everything always (not_renewable? should use the "active" scope).
Additionally, do the errors added in the validation tests get called or used anywhere? We add errors manually in validate_set. If this duplication serves no purpose, we could greatly simplify our validations by turning them into straightforward booleans.
Activity