diaspora/app/controllers/registrations_controller.rb
Sarah Mei 1b6726354f Backfill specs for RegistrationsController#create.
Remove RegistrationsController#new (which just called super, so it's not necessary).
2010-10-16 21:14:37 -07:00

24 lines
606 B
Ruby

# Copyright (c) 2010, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
class RegistrationsController < Devise::RegistrationsController
def create
begin
user = User.instantiate!(params[:user])
rescue MongoMapper::DocumentNotValid => e
user = nil
flash[:error] = e.message
end
if user
flash[:notice] = I18n.t 'registrations.create.success'
sign_in_and_redirect(:user, user)
else
redirect_to new_user_registration_path
end
end
def update
super
end
end