Socket
Socket
Sign inDemoInstall

ember-data-slug

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-data-slug

slug support for store.findRecord


Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

ember-data-slug Build Status

Slug support for store.findRecord.

If your API supports to reference a model via slug additionally to the id, then this addon allows you to use findRecord with both the slug or id:

// GET /videos/best-dance-ever
let findViaSlug = store.findRecord("video", "best-dance-ever");

// GET /videos/1
let findViaId = store.findRecord("video", "1");

// both requests return the same response
// {
//   id: "1",
//   slug: "best-dancing-ever",
//   url: "https://www.youtube.com/watch?v=1TphEh0Qgv0"
// }

This addon ensures that the same records are referenced within Ember Data:

Ember.RSVP.all([ findViaSlug, findViaId ]).then(function([ foundViaSlug, foundViaId ]) {
  // true
  foundViaSlug === foundViaId;
});

Install via:

ember install ember-data-slug

Development

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://ember-cli.com/.

Keywords

FAQs

Package last updated on 03 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc