insertAction = (data, options) => {
        // CASE: model does not support action for target event
        if (!data) {
            return;
        }

        const insert = (action) => {
            Bookshelf.model('Action')
                .add(action, {autoRefresh: false})
                .catch((err) => {
                    if (_.isArray(err)) {
                        err = err[0];
                    }

                    logging.error(new errors.InternalServerError({
                        err
                    }));
                });
        };

        if (options.transacting) {
            options.transacting.once('committed', (committed) => {
                if (!committed) {
                    return;
                }

                insert(data);
            });
        } else {
            insert(data);
        }
    }
Insert an action into the database

@param {Object} data - The data to insert
@param {Object} options - The options object