Advertisement
VladikOtez

Issue#1 Interactor

May 17th, 2017
1,334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.31 KB | None | 0 0
  1. class ReviewCard
  2.   include Interactor
  3.  
  4.   def call
  5.     translation =    context.translation
  6.     card        =   Card.find(context.id)
  7.     if card.translated_text.downcase ==
  8.                 translation.downcase
  9.       card.refresh_review_date
  10.     else
  11.       context.fail!(message 'Bad')
  12.     end
  13.   end
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement