Sha256: fd58d9f6145ddd06a6ba6770f08b42ab67f7cb72451251ab75e454f71f03aec9
Contents?: true
Size: 725 Bytes
Versions: 20
Compression:
Stored size: 725 Bytes
Contents
class <%= class_name %> < ActiveRecord::Base <%= " set_table_name :#{table_name}\n" if table_name -%> attr_accessible <%= model_attributes.map { |a| ":#{a.name}" }.join(", ") %> <% model_attributes.each do |attribute| %> <%= "#validates_presence_of :#{attribute.name}" %> <% if attribute.type==:integer -%> <%="#validates_numericality_of :#{attribute.name}"%> <% end -%> <% if attribute.type==:string -%> <%= "#validates_length_of :#{attribute.name} ,:maximum=>255" %> <% end -%> <% end -%> #Schema Information <% model_attributes.each do |attribute| %> #<%= attribute.name %>:<%=attribute.type %> <% end %> #scopes #default_scope order('created_at DESC') end
Version data entries
20 entries across 20 versions & 1 rubygems