Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Raising exception when saving instead of returning true #75

Open
agborrego92 opened this issue Oct 5, 2017 · 0 comments
Open

Raising exception when saving instead of returning true #75

agborrego92 opened this issue Oct 5, 2017 · 0 comments

Comments

@agborrego92
Copy link

agborrego92 commented Oct 5, 2017

When I try, by testing, to persist a model to a in-memory sqlite database with a duplicated primary key, it raises a DataObjects::IntegrityError, and the docs says "...datamapper returns true or false for all operations manipulating the persisted state of a resource (#create, #save, #update and #destroy). If you want it to raise exceptions instead, you can instruct datamapper to..."

I checked in my model:
DataMapper::Model.raise_on_save_failure # false
Zoo.raise_on_save_failure # false
zoo.raise_on_save_failure # false

So, how can I get the expected default behaviour?

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

No branches or pull requests

1 participant