Sha256: 7e2f6cfb1f7e125905533d946ba111797c94999bbbb1003abe360a97629fc144
Contents?: true
Size: 785 Bytes
Versions: 8
Compression:
Stored size: 785 Bytes
Contents
module Ecm::UserArea class CreateDefaultUserService < Itsf::Services::V2::Service::Base class Response < Itsf::Services::V2::Response::Base attr_accessor :user end def do_work response.user = create_default_user respond end private def create_default_user user = Ecm::UserArea::User.new(user_attributes) if user.save info 'Created default user' else error "Could not create default user. Errors: #{user.errors.full_messages.to_sentence}" end user end def user_attributes { email: 'user@example.com', password: 'password', password_confirmation: 'password', active: true, approved: true, confirmed: true } end end end
Version data entries
8 entries across 8 versions & 1 rubygems