Sha256: 9542e6f27d3b7c6466b330ee3adc16a28fd85b43c35025f90e80c03d2a8fb77f

Contents?: true

Size: 558 Bytes

Versions: 4

Compression:

Stored size: 558 Bytes

Contents

module ActiveFedora::Associations::Builder
  class Property < Association

    self.macro = :rdf
    self.valid_options = [:class_name, :predicate]

    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

4 entries across 4 versions & 1 rubygems

Version Path
active-fedora-9.2.1 lib/active_fedora/associations/builder/property.rb
active-fedora-9.2.0 lib/active_fedora/associations/builder/property.rb
active-fedora-9.2.0.rc2 lib/active_fedora/associations/builder/property.rb
active-fedora-9.2.0.rc1 lib/active_fedora/associations/builder/property.rb