Sha256: 40b2a4d3332a6f42e330412e73696d3b65797ce40e3c81c7b8c074c46a9c295c

Contents?: true

Size: 647 Bytes

Versions: 2

Compression:

Stored size: 647 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

2 entries across 2 versions & 1 rubygems

Version Path
lanes-0.1.9 templates/client/models/Model.coffee
lanes-0.1.8 templates/client/models/Model.coffee