Sha256: b93524e118d1b1ed0f4d3874a0a2a9b1e80079a2f960ad8f275e4c41daf66c28

Contents?: true

Size: 584 Bytes

Versions: 54

Compression:

Stored size: 584 Bytes

Contents

module Para
  module Component
    module Importable
      extend ActiveSupport::Concern

      included do
        configurable_on :importers
      end

      def importable?
        @importable ||= importers.length > 0
      end

      # TODO : Move :configuration column store to JSON instead of HStore
      # which handles more data types and will help us avoid eval here
      def importers
        @importers ||= if (importers = configuration['importers'].presence)
          eval(importers).map(&:constantize)
        else
          []
        end
      end
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
para-0.8.12 lib/para/component/importable.rb
para-0.8.11 lib/para/component/importable.rb
para-0.8.10 lib/para/component/importable.rb
para-0.8.9 lib/para/component/importable.rb
para-0.8.8 lib/para/component/importable.rb
para-0.8.7 lib/para/component/importable.rb
para-0.8.5 lib/para/component/importable.rb
para-0.8.3.3 lib/para/component/importable.rb
para-0.8.3.2 lib/para/component/importable.rb
para-0.8.3.1 lib/para/component/importable.rb
para-0.8.3 lib/para/component/importable.rb
para-0.8.2.3 lib/para/component/importable.rb
para-0.8.2.2 lib/para/component/importable.rb
para-0.8.2.1 lib/para/component/importable.rb
para-0.8.2 lib/para/component/importable.rb
para-0.8.1 lib/para/component/importable.rb
para-0.8.0 lib/para/component/importable.rb
para-0.7.4.p1 lib/para/component/importable.rb
para-0.7.4 lib/para/component/importable.rb
para-0.7.3.p6 lib/para/component/importable.rb