Sha256: 5ae0dd326da35f39d5a327b8b90206806e4c104559acb98602b3f86dd5f7f0b6

Contents?: true

Size: 395 Bytes

Versions: 1

Compression:

Stored size: 395 Bytes

Contents

class <%= class_name %> < ActiveRecord::Base
  acts_as_humpyard_element
  
  <% if attributes.size > 0 -%>
attr_accessible <%= attributes.map{|attribute| attribute.reference? ? ":#{attribute.name}, :#{attribute.name}_id" : ":#{attribute.name}"} * ', ' %>
  <% end -%> 
  <% attributes.select {|attr| attr.reference? }.each do |attribute| -%>
belongs_to :<%= attribute.name %>
  <% end -%>
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
humpyard-0.0.1 lib/generators/humpyard/element/templates/model.rb