I am trying to move some code from my controller and to a service object. How can I access the helper method sign_in from a service object.
class CompleteAccountRegistration
def self.call(account_id, plan_id)
@account = Account.find(account_id)
self.create_user_account
self.create_subscription(plan_id)
sign_in(User.find(@account.owner_id))
end
In my tests, the following error appears.
NoMethodError:
undefined method `sign_in' for CompleteAccountRegistration:Class
Steve source
share