class Avo::ApplicationController

def check_avo_license

def check_avo_license
  # Check to see if the path is on a custom tool
  unless on_root_path || on_resources_path || on_api_path
    # Display alert on custom tool page if in development.
    if @license.lacks(:custom_tools) || @license.invalid?
      if Rails.env.development? || Rails.env.test?
        @custom_tools_alert_visible = true
      elsif @license.lacks_with_trial(:custom_tools)
        # Raise error in non-development environments.
        raise Avo::LicenseInvalidError, "Your license is invalid or doesn't support custom tools."
      end
    end
  end
end