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
{{ message }}
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.
Datamapper allows to restrict the fields to fetch from database via the :fields option, for example :
However, when serializing such a "restricted" collection, all the fields are serialized, causing new SQL queries to be sent to the database backend.
I find this counter-intuitive :-)
As a quick test, I tried to replace a line in lib/dm-serializer/common.rb :
... and it seems to work for me, both with projected fields and without.
But I'm not sure every DataMapper::Collection has a query.
Would you consider the original behaviour (serialize all model fields) to be expected, or a bug?
The text was updated successfully, but these errors were encountered: