Sha256: a9adf8a6db9ae643b3ff723872cfebb4c83f0f005269cc5ff9214840e1b9d7a1

Contents?: true

Size: 587 Bytes

Versions: 9

Compression:

Stored size: 587 Bytes

Contents

# frozen_string_literal: true

module ActiveReport
  class Configuration

    attr_accessor :csv_force_encoding, :csv_options, :import_adapter, :import_options

    def initialize
      @csv_force_encoding = true
      @csv_options = { encoding: 'UTF-8' }
      @import_adapter = 'mysql2_adapter'
      @import_options = { validate: false, on_duplicate_key_ignore: true }
    end

  end

  def self.configuration
    @configuration ||= Configuration.new
  end

  def self.configuration=(config)
    @configuration = config
  end

  def self.configure
    yield(configuration)
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
active_report-5.3.0 lib/active_report/configuration.rb
active_report-5.2.7 lib/active_report/configuration.rb
active_report-5.2.6 lib/active_report/configuration.rb
active_report-5.2.5 lib/active_report/configuration.rb
active_report-5.2.4 lib/active_report/configuration.rb
active_report-5.2.3 lib/active_report/configuration.rb
active_report-5.2.1 lib/active_report/configuration.rb
active_report-5.2.0 lib/active_report/configuration.rb
active_report-5.1.0 lib/active_report/configuration.rb