jbrunton / frappuccino-core

2 stars 3 forks source link

sensibly initialize loading properties #2

Closed jbrunton closed 12 years ago

jbrunton commented 12 years ago

To avoid null exceptions, it's currently necessary to write code that looks like this:

blog = @create_model( "Blog", { blog_posts: [], user: { screen_name: null } } ).load id,
    includes:
        blog_posts: true
        user: true

It should be possible to infer sensible default values from the include params to avoid passing an initial data param to the create_model method.