Sha256: 6d6a954de0cb50c64ee5d368cd2462439d2f4ac821f2834d4e55d7c6693bde12

Contents?: true

Size: 515 Bytes

Versions: 4

Compression:

Stored size: 515 Bytes

Contents

class <%= class_name %>
  include DataMapper::Resource

  property :id, Serial

<% Array(attributes).each do |attribute| -%>
  property :<%= attribute.name %>, <%= attribute.type.to_s.capitalize %>, :nullable => false <% 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

4 entries across 4 versions & 1 rubygems

Version Path
datamapper4rails-0.4.0 generators/datamapper_model/templates/model.rb
datamapper4rails-0.3.2 generators/datamapper_model/templates/model.rb
datamapper4rails-0.3.1 generators/datamapper_model/templates/model.rb
datamapper4rails-0.3.0 generators/datamapper_model/templates/model.rb