backbone-forms icon indicating copy to clipboard operation
backbone-forms copied to clipboard

Allow a NestedModel's model attribute to be specified as a string or an object

Open astjohn opened this issue 13 years ago • 4 comments
trafficstars

I struggled for a while trying to get NestedModels to work properly. The reason it wasn't working was because my parent model was declared before the nested one. This problem originated from the name of my source files and the fact that I'm using Rails' asset pipeline.

This change allows a model to be specified as a string so that model class declaration order is not important. It should be backwards compatible.

Unfortunately, I have not included tests.

astjohn avatar Aug 16 '12 19:08 astjohn

If you can add a test I'll merge this in

powmedia avatar Oct 12 '12 12:10 powmedia

I'm pretty swamped at the moment, but I'll see what I can do.

astjohn avatar Oct 12 '12 13:10 astjohn

Please add in NestedModel example that order of nested models declarations have to be above main model declaration. It took me bunch of time to figure out it.

daogurtsov avatar Oct 27 '12 13:10 daogurtsov

Are we still interested in merging this in (if it isn't too stale)? If so, I'll add a test so we can get it done.

reustle avatar Feb 14 '14 23:02 reustle