Created
July 11, 2013 19:33
-
-
Save ZackMattor/5978509 to your computer and use it in GitHub Desktop.
Doesn't seem to want to load embeded data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ComponentSerializer < ActiveModel::Serializer | |
| embed :ids | |
| attributes :id, | |
| :back_image, | |
| :cols, | |
| :front_image, | |
| :name, | |
| :rows | |
| has_many :parts, include: true | |
| has_many :element_lights, embed: :objects, include: true | |
| def front_image | |
| "#{object.front_image}" | |
| end | |
| def back_image | |
| "#{object.back_image}" | |
| end | |
| def type | |
| object.class.name | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ServerDemo.Component = ServerDemo.Partable.extend | |
| element_lights: DS.hasMany 'ServerDemo.ElementLight', {embeded: 'always'} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DS.RESTAdapter.map('ServerDemo.Component',{ | |
| element_light: { | |
| embedded:'always' | |
| } | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment