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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

astjohn
Copy link

@astjohn astjohn commented Aug 16, 2012

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.

This allows nested models to be specified as a string so that declaration of model classes are independent of order.
@powmedia
Copy link
Owner

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

@astjohn
Copy link
Author

astjohn commented Oct 12, 2012

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

@daogurtsov
Copy link

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.

@reustle
Copy link

reustle commented Feb 14, 2014

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.

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

Successfully merging this pull request may close these issues.

None yet

5 participants