Class: SearchValidatorReview

Inherits:
SearchValidator show all
Defined in:
lib/search_validator_review.rb

Overview

Validates the searches of a specific user on a given sistematic review A search is valid if all records have enough information: title, year, authors and abstract

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sr) ⇒ SearchValidatorReview

Returns a new instance of SearchValidatorReview.



37
38
39
40
# File 'lib/search_validator_review.rb', line 37

def initialize(sr)
  @sr=sr
  super()
end

Instance Attribute Details

#srObject (readonly)

Returns the value of attribute sr.



35
36
37
# File 'lib/search_validator_review.rb', line 35

def sr
  @sr
end

Instance Method Details

#can_docs_queryObject



41
42
43
# File 'lib/search_validator_review.rb', line 41

def can_docs_query
  $db["SELECT s.id as s_id, r.id as r_id, cd.id, cd.author, cd.title, cd.abstract, cd.year FROM searches s INNER JOIN records_searches rs ON s.id=rs.search_id INNER JOIN records r ON rs.record_id=r.id LEFT JOIN canonical_documents cd ON r.canonical_document_id=cd.id WHERE s.systematic_review_id=?", @sr.id]
end