Skip to Content Skip to Search
Namespace
Methods
G

Instance Public methods

generate_token_for(purpose)

Generates a token for a predefined purpose.

Use ClassMethods#generates_token_for to define a token purpose and behavior.

# File activerecord/lib/active_record/token_for.rb, line 109
def generate_token_for(purpose)
  self.class.token_definitions.fetch(purpose).generate_token(self)
end