Sha256: 788a45a83743827de19891992f1ff528aa54fd10b0ec47a9541e5ae5fb50dd1a

Contents?: true

Size: 549 Bytes

Versions: 1

Compression:

Stored size: 549 Bytes

Contents

class <%= class_name %>
  include DataMapper::Resource
  property :id, Serial

<% for attribute in attributes -%>
  property :<%= attribute.name %>, <%= attribute.type.to_s.camelize %>, :nullable => false <% if attribute.type == :string or attribute.type == :text -%>, :format => /^[^<'&">]*$/<% if attribute.type == :string %>, :length => 50<% end -%>
<% else -%>

<% end -%>
<% end -%>
<% unless options[:skip_timestamps] %>
  property :created_at, DateTime, :nullable => false
  property :updated_at, DateTime, :nullable => false

<% end -%>
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
datamapper4rail-0.1.0 generators/rspec_dm_model/templates/model.rb