class RegistrationsController < Devise::RegistrationsController
	before_filter :configure_permitted_parameters, if: :devise_controller?

  protected

  def configure_permitted_parameters
    devise_parameter_sanitizer.for(:sign_up) << :username << :legal_agreement
  end

  def after_sign_in_path_for(resource)
    session[:previous_url] || courses_path
  end

  def after_sign_up_path_for(resource)
    session[:previous_url] || courses_path(:ref => "signup", :newuser => "true")
  end

  def after_update_path_for(resource)
    courses_path
  end
end

class RegistrationsController < Devise::RegistrationsController
	before_filter :configure_permitted_parameters, if: :devise_controller?

  protected

  def configure_permitted_parameters
    devise_parameter_sanitizer.for(:sign_up) << :username << :legal_agreement
  end

  def after_sign_up_path_for(resource)
    session[:previous_url] || courses_path(:ref => "signup", :newuser => "true")
  end

  def after_update_path_for(resource)
    courses_path
  end
end

Remove redundant after_sign_in method from registrations controller
Remove redundant after_sign_in method from registrations controller
