Sha256: f20f9ca46b5ddae8cbec2b8df3333de4af427f5387724b691940b717b27805de

Contents?: true

Size: 670 Bytes

Versions: 3

Compression:

Stored size: 670 Bytes

Contents

require 'fiona7/super_id_finder'
require 'fiona7/attribute_names_from_cms'

module Fiona7
  class ReferencedIdFinder
    def initialize(fields=[], connection=::Fiona7::WriteObj.connection, instance_name=RailsConnector::CmsBaseModel.instance_name)
      fields     = fields.map {|f|
        Fiona7::AttributeNamesFromCms.new(f).attributes
      }.flatten
      forbidden  = Fiona7::ForbiddenObjClasses.new.call

      @id_finder = Fiona7::SuperIdFinder.new(
        forbidden, fields, connection, instance_name
      )
    end

    def find(klass, ids)
      @id_finder.find(
        klass == Fiona7::ReleasedObj ? :live : :preview,
        ids
      )
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
infopark_fiona7-1.6.1.1.5 lib/fiona7/referenced_id_finder.rb
infopark_fiona7-1.6.1.1.1 lib/fiona7/referenced_id_finder.rb
infopark_fiona7-1.6.1.1.0 lib/fiona7/referenced_id_finder.rb