# Getting joined data for widget scope

**URL:** <https://meta.discourse.org/t/getting-joined-data-for-widget-scope/42264>\
**Category:** Development\
**Created:** [Avril 8, 2016, 10:00 UTC](https://meta.discourse.org/t/getting-joined-data-for-widget-scope/42264 "2016-04-08T22:00:01Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![Overgrow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/overgrow/32/478189_2.png) [@Overgrow](https://meta.discourse.org/u/Overgrow)\
**Post date:** [Juillet 25, 2016, 4:44 UTC](https://meta.discourse.org/t/getting-joined-data-for-widget-scope/42264/16 "2016-07-25T16:44:23Z")

</div>

Thanks for confirming my direction… 🙂

I had to re-check everything and found a bug on my part.. This code works for me.. Example is getting `last_seen_at` from `user` object. Would be fine for highlighting online users..

Thanks for this great project!

**post\_serializer.rb**

> ```
> attributes :post_number,
> :user_last_seen_at,
>              
> def user_last_seen_at
> object.try(:user).try(:last_seen_at)
> end
> 
> ```

**transform-post.js.es6**

> ```
> export function transformBasicPost(post) {
> ...
> const postAtts = {
> ... 
> user_last_seen_at: post.user_last_seen_at,
> 
> ```

---

_[View the full topic](https://meta.discourse.org/t/getting-joined-data-for-widget-scope/42264)._
