Sha256: 5ced050b134e4c65e8339c92a78ec57e4da6603f0e514e0c4db8dfba77296095

Contents?: true

Size: 477 Bytes

Versions: 10

Compression:

Stored size: 477 Bytes

Contents

// for more details see: http://emberjs.com/guides/models/defining-models/

import DS from 'ember-data';

export default DS.Model.extend({
<% attributes.each_with_index do |attribute, idx| -%>
  <%= attribute[:name].camelize(:lower) %>: <%=
  if %w(references belongs_to).member?(attribute[:type])
    "DS.belongsTo('%s')" % attribute[:name].camelize(:lower)
  else
    "DS.attr('%s')" % attribute[:type]
  end
  %><% if (idx < attributes.length-1) %>,<% end %>
<% end -%>
});

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
emberjs-rails-0.1.1 lib/generators/templates/model.module.es6
emberjs-rails-0.1.0 lib/generators/templates/model.module.es6
ember-rails-0.21.0 lib/generators/templates/model.module.es6
ember-rails-0.20.6 lib/generators/templates/model.module.es6
ember-rails-0.20.5 lib/generators/templates/model.module.es6
ember-rails-0.20.4 lib/generators/templates/model.module.es6
ember-rails-0.20.3 lib/generators/templates/model.module.es6
ember-rails-0.20.2 lib/generators/templates/model.module.es6
ember-rails-0.20.1 lib/generators/templates/model.module.es6
ember-rails-0.20.0 lib/generators/templates/model.module.es6