strapi/lib/configuration/hooks/waterline/helpers/isOneWayAssociation.js
2015-10-01 00:30:16 +02:00

24 lines
579 B
JavaScript

'use strict';
/**
* Module dependencies
*/
// Locale helpers.
const isOneToManyAssociation = require('./isOneToManyAssociation');
const isOneToOneAssociation = require('./isOneToOneAssociation');
/**
* Helper which returns a boolean. True if the type
* of the relation is `oneToOne`.
*
* @param {Object} currentModel
* @param {Object} association
*
* @return {boolean}
*/
module.exports = function isOneWayAssociation(currentModel, association) {
return !(isOneToManyAssociation(currentModel, association) || isOneToOneAssociation(currentModel, association));
};