VladikOtez

Issue#1 Interactor

May 17th, 2017
636
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data