Sha256: 478e7b98847bd2de67e5341bd71c6b29a3dbee48de0fe4643e1f7ef53c4de291

Contents?: true

Size: 645 Bytes

Versions: 1

Compression:

Stored size: 645 Bytes

Contents

# frozen_string_literal: true

module Hashid
  module Rails
    class Configuration
      attr_accessor :salt,
                    :min_hash_length,
                    :alphabet,
                    :override_find,
                    :sign_hashids

      def initialize
        @salt = ""
        @min_hash_length = 6
        @alphabet = "abcdefghijklmnopqrstuvwxyz" \
                    "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \
                    "1234567890"
        @override_find = true
        @sign_hashids = true
      end

      def for_table(table_name)
        ["#{table_name}#{salt}", min_hash_length, alphabet]
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hashid-rails-1.2.2 lib/hashid/rails/configuration.rb