This changes Response.data to always return an array, even in the case of a single record, and adjusts BaseRecord accordingly.
Also, I noticed similar chunks of code in BaseRecord.where and BaseRecord.all and renamed some of the variables to highlight the similarity. As with Response, there may be a reason for the differences that I'm unaware of, but otherwise it could be refactored in the future to reduce code duplication.
This changes
Response.data
to always return an array, even in the case of a single record, and adjustsBaseRecord
accordingly.Also, I noticed similar chunks of code in
BaseRecord.where
andBaseRecord.all
and renamed some of the variables to highlight the similarity. As withResponse
, there may be a reason for the differences that I'm unaware of, but otherwise it could be refactored in the future to reduce code duplication.