generators/datamapper_model/templates/model.rb in datamapper4rails-0.4.0 vs generators/datamapper_model/templates/model.rb in datamapper4rails-0.5.0
- old
+ new
@@ -2,10 +2,10 @@
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 %>
+ 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 -%>