Skip to content

Instantly share code, notes, and snippets.

def path_to_attachment_image(attachment)
image_path("attachments/#{attachment.filename}")
end
class Time
# because i often times have trouble keeping these straight
# >> 1.day.ago.before? Time.now
# => true
# >> 1.day.from_now.before? Time.now
# => false
# >> 1.day.from_now.after? Time.now
# => true
# >> 1.day.ago.after? Time.now