Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 9bec2d5993
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 15 lines (10 sloc) 0.513 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14
class <%= class_name %>
include DataMapper::Resource

property :id, Serial

<% Array(attributes).each do |attribute| -%>
property :<%= attribute.name %>, <%= attribute.type.to_s.capitalize %>, :required => true<% if attribute.type == :string or attribute.type == :text or attribute.type == :slug -%>, :format => /^[^<'&">]*$/<% if attribute.type == :string or attribute.type == :slug %>, :length => 255<% end -%><% end %>

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

end
Something went wrong with that request. Please try again.