Sha256: 2a091e3db15d476761a57d011696a5d33b16fc34f84f8382029aab7c171ff4b0

Contents?: true

Size: 513 Bytes

Versions: 3

Compression:

Stored size: 513 Bytes

Contents

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
datamapper4rails-0.5.2 generators/datamapper_model/templates/model.rb
datamapper4rails-0.5.1 generators/datamapper_model/templates/model.rb
datamapper4rails-0.5.0 generators/datamapper_model/templates/model.rb