all files / addon/actions/ model.js

100% Statements 4/4
100% Branches 0/0
100% Functions 2/2
100% Lines 4/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17                         
import Action from 'ember-custom-actions/actions/action';
import deepMerge from 'lodash/merge';
 
export default function(path, options = {}) {
  return function(payload = {}, actionOptions = {}) {
    actionOptions.data = payload;
 
    return Action.create({
      id: path,
      model: this,
      instance: true,
      options: deepMerge({}, options, actionOptions)
    }).callAction();
  };
}