Module: ActiveRecord::TokenFor
- Extended by:
- ActiveSupport::Concern
- Included in:
- Base
- Defined in:
- activerecord/lib/active_record/token_for.rb
Defined Under Namespace
Modules: ClassMethods Classes: TokenDefinition
Instance Method Summary collapse
-
#generate_token_for(purpose) ⇒ Object
Generates a token for a predefined
purpose
.
Methods included from ActiveSupport::Concern
append_features, class_methods, extended, included, prepend_features, prepended
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.
110 111 112 |
# File 'activerecord/lib/active_record/token_for.rb', line 110 def generate_token_for(purpose) self.class.token_definitions.fetch(purpose).generate_token(self) end |