Sha256: a2cc32030c0408bda4ebf4124f84433cddad34a43559749b1322303ae272d642
Contents?: true
Size: 946 Bytes
Versions: 7
Compression:
Stored size: 946 Bytes
Contents
class <%= class_name %> include DataMapper::Resource property :id, Serial <% Array(attributes).each do |attribute| -%> property :<%= attribute.name %>, <%= attribute.type == :boolean ? "::DataMapper::Types::Boolean" : 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 -%> <% unless options[:skip_modified_by] -%> modified_by Ixtlan::Models::USER require 'dm-serializer' alias :to_x :to_xml_document def to_xml_document(opts = {}, doc = nil) unless(opts[:methods]) opts.merge!({:methods => [:updated_by], :updated_by => {:methods => [], :exclude => [:created_at, :updated_at]}}) end to_x(opts, doc) end <% end -%> end
Version data entries
7 entries across 7 versions & 1 rubygems