Skip to content

Instantly share code, notes, and snippets.

@tarmolehtpuu
Created March 25, 2013 11:33
Show Gist options
  • Save tarmolehtpuu/5236550 to your computer and use it in GitHub Desktop.
Save tarmolehtpuu/5236550 to your computer and use it in GitHub Desktop.
class UserService
def self.register(params)
user = User.new
user.first_name = params[:first_name]
user.last_name = params[:last_name]
user.email = params[:email]
user.password = params[:password]
user.password_confirmation = params[:password_confirmation]
user.save
user
end
def self.register!(params)
user = User.new
user.first_name = params[:first_name]
user.last_name = params[:last_name]
user.email = params[:email]
user.password = params[:password]
user.password_confirmation = params[:password_confirmation]
user.save!
user
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment