lib/pg_trunk/operations/triggers/base.rb
# Generate the name of the trigger using the essential options
# @return [PGTrunk::QualifiedName]
Generate the name of the trigger using the essential options
Generate the name of the trigger using the essential options
def generated_name
      return @generated_name if instance_variable_defined?(:@generated_name)
      @generated_name = begin
        return if [table, function, type, events].any?(&:blank?)
        key_options = to_h.reject { |_, v| v.blank? }.slice(
          :table, :function, :for_each, :type, :events,
        )
        identifier = "#{table.lean}_#{key_options}_tg"
        hashed_identifier = Digest::SHA256.hexdigest(identifier).first(10)
        PGTrunk::QualifiedName.wrap("tg_rails_#{hashed_identifier}")
      end
    end
def generated_name return @generated_name if instance_variable_defined? ( :@generated_name ) @generated_name = begin return if [ table , function , type , events ] . any? ( & :blank? ) key_options = to_h . reject { | _ , v | v . blank? } . slice ( :table , :function , :for_each , :type , :events , ) identifier = "#{table.lean}_#{key_options}_tg" hashed_identifier = Digest :: SHA256 . hexdigest ( identifier ) . first ( 10 ) PGTrunk :: QualifiedName . wrap ( "tg_rails_#{hashed_identifier}" ) end end
Generate the name of the trigger using the essential options
Generate the name of the trigger using the essential options
None
PGTrunk::QualifiedName