title: implement a booking lock for users in a scheduling app
body: <p>I've built a scheduling web app where users can book a conference for a given date and time slot on that date.</p>
  
  <p>Now I need to implement a booking lock, which means that the admin can apply this lock and users can no longer book from that time on.</p>
  
  <p>My current design includes a model booking_lock that only has one attribute of "status" with values of "On" and "Off".</p>
  
  <p>The model would have only one record in the database at any given time as its sole responsibility would be to provide the data to check if booking has been locked.</p>
  
  <p>---------------------EDIT-----------------------------------</p>
  
  <p>This is not meant to lock individual records (conferences). To do this I use the attribute of user_id. If that is 0, then the conference is available for booking.</p>
  
  <p>What I want to do now is disable (lock) the booking entirely before the user hits the database.</p>
  
  <p>For example:</p>
  
  <p>When a user logs on they see a notification saying the booking is locked. Also, they wouldn't see a respective button to book a conference and if by chance they would navigate to the respective URL they would be redirected to home page with the same notice as above. I've got all this covered.</p>
  
  <p>But I need a general switch to be turned on and off and be the basis for this kind of check. Hence the booking_lock model.</p>
  
  <p>Note: I use hanami-model.</p>
  
  <p>---------------------EDIT-----------------------------------</p>
  
  <p>My question is twofold:</p>
  
  <ol>
  <li>Is there a better way of implementing such a lock?</li>
  <li>How to ensure there is only one record in the db for such lock?</li>
  </ol>