Skip to content

Instantly share code, notes, and snippets.

class EventWithFriends < SimpleDelegator
def attending_friends_for_user(user)
super(user)
end
end
class EventsFeed
def events
@events.map { |event| EventWithFriends.new(event) }
end
class EventWithFriends
def initialize(object, attending_friends_by_user_id)
super(object)
@attending_friends_by_user_id = attending_friends_by_user_id
end
def attending_friends_for_user(user)
@attending_friends_by_user_id[user.id] || super(user)
end
end
@pieterjongsma
pieterjongsma / keybase.md
Created August 5, 2019 20:58
Keybase proof

Keybase proof

I hereby claim:

  • I am pieterjongsma on github.
  • I am pieterjongsma (https://keybase.io/pieterjongsma) on keybase.
  • I have a public key ASATlYW-Nj-NDSnyWnehBvqPZVavtL14yj0m1rPzMcOhrAo

To claim this, I am signing this object: