Skip to content

Instantly share code, notes, and snippets.

@smcabrera
Created November 2, 2015 22:40
Show Gist options
  • Select an option

  • Save smcabrera/a5e2df1f0c9c4ce11436 to your computer and use it in GitHub Desktop.

Select an option

Save smcabrera/a5e2df1f0c9c4ce11436 to your computer and use it in GitHub Desktop.
def thirty_days_before_checkin_or_tomorrow
if checking_in_on.present?
date = checking_in_on - 30.days
if (date.to_i < created_at.to_i)
date = created_at + 1.day
end
date
else
'-'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment