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

Raising exception when saving instead of returning true #75

Description

@agborrego92

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?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions