Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

DocumentReferences testing can fail if field is boolean #94

Open
eutheria opened this Issue · 0 comments

1 participant

eutheria
eutheria

When using DocumentReferences the generated view tests for a boolean field to determine the document type

for example:

@TypeDiscriminator
private Boolean moduleEnabled;
private String moduleParent;

@DocumentReferences(fetch = FetchType.LAZY, descendingSortOrder = true, orderBy = "_id", backReference = "moduleParent")
    private Set modules;

with


@GenerateView
    public List findByModuleParent(String moduleParent) {
        return queryView("by_moduleParent", moduleParent);
    }


this generated:

function(doc) { if(doc.moduleEnabled && doc.moduleParent) { emit([doc.moduleParent, 'modules', doc._id], null); } }

this test fails with doc.moduleEnabled set to false, I believe it would be a good idea if a custom document validator could be set?

Thanks for such a good library!

Francis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.