Closed jemminger closed 6 years ago
Ah, thinking about it more I guess it's not possible, since you're retrieving straight from PG which would have no knowledge of the model's methods.
Correct. There's no way to do that without some serious hackery.
Is it possible to include methods as well as columns/associations?
For example with
as_json
, you can include methods from the model:my_object.as_json(methods: [:this_method, :that_method])
and get back