Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
dynamic DS.attr's #474
Is it possible to somehow reopen a DS.Model and dynamically add more DS.attr's ?
Apparently you can do this like this
But say i have a Machine model and i want my users to be able to create a machine but to also be able to add additional fields to describe that machine. So these are different from other users.
Is this possible per instance ?
I then will store into mongodb so each document can have a different schema.
Has anyone any ideas how do so this or if this can / will be added as a future feature ?
thanks a lot
There is now limited support for polymorphic records, but your server would need to support them. Other than that some people have custom mixins that do something similar. For now we are focused on improving stability. If you wanted to do something like this now, the easiest way might to have a tagging like system where you would put additional properties/tags into a hasMany on the model.