Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select includes non-selected fields #71

Open
jochakovsky opened this issue Aug 5, 2016 · 1 comment
Open

select includes non-selected fields #71

jochakovsky opened this issue Aug 5, 2016 · 1 comment

Comments

@jochakovsky
Copy link
Contributor

From the readme:

ActiveZuora::Account.select(:id, :name).where(:created_date => { "<" => Date.yesterday })

The resulting ActiveZuora::Account instances will include fields for all other possible ActiveZuora::Account, with a value of nil. This is unlike ActiveRecord, which omits any fields that are not specified in the select. These extra fields make it so that additional manipulation of the objects is necessary for some use cases, for example rendering to JSON.

Is this expected behavior, or is it a potential area for improvement?

@anfleene
Copy link
Contributor

anfleene commented Aug 8, 2016

Definitely a potential area for improvement. Feel free to take a stab at it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants