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

[MECHDB] Calling ActiveRecord.save() throws error if no value was changed #137

Open
imhoff opened this issue May 1, 2013 · 3 comments
Open

Comments

@imhoff
Copy link

imhoff commented May 1, 2013

When creating an ActiveRecord and calling the save() method without touching its values will throw an IllegalArgumentsException: Empty Values. It is not checked whether the constructed ContentValues Object contains any values.

@fluxtah
Copy link
Contributor

fluxtah commented May 3, 2013

Hi, I am not sure what to do about this one because it sounds like a good thing rather than a bad thing.

Any idea what you would expect to happen? We could possibly catch the exception and raise a more specific one.

@imhoff
Copy link
Author

imhoff commented May 3, 2013

I was just a little surprised that the Exception was thrown. Given the name and the behavior of the ActiveRecords, I assumed that it would do just nothing if there is nothing to be saved. As the class already tracks which portions have changed (dirty flag) it seems strange that there is an error at all.
But its just my point of view.

@fluxtah
Copy link
Contributor

fluxtah commented May 3, 2013

Cheers, you are not wrong, we should probably just make it fail silently in this scenario, I will look into it.

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

No branches or pull requests

2 participants