Sha256: abc65f22c03f3b706403077f98ef656b1c4d4c23f896375b208a85fd357c7346

Contents?: true

Size: 544 Bytes

Versions: 1

Compression:

Stored size: 544 Bytes

Contents

class <%= class_name %>
  include DataMapper::Resource
<% if options[:add_constraints] -%>
  include DataMapper::Constraints
<% end -%>

  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 => 255<% end -%>
<% #else -%>

<% end -%>
<% end -%>
<% unless options[:skip_timestamps] %>
  timestamps :at

<% end -%>
end

Version data entries

1 entries across 1 versions & 1 rubygems

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