Sha256: 11f0c1aa5a9a66e9d4ec9c642cc1b68f6141f6b126d0e25ebe9a12c5a64908c7

Contents?: true

Size: 614 Bytes

Versions: 4

Compression:

Stored size: 614 Bytes

Contents

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

4 entries across 4 versions & 1 rubygems

Version Path
hashid-rails-1.2.1 lib/hashid/rails/configuration.rb
hashid-rails-1.2.0 lib/hashid/rails/configuration.rb
hashid-rails-1.1.1 lib/hashid/rails/configuration.rb
hashid-rails-1.1.0 lib/hashid/rails/configuration.rb