Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

Database column defaults are not replacing empty string or nil values #517

@whysthatso

Description

@whysthatso

When invoking ObjectRepository.new.create, a new Object is indeed persisted with the default values as defined in the migration.

When invoking `ObjectRepository.new.create( Object.new( attribute1: '', attribute2:'foobar', attribute3:nil )
an Object with all these attributes set is persisted, but neither empty string nor nil is set to the default value.

Possibly unimportant context:
The attribute values are received from a form object that is handled inside an interactor.
The model is part of an has_one association: ThisObject.has_one OtherObject.

Any more info needed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions