Is there an easy way to return activerecord models with associations like JSON using the Grape microframe?
get 'users' do
User.includes(:address)
end
This fragment does not work, but User.includes(:address).to_json(include: :address)will be encoded twice as JSON. (Using the method to_jsonalone does not feel anyway)
source
share