Sha256: f4d2b9c77148c2dde64838f889e49bb787bf1065cc707874fcdbda523c16831c

Contents?: true

Size: 575 Bytes

Versions: 6

Compression:

Stored size: 575 Bytes

Contents

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

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

    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

6 entries across 6 versions & 1 rubygems

Version Path
active-fedora-9.5.0 lib/active_fedora/associations/builder/property.rb
active-fedora-9.4.3 lib/active_fedora/associations/builder/property.rb
active-fedora-9.4.2 lib/active_fedora/associations/builder/property.rb
active-fedora-9.4.1 lib/active_fedora/associations/builder/property.rb
active-fedora-9.4.0 lib/active_fedora/associations/builder/property.rb
active-fedora-9.3.0 lib/active_fedora/associations/builder/property.rb