Sha256: ac1c345cad61b0edc5f269181b24c89ae301f852129c0f73d4472d7cfb1c4ed5

Contents?: true

Size: 783 Bytes

Versions: 4

Compression:

Stored size: 783 Bytes

Contents

require "active_record"
require "active_record/simple_index_name/version"
require "active_record/simple_index_name/configuration"
require "active_record/simple_index_name/disable_shorten"
require "active_record/simple_index_name/enable_shorten"

module ActiveRecord
  module SimpleIndexName
    def self.config
      @config ||= Configuration.new
    end

    def self.configure
      yield config if block_given?
    end

    def self.with_shorten(shorten)
      Thread.current[:simple_index_name_shorten_mode] = shorten

      yield if block_given?
    ensure
      Thread.current[:simple_index_name_shorten_mode] = nil
    end
  end
end

if defined?(Rails)
  require "active_record/simple_index_name/railtie"
else
  require "active_record/simple_index_name/active_record_ext"
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
activerecord-simple_index_name-0.3.0 lib/active_record/simple_index_name.rb
activerecord-simple_index_name-0.3.0.beta1 lib/active_record/simple_index_name.rb
activerecord-simple_index_name-0.2.0 lib/active_record/simple_index_name.rb
activerecord-simple_index_name-0.2.0.beta1 lib/active_record/simple_index_name.rb