Sha256: b3db3feaedb0c0776fccd2728ca47546eb9d89ff283e02c241550fb3560fd86e

Contents?: true

Size: 891 Bytes

Versions: 2

Compression:

Stored size: 891 Bytes

Contents

# frozen_string_literal: true

module Importo
  class BaseImporter
    include ActionView::Helpers::SanitizeHelper
    include Importable
    include Exportable
    include Revertable
    include Original
    include ResultFeedback
    include ImporterDsl
    # include ActiveStorage::Downloading

    delegate :friendly_name, :introduction, :model, :columns, :csv_options, :allow_duplicates?, :includes_header?,
             :ignore_header?, :t, to: :class
    attr_reader :import, :blob

    def initialize(imprt = nil)
      @import = imprt
      I18n.locale = import.locale if import&.locale # Should we do this?? here??
    end

    class << self
      def t(key, options = {})
        if I18n.exists? "importers.#{name.underscore}#{key}".to_sym
          I18n.t(key,
                 options.merge(scope: "importers.#{name.underscore}".to_sym))
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
importo-2.0.5 app/importers/importo/base_importer.rb
importo-2.0.4 app/importers/importo/base_importer.rb