On Rails I can render some json with extra method like this:
render json: {
user: user
}, methods: :photo_url
It work's fine! But, I need put more objects in this json that don't has the photo_url method.
render json: {
brand: brand,
user: user
}, methods: :photo_url
I got this error:
undefined method 'photo_url' for brand
So, How can I insert this method only to user object?
Thanks!