Skip to content
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
Closed
@dgoerger

Description

@dgoerger

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions