Model extra attributes
In some case you may want to access a column which is not owned by the model itself. This can be provided by access attributes
hash on the model.
In this case, you should set the optional argument fetch_columns
to true
during the fetching:
In the example below, we want to display a the identification document type
and number
for each person:
The optional parameter fetch_columns is available in most of the methods where we fetch to one or multiple models.
fetch_columns
reduces slightly the performance of the ORM, and that's why it's set to false
by default.
This can be combined also with aggregate functions access, like counter:
Last updated