emberjs / guides

This repository is DEPRECATED!
https://github.com/ember-learn/guides-source
Other
283 stars 874 forks source link

More clear polymorphism example code #2297

Closed rickypowell closed 6 years ago

rickypowell commented 6 years ago

As I was reading through Models: Relationships Polymorphism section, I noticed that the app/models/payment-method-cc.js is missing the last4: DS.attr() declaration. The immediate following example, app/models/payment-method-paypal.js, there is the linkedEmail: DS.attr(). This is an error in the code example because last4 must be declared in order for this code example to actually work when run in an Ember project. This may have been an over site from the initial commit of this example.

For consistency sake and aid people getting started to Ember, I suggest we declare last4 for the code snippet. This way,this.get('last4') can return the expected value.

jenweber commented 6 years ago

Closed with #2298

Thanks!!!