Module: ActiveRecord::TokenFor

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/active_record/token_for.rb

Defined Under Namespace

Modules: ClassMethods, RelationMethods Classes: TokenDefinition

Instance Method Summary collapse

Instance Method Details

#generate_token_for(purpose) ⇒ Object

Generates a token for a predefined purpose.

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



119
120
121
# File 'lib/active_record/token_for.rb', line 119

def generate_token_for(purpose)
  self.class.token_definitions.fetch(purpose).generate_token(self)
end