Sha256: 1cb3b173e3f063159cb950100abcd574cfff6eecbe058bac1289b605543d7e59

Contents?: true

Size: 572 Bytes

Versions: 11

Compression:

Stored size: 572 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

11 entries across 11 versions & 1 rubygems

Version Path
active-fedora-9.7.3 lib/active_fedora/associations/builder/property.rb
active-fedora-9.7.2 lib/active_fedora/associations/builder/property.rb
active-fedora-9.9.1 lib/active_fedora/associations/builder/property.rb
active-fedora-9.9.0 lib/active_fedora/associations/builder/property.rb
active-fedora-9.8.2 lib/active_fedora/associations/builder/property.rb
active-fedora-9.8.1 lib/active_fedora/associations/builder/property.rb
active-fedora-9.8.0 lib/active_fedora/associations/builder/property.rb
active-fedora-9.7.1 lib/active_fedora/associations/builder/property.rb
active-fedora-9.7.0 lib/active_fedora/associations/builder/property.rb
active-fedora-9.6.2 lib/active_fedora/associations/builder/property.rb
active-fedora-9.6.1 lib/active_fedora/associations/builder/property.rb