Skip to content

Commit

Permalink
Bug fix: bookings from canceled bookings periods showed up in list
Browse files Browse the repository at this point in the history
  • Loading branch information
martent committed Jun 6, 2018
1 parent d656f4c commit df49559
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/booking.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Booking < ApplicationRecord
scope :free, -> { where(company: nil) }
scope :booked, -> { where.not(company: nil) }

scope :present, -> { where('date >= ?', Date.today) }
scope :present, -> { where('date >= ?', Date.today).where.not(booking_period: nil) }
scope :past, -> { where('date < ?', Date.today) }

# Only allow destruction in current booking period
Expand Down

0 comments on commit df49559

Please sign in to comment.