Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 617 Bytes

compiler_activerecordsecuretoken.md

File metadata and controls

26 lines (20 loc) · 617 Bytes

ActiveRecordSecureToken

Tapioca::Dsl::Compilers::ActiveModelSecurePassword decorates RBI files for all classes that use ActiveRecord::SecureToken.

For example, with the following class:

class User < ActiveRecord::Base
  has_secure_token
  has_secure_token :auth_token, length: 36
end

this compiler will produce an RBI file with the following content:

# typed: true

class User
  sig { returns(T::Boolean) }
  def regenerate_token; end

  sig { returns(T::Boolean) }
  def regenerate_auth_token; end
end