An Ember Ecosystem
For Spree Commerce

spree-ember-core

The Spree Store is what connects the Spree Serializer & Adapter. It's injected in the spree service, so that we can effectively isolate Spree Ember's data from the Host Application's regular Store, Adapter & Serializer. This is useful for Rails Applications that have Spree added, but have regular endpoints that don't hit the Spree endpoint.

Methods

Show Private Methods

adapterFor

Always returns the Spree Adapter.


Returns:

SpreeEmber.Adapter:

The Spree Ember Adapater.

findBySlug

(
  • type
  • slug
)

Find a model by it's slug attribute.

// Products Show Route
import Ember from 'ember';

export default Ember.Route.extend({
  model: function(params) {
    return this.spree.store.findBySlug('product', params.slug);
  }
});

Parameters:

  • type String

    A model type

  • slug String

    The model's slug


Returns:

SpreeEmber.Adapter:

The Spree Ember Adapater.

serializerFor

Attempts to find a registered serializer for the type, but in the case it doesn't find one, it will return the default Spree serializer.


Returns:

Serializer:

A serializer.

Properties

Show Private Properties

adapter

String

The container lookup name for the Spree adapter.


Default: '-spree'

defaultSerializer

String

The container lookup name for the default Spree serializer.


Default: '-spree'