offirgolan / ember-data-copyable

Intelligently copy an Ember Data model and all of its relationships

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Removing mixins for Ember Octane

vishwasraj-thyagaraj opened this issue · comments

Is there any plans to port the addon to octane ?

I think the best way to move this addon forward into an octane world would be to move to simply export a function. There are some pieces missing, like:

To copy a model's relationship, that relational model must have the Copyable mixin or else it will just be copied by reference.

If we use a function, we can't "mark" a model as copyable. I was thinking a good api would be:

@hasMany('comment', { async: true, copy: true })
comments;

or even

@hasMany('comment', { async: true, copy: 'deep' })
comments;

@belongsTo('comment', { async: true, copy: 'reference' })
author;

I think this might even be a superior api because we might want to copy a model in some relationships and not on others.

Alternatively we could somehow pass in this information to the function itself.