Last active
August 29, 2015 14:24
-
-
Save Fokusnica/e8b5b03bdc69db5a1e2f to your computer and use it in GitHub Desktop.
email_notification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
У нас же вроде как усложненное пенальти стало а у тебя по старому. Или я ошибаюсь?