Rails - How to get virtual attributes too when using find -
i want include virtual variables when trying find object. e.g if status virtual attribute in rails model object.find(1) should homecoming object status.
the whole thought behind virtual attributes not stored in database. there many utilize cases want temporary attribute (injecting dependencies etc.)
if need have attribute populated when fetching .find
or other database retrieval method need create regular attribute , store it.
ruby-on-rails
No comments:
Post a Comment