I'm trying to do something like this:
cache "api/v1/cars_index/#{I18n.locale}/car/#{car.cache_key}" do
attributes :id, :brand, :model_name, :fuel, :km, :year, :price
node(:color) { |car| car.color.present? ? car.color : '' }
end
I'm trying to do something like this:
cache "api/v1/cars_index/#{I18n.locale}/car/#{car.cache_key}" do
attributes :id, :brand, :model_name, :fuel, :km, :year, :price
node(:color) { |car| car.color.present? ? car.color : '' }
end
For those people who finds this question through a search or google.
Niels started an issue on Github which can be found here.
A developer created a great solution for this which has been merged into rabl since v0.6.2.
© 2022 - 2024 — McMap. All rights reserved.