hhff / spree-ember

:moneybag: An Ember Ecosystem for Spree Commerce.
http://spree-ember.com
MIT License
77 stars 18 forks source link

[core] Make Models Extendable by moving to /addon #67

Open hhff opened 9 years ago

cellis commented 8 years ago

Because of this issue, I think i'm unable to move forward with spree-ember. It's going to be really difficult to use without being able to patch the user.js. I tried using an initializer, but i'm unable to import it because it's not in /addon. Will fork for now.

cellis commented 8 years ago

actually, upon further inspection, I was able to extend the models by doing the following:

# app/initializers/override-user.coffee
`import User from '../models/user'`
`import DS from 'ember-data'`

UserOverride =
  name: 'user-override'
  before: 'session'
  initialize: (registry, application)->
    User.reopen
      provider: DS.attr()

`export default UserOverride`
hhff commented 8 years ago

Thanks @cellis - I'm in the (sloooow) process of porting Spree Ember over to Solidus - so most new development will eventually happen there. That said - if you do the work in a fork, I'd totally merge it in & release a new version.

Your approach will totally work, however!