class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception

  def after_invite_path_for(*)
    users_path
  end

  def after_sign_in_path_for(resource)
    manager_setup = ManagerSetup.new(resource, session)
    if manager_setup.setup_office?
      manager_setup.start!
      edit_office_path(current_user.office)
    else
      root_path
    end
  end

  private

  def evidence_check_enabled?
    Settings.evidence_check.enabled == true
  end
  helper_method :evidence_check_enabled?

  def payment_enabled?
    Settings.payment.enabled == true
  end
  helper_method :payment_enabled?
end

class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception

  def after_invite_path_for(*)
    users_path
  end

  def after_sign_in_path_for(resource)
    manager_setup = ManagerSetup.new(resource, session)
    if manager_setup.setup_office?
      manager_setup.start!
      edit_office_path(current_user.office)
    else
      root_path
    end
  end

  private

  def evidence_check_enabled?
    Settings.evidence_check.enabled.equal?(true)
  end
  helper_method :evidence_check_enabled?

  def payment_enabled?
    Settings.payment.enabled.equal?(true)
  end
  helper_method :payment_enabled?
end

Improve feature toggle condition handling
Improve feature toggle condition handling
