Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 'array' attribute type to DS.Model #137

Closed
wants to merge 1 commit into from

Conversation

pangratz
Copy link
Member

@pangratz pangratz commented Mar 5, 2012

Inspired by question of @cloke in IRC at 2012-03-05 "18:16 cloke_ with data is there a way to have one of the attributes be an array? The data from the server is just a flat array so an association seems overly complex."


highestLuckyNumber: function() {
return Math.max.apply(Math, this.get('luckyNumbers'));
}.property('luckyNumbers.@each')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this is the best example for an array property ...

@wycats
Copy link
Member

wycats commented Mar 5, 2012

Dup of #53

@wycats wycats closed this Mar 5, 2012
@wycats
Copy link
Member

wycats commented Mar 5, 2012

The problem with this implementation is that we have no mechanism for marking a record as dirty when the contents of its array changes. We think this will be very confusing to people and would introduce subtle bugs into applications using Ember Data. We're planning on tackling this problem (which is basically the same as #53) using some kind of object proxy system to notify us when changes have been made.

@cloke
Copy link

cloke commented Mar 6, 2012

This worked great for my needs. App.myController.set('tags', [1,2,3,4,5]), App.store.commit() and all my changes pushed to the server.

@pangratz
Copy link
Member Author

pangratz commented Mar 6, 2012

okidoki

@pangratz pangratz mentioned this pull request May 30, 2012
@pangratz pangratz deleted the add_array_attr branch January 5, 2016 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants