Skip to content

Commit

Permalink
fix(booking): prevent save if instance is set
Browse files Browse the repository at this point in the history
  • Loading branch information
stakach committed Aug 13, 2024
1 parent fee0ec2 commit e05aea5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/placeos-models/booking.cr
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ module PlaceOS::Model
validate :booking_start, "must not clash with an existing booking", ->(this : self) { !this.clashing? }
validate :asset_ids, "must be unique", ->(this : self) { this.unique_ids? }
validate :booking_end, "must be after booking_start", ->(this : self) { this.booking_end > this.booking_start }
validate :instance, "must not be set", ->(this : self) { this.instance.nil? }

before_save do
@user_id ||= booked_by_id
Expand Down

0 comments on commit e05aea5

Please sign in to comment.