Sha256: ad18697c431bfcfea55334b064f425963f54c449661bff859bf78f88e534b365
Contents?: true
Size: 546 Bytes
Versions: 14
Compression:
Stored size: 546 Bytes
Contents
class <%= class_name %> < <%= parent_class_name.classify %> <% attributes.select {|attr| attr.reference? }.each do |attribute| -%> belongs_to :<%= attribute.name %> <% end -%> <% attributes.select {|attr| [:has_one, :has_many].include?(attr.type) }.each do |attribute| -%> <%= attribute.type %> :<%= attribute.name %> <% end -%> <% if options[:modified_by] -%> belongs_to :modified_by, :class_name => "<%= options[:user_model] %>" <% end -%> <% if options[:singleton] -%> def self.instance self.first || self.new end <% end -%> end
Version data entries
14 entries across 14 versions & 2 rubygems