Module: Hoardable::FinderMethods

Defined in:
lib/hoardable/finder_methods.rb

Overview

A module for overriding ActiveRecord#find_one and ActiveRecord#find_some in the case you are doing a temporal query and the current SourceModel record may in fact be a VersionModel record. This is extended into the current scope with #at but can also be opt-ed into with the class method hoardable.

Instance Method Summary collapse

Instance Method Details

#find_one(id) ⇒ Object



9
10
11
# File 'lib/hoardable/finder_methods.rb', line 9

def find_one(id)
  super(hoardable_ids([id])[0])
end

#find_some(ids) ⇒ Object



13
14
15
# File 'lib/hoardable/finder_methods.rb', line 13

def find_some(ids)
  super(hoardable_ids(ids))
end