5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-24 11:36:23 +00:00
panel/app/models/metadata_password.rb
f 915ba0761f
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
feat: usar mixins
2023-10-06 10:53:19 -03:00

20 lines
413 B
Ruby

# frozen_string_literal: true
# Almacena una contraseña
class MetadataPassword < MetadataString
include Metadata::NonIndexableConcern
private
alias_method :original_sanitize, :sanitize
# Sanitizar la string y generar un hash Bcrypt
#
# @param :string [String]
# @return [String]
def sanitize(string)
string = original_sanitize string
::BCrypt::Password.create(string).to_s
end
end