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
base: master
from

Conversation

Projects
None yet
3 participants
@pangratz
Member

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')

This comment has been minimized.

@pangratz

pangratz Mar 5, 2012

Member

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

@pangratz

pangratz Mar 5, 2012

Member

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

@wycats

This comment has been minimized.

Show comment
Hide comment
@wycats

wycats Mar 5, 2012

Member

Dup of #53

Member

wycats commented Mar 5, 2012

Dup of #53

@wycats wycats closed this Mar 5, 2012

@wycats

This comment has been minimized.

Show comment
Hide comment
@wycats

wycats Mar 5, 2012

Member

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.

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

This comment has been minimized.

Show comment
Hide comment
@cloke

cloke 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.

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

This comment has been minimized.

Show comment
Hide comment
@pangratz

pangratz Mar 6, 2012

Member

okidoki

Member

pangratz commented Mar 6, 2012

okidoki

@pangratz pangratz referenced this pull request May 30, 2012

Closed

Add array transform #260

@pangratz pangratz deleted the pangratz:add_array_attr branch Jan 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment