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.

Reservation generator hard-fails in seeds script #629

Closed
@shippy

Description

@shippy

Currently, the seeds script stops if the Reservation generator creates an object that fails validation. This usually happens for two reasons:

  • A previously generated Blackout occurs during start or end date of the Reservation
  • A previously generated Reservation overlaps with the currently generated object

The probability of validation failure increases with the number of Reservations and Blackouts generated.

There are two possible solutions. I favor the second.

  1. Write Reservation-generating logic that will prevent conflicts
  2. Wrap the current Reservation-generating logic in a begin..rescue ActiveRecord::RecordInvalid { continue } block, which ignores the error but allows the seeds script to continue.

Thoughts?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions