Skip to content

Instantly share code, notes, and snippets.

@bdarfler
Created May 23, 2018 17:05
Show Gist options
  • Save bdarfler/4eb43db85e6a0c92095fb907b6c29d25 to your computer and use it in GitHub Desktop.
Save bdarfler/4eb43db85e6a0c92095fb907b6c29d25 to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
def recent_activities(limit)
c_stream = comments.order_by(:created_at).to_enum :find_each
i_stream = items.comments.order_by(:created_at).to_enum :find_each
b_stream = bids.order_by(:created_at).to_enum :find_each
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment