Skip to content

Instantly share code, notes, and snippets.

@carlesso
Created September 30, 2013 18:36
Show Gist options
  • Save carlesso/6768115 to your computer and use it in GitHub Desktop.
Save carlesso/6768115 to your computer and use it in GitHub Desktop.
def get_current_price_list(pl_type = "liquor", t = Time.now)
if price_level_override > 0
return PriceList.send(pl_type).find_by_code(price_level_override)
else
count = 1
count += t.wday * 24 * 4
count += t.hour * 4
count += t.min / 15
count
Schedule.where({:virtual_bar_id => id, :time_pointer => count}).first.price_list(pl_type)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment