You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What would you like to be able to do? Can you provide some examples?
I use the money-rails gem which basically has me store values in terms of cents. For instance, if I wanted to represent a price of $10.00, I could create a column called price_cents and write 1000 to it. Monetize is great because when you call .price, you get back the price in dollars (in this case, 10).
When I'm using a monetize column in Administrate, I add in the virtual property called price. Everything works great, but unfortunately, the order mechanic doesn't work. Based on a quick read of the code, it seems like it expects the column to actually exist.
ATTRIBUTE_TYPES = {
price: Field::Number
}
I could switch to just displaying price_cents in the Administrate dashboard, but then I have to manually format everything into dollars and add translations to change the table header names. Seems unideal.
I use the money-rails gem which basically has me store values in terms of cents. For instance, if I wanted to represent a price of $10.00, I could create a column called
price_cents
and write1000
to it. Monetize is great because when you call.price
, you get back the price in dollars (in this case, 10).When I'm using a monetize column in Administrate, I add in the virtual property called
price
. Everything works great, but unfortunately, the order mechanic doesn't work. Based on a quick read of the code, it seems like it expects the column to actually exist.I could switch to just displaying
price_cents
in the Administrate dashboard, but then I have to manually format everything into dollars and add translations to change the table header names. Seems unideal.Does anyone else have this problem? Any workarounds?
One solution I thought of would be to introduce an :order_by property where I could pass it a different column to sort by. Maybe something like this:
Is there an easier way to achieve what I want?
The text was updated successfully, but these errors were encountered: