Sha256: 0d09e4a68761df0e79cf146e3f2ce5d521f8d7edbbe3f70fbb948ba4f6892d2f

Contents?: true

Size: 646 Bytes

Versions: 12

Compression:

Stored size: 646 Bytes

Contents

class <%= namespace %>.Models.<%= class_name %> extends <%= namespace %>.Models.Base

    props:
<% fields.each do |field| -%>
<% if field.reference? -%>
        <%= sprintf("%-#{max_field_length}s",field.name+'_id') %>: "<%= field.client_type %>"
<% else -%>
        <%= sprintf("%-#{max_field_length}s",field.name) %>: "<%= field.client_type %>"
<% end -%>
<% end %>
<% if reference_fields.any? -%>

    associations:
<% reference_fields.each do |field| -%>
        <%= sprintf("%-#{max_field_length}s ",field.name) %>: { <%= field.belongs_to? ? 'model' : 'collection' -%>: "<%= namespace %>.<%= field.name.camelize %>" }
<% end -%>
<% end -%>

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
lanes-0.8.2 templates/client/models/Model.coffee
lanes-0.8.1 templates/client/models/Model.coffee
lanes-0.8.0 templates/client/models/Model.coffee
lanes-0.7.0 templates/client/models/Model.coffee
lanes-0.6.1 templates/client/models/Model.coffee
lanes-0.6.0 templates/client/models/Model.coffee
lanes-0.5.6 templates/client/models/Model.coffee
lanes-0.5.5 templates/client/models/Model.coffee
lanes-0.5.0 templates/client/models/Model.coffee
lanes-0.4.0 templates/client/models/Model.coffee
lanes-0.3.0 templates/client/models/Model.coffee
lanes-0.1.9.5 templates/client/models/Model.coffee