Skip to content

Instantly share code, notes, and snippets.

@Fokusnica
Last active August 29, 2015 14:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fokusnica/e8b5b03bdc69db5a1e2f to your computer and use it in GitHub Desktop.
Save Fokusnica/e8b5b03bdc69db5a1e2f to your computer and use it in GitHub Desktop.
email_notification
def email_notification_params
{
penalty: ((reader_with_book.book.penalty_per_hour + 0.005)* 100).to_i / 100.0,
hours_to_deadline: ((issue_datetime.to_i - Time.now.to_i) / 3600) ,
reader_name: reader_with_book.name ,
book_tit: reader_with_book.book.title ,
book_aut: reader_with_book.book.author.name
}
end
def email_notification
#use email_notification_params
<<-TEXT
Hello, #{email_notification_params[:reader_name]}!
We remind you that you should return the book "#{email_notification_params[:book_tit]}" authored by
#{email_notification_params[:book_aut]} in #{email_notification_params[:hours_to_deadline]} hours.
Otherwise you will be charged ¢ #{email_notification_params[:penalty]} per hour.
TEXT
end
@eovolkov
Copy link

eovolkov commented Jul 2, 2015

У нас же вроде как усложненное пенальти стало а у тебя по старому. Или я ошибаюсь?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment