Method: Timeful::RelationProxy#find_each

Defined in:
lib/timeful/relation_proxy.rb

#find_each(*args) {|item| ... } ⇒ Object

If find_each is defined on the object we’re delegating to (i.e. the object is an instance of ActiveRecord::Relation), calls it on the object.

Otherwise, calls each on the object and yields the values.

Yield Parameters:

  • item (Object)

    the items in the object



16
17
18
19
20
21
22
23
24
# File 'lib/timeful/relation_proxy.rb', line 16

def find_each(*args, &block)
  method = if __getobj__.respond_to?(:find_each)
    :find_each
  else
    :each
  end

  __getobj__.send(method, *args, &block)
end