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

Uniqueness Enforcement #15

@nhahn

Description

@nhahn

Hi,

I've been seeing an error when using the sails-memory adapter with models that don't explicitly specify

unique: false

It seems in the enforceUniqueness function in database.js, the call do attrDef.unique is returning a function that returns an empty array rather than a value in the case of not having the unique key explicitly specified in the model.

This causes this line of code

if(!attrDef.unique) continue;

to always evaluate to true, rather than skipping over those attributes that do not have the uniqueness key. It this an issue with the way I am defining my model? Or is it supposed to return a function when there is no key present?

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