Module: ElasticRecord::Relation::FinderMethods

Included in:
ElasticRecord::Relation
Defined in:
lib/elastic_record/relation/finder_methods.rb

Instance Method Summary collapse

Instance Method Details

#allObject



16
17
18
# File 'lib/elastic_record/relation/finder_methods.rb', line 16

def all
  to_a
end

#find(id) ⇒ Object



4
5
6
# File 'lib/elastic_record/relation/finder_methods.rb', line 4

def find(id)
  filter(arelastic.filter.ids(id)).to_a.first
end

#firstObject



8
9
10
# File 'lib/elastic_record/relation/finder_methods.rb', line 8

def first
  find_one order('_uid')
end

#lastObject



12
13
14
# File 'lib/elastic_record/relation/finder_methods.rb', line 12

def last
  find_one order('color' => 'reverse')
end