Class: CurationConcerns::WorkRelation
- Inherits:
-
ActiveFedora::Relation
- Object
- ActiveFedora::Relation
- CurationConcerns::WorkRelation
- Defined in:
- app/search_builders/curation_concerns/work_relation.rb
Defined Under Namespace
Classes: DummyModel
Instance Method Summary collapse
- #equivalent_class?(klass) ⇒ Boolean
-
#initialize(opts = {}) ⇒ WorkRelation
constructor
A new instance of WorkRelation.
- #search_model_clause ⇒ Object
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
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_clause ⇒ Object
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 |