Skip to content

Instantly share code, notes, and snippets.

@marklalata
Last active July 11, 2020 09:12
Show Gist options
  • Select an option

  • Save marklalata/234172b2bb19fb0c7ae285c3b5b7986a to your computer and use it in GitHub Desktop.

Select an option

Save marklalata/234172b2bb19fb0c7ae285c3b5b7986a to your computer and use it in GitHub Desktop.
gem "devise_custom_authenticatable"
devise :custom_authenticatable,
:database_authenticatable,
:registerable,
:recoverable,
:rememberable,
:validatable
def valid_for_custom_authenticatable?(password)
self.has_role?(:admin)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment