Sha256: 22785c14a0a49af58b2c6d97af26fe1004a426fb26e1279d4a6ece3cf15ef64b

Contents?: true

Size: 577 Bytes

Versions: 2

Compression:

Stored size: 577 Bytes

Contents

module ActiveFedora::Associations::Builder
  class Property < Association
    def self.macro
      :rdf
    end

    def self.valid_options(options)
      super
    end

    def initialize(model, name, options)
      super
      @name = :"#{name.to_s.singularize}_ids"
    end

    def build
      super.tap do |reflection|
        model.index_config[name] = build_index_config(reflection)
      end
    end

    def build_index_config(reflection)
      ActiveFedora::Indexing::Map::IndexObject.new(reflection.predicate_for_solr) { |index| index.as :symbol }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active-fedora-9.10.0.pre2 lib/active_fedora/associations/builder/property.rb
active-fedora-9.10.0.pre1 lib/active_fedora/associations/builder/property.rb