Created
May 23, 2018 17:05
-
-
Save bdarfler/70fe90d3267a0f1c7ff016208de72ca7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
def recent_activities(limit) | |
[comments, items.map(&:comments), bids]. | |
flatten. | |
sort_by(&:created_at). | |
first(limit) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment