Class: Queries::ContainerAutocompleteQuery

Inherits:
Query
  • Object
show all
Includes:
Arel::Nodes
Defined in:
lib/queries/container_autocomplete_query.rb

Instance Attribute Summary

Attributes inherited from Query

#dynamic_limit, #project_id, #query_string, #terms

Instance Method Summary (collapse)

Methods inherited from Query

#build_terms, #end_wildcard, #identifier_table, #initialize, #integers, #named, #no_digits, #parent, #parent_child_join, #parent_child_where, #scope, #start_and_end_wildcard, #start_wildcard, #strings, #wildcard_wrapped_integers, #with_id, #with_identifier_like, #with_project_id, #years

Constructor Details

This class inherits a constructor from Queries::Query

Instance Method Details

- (Object) result



11
12
13
# File 'lib/queries/container_autocomplete_query.rb', line 11

def result 
  Container.includes(:identifiers).where(where_sql).references(:identifiers)
end

- (Object) table



15
16
17
# File 'lib/queries/container_autocomplete_query.rb', line 15

def table
  Container.arel_table
end

- (Object) where_sql



7
8
9
# File 'lib/queries/container_autocomplete_query.rb', line 7

def where_sql
  with_project_id.and(with_id.or(with_identifier_like))
end