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

Is there a way to assign multiple attributes after object been initialized? #451

Open
wayne5540 opened this issue Jan 5, 2019 · 2 comments

Comments

@wayne5540
Copy link
Contributor

wayne5540 commented Jan 5, 2019

Hi, is there a way to assign multiple attributes into model after initialized? For example:

incoive = Quickbooks::Model::Invoice.new
invoice.assign_attributes(attributes)

In this way, we don't need to manually assign attribute by using setter respectively.

I think it's useful and nice to have, in ActiveModel there is a module called AttributeAssignment, maybe we can consider adding it into BaseModel since we already have ActiveModel dependency?

@ruckus
Copy link
Owner

ruckus commented Jan 8, 2019

I can see how this could be useful. Want to create a PR?

@wayne5540
Copy link
Contributor Author

My pleasure, PR: #453

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