subscribe
✓ Published0🌍 Public
AA6Brgeuka
Last edited Jan 30, 2019
Created on Jan 30, 2019
This example demonstrates a simple social-follow interaction using Ember Data relationships. It shows a list of users, each with follower and following counts, alongside the current user’s own counts. The interface provides two actions per user: one to subscribe to that user, and another to make that user subscribe to the current user. The code defines `subscribe` as a join model with `belongsTo` relationships to `user` for both follower and following, using inverse relationships on the `user` model to track `followers` and `followings`. Actions guard against duplicate subscriptions by checking existing follow records before creating new ones via `store.createRecord`.
AI-generated description