From 0a453330d7b3dee6187a010a338729af621bd0c5 Mon Sep 17 00:00:00 2001 From: Jonathan Hefner Date: Sun, 10 Sep 2023 16:30:48 -0500 Subject: [PATCH] Fix ActiveRecord::TokenFor documentation [ci-skip] RDoc was confused by the placement of `:nodoc:`, causing it to skip the documentation for `ActiveRecord::TokenFor#generate_token_for` (though not the documentation for `ActiveRecord::TokenFor::ClassMethods`). Also, RDoc supports `` tags but not `` tags. (Though, ironically, it converts `` tags to `` tags when rendering.) --- activerecord/lib/active_record/token_for.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/activerecord/lib/active_record/token_for.rb b/activerecord/lib/active_record/token_for.rb index 1afe18a79b0..3b521922443 100644 --- a/activerecord/lib/active_record/token_for.rb +++ b/activerecord/lib/active_record/token_for.rb @@ -11,8 +11,7 @@ module ActiveRecord class_attribute :generated_token_verifier, instance_accessor: false, instance_predicate: false end - # :nodoc: - TokenDefinition = Struct.new(:defining_class, :purpose, :expires_in, :block) do + TokenDefinition = Struct.new(:defining_class, :purpose, :expires_in, :block) do # :nodoc: def full_purpose @full_purpose ||= [defining_class.name, purpose, expires_in].join("\n") end @@ -56,9 +55,9 @@ module ActiveRecord # JSON. Later, when fetching the record with #find_by_token_for, the block # will be evaluated again in the context of the fetched record. If the two # JSON values do not match, the token will be treated as invalid. Note - # that the value returned by the block should not contain - # sensitive information because it will be embedded in the token - # as human-readable plaintext JSON. + # that the value returned by the block should not contain sensitive + # information because it will be embedded in the token as + # human-readable plaintext JSON. # # ==== Examples # @@ -105,7 +104,7 @@ module ActiveRecord # Generates a token for a predefined +purpose+. # - # Use ClassMethods::generates_token_for to define a token purpose and + # Use ClassMethods#generates_token_for to define a token purpose and # behavior. def generate_token_for(purpose) self.class.token_definitions.fetch(purpose).generate_token(self)