Glitch discovered if the app is running for the first time, the last_session = Session.last will raise an exception since the database is empty. This adds a conditional check to wrap it in of if Session.any? and if false it will create a new session.
Glitch discovered if the app is running for the first time, the
last_session = Session.last
will raise an exception since the database is empty. This adds a conditional check to wrap it in ofif Session.any?
and if false it will create a new session.