# File lib/dm-types/bcrypt_hash.rb, line 20 def self.typecast(value, property) if value.nil? nil else begin value.is_a?(BCrypt::Password) ? value : BCrypt::Password.new(value) rescue BCrypt::Errors::InvalidHash BCrypt::Password.create(value, :cost => BCrypt::Engine::DEFAULT_COST) end end end