Module: Ohm::Boundaries::ClassMethods

Defined in:
lib/ohm/contrib/boundaries.rb

Instance Method Summary collapse

Instance Method Details

#first(opts = {}) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/ohm/contrib/boundaries.rb', line 23

def first(opts = {})
  if opts.any?
    find(opts).first
  else
    all.first(opts)
  end
end

#last(opts = {}) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/ohm/contrib/boundaries.rb', line 31

def last(opts = {})
  if opts.any?
    find(opts).first(:order => "DESC")
  else
    all.first(:order => "DESC")
  end
end