Skip to content

Instantly share code, notes, and snippets.

@gotar
Last active December 15, 2015 13:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gotar/79eb023c71846562ee68 to your computer and use it in GitHub Desktop.
Save gotar/79eb023c71846562ee68 to your computer and use it in GitHub Desktop.
chat: {
id: 1,
owner_id: 1,
member_id: 2
}
user1: {
id: 1
name: 'Foo'
}
user2: {
id: 2,
name: 'Bar'
}
ChatMapper do
combine :users, on: [:owner_id, :member_id] => :id do
model User
end
end
chat.users => [user1, user2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment