Guest User

Untitled

a guest
Jan 23rd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. class Users::RegistrationsController < Devise::RegistrationsController
  2.  
  3. def create
  4. build_resource
  5.  
  6. if resource.save
  7. if resource.active_for_authentication?
  8. set_flash_message :notice, :signed_up if is_navigational_format?
  9. sign_in(resource_name, resource)
  10. respond_with resource, :location => redirect_location(resource_name, resource)
  11. else
  12. debugger
  13. set_flash_message :notice, :inactive_signed_up, :reason => inactive_reason(resource) if is_navigational_format?
  14. expire_session_data_after_sign_in!
  15. respond_with resource, :location => after_inactive_sign_up_path_for(resource)
  16. end
  17. else
  18. clean_up_passwords(resource)
  19. respond_with_navigational(resource) { render_with_scope :new }
  20. end
  21. end
  22.  
  23. end
Add Comment
Please, Sign In to add comment