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
Specifically, I'd like to easily be able to send all id values to the client as strings without having to call to_s on every id attribute and without changing the Rails default of making ids integers.
So, instead of
attribute :contract_id do |obj|
obj.contract_id.to_s
end
Something like
attribute :contract_id, type: :string
or
attribute :contract_id, coerce: :string
The text was updated successfully, but these errors were encountered:
weilandia
changed the title
Thoughts on add a value transform option or a 'type' option to Attribute?
Thoughts on adding a value transform option or a 'type' option to Attribute?
Mar 24, 2020
Specifically, I'd like to easily be able to send all id values to the client as strings without having to call
to_s
on every id attribute and without changing the Rails default of making ids integers.So, instead of
Something like
or
The text was updated successfully, but these errors were encountered: