Class: CurationConcerns::WorkRelation

Inherits:
ActiveFedora::Relation
  • Object
show all
Defined in:
app/search_builders/curation_concerns/work_relation.rb

Defined Under Namespace

Classes: DummyModel

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ WorkRelation

Returns a new instance of WorkRelation.



3
4
5
# File 'app/search_builders/curation_concerns/work_relation.rb', line 3

def initialize(opts = {})
  super(DummyModel, opts)
end

Instance Method Details

#equivalent_class?(klass) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'app/search_builders/curation_concerns/work_relation.rb', line 7

def equivalent_class?(klass)
  CurationConcerns.config.curation_concerns.include?(klass)
end

#search_model_clauseObject



11
12
13
14
15
16
# File 'app/search_builders/curation_concerns/work_relation.rb', line 11

def search_model_clause
  clauses = CurationConcerns.config.curation_concerns.map do |k|
    ActiveFedora::SolrQueryBuilder.construct_query_for_rel(has_model: k.to_s)
  end
  clauses.size == 1 ? clauses.first : "(#{clauses.join(' OR ')})"
end