Sha256: cf140bae176961e84c5b281bf7e3d8d97042930f8960c3955856648daadd413d
Contents?: true
Size: 1.23 KB
Versions: 6
Compression:
Stored size: 1.23 KB
Contents
module Refinery module <%= namespacing %> class <%= class_name %> < Refinery::Core::BaseModel <% if table_name == namespacing.underscore.pluralize -%> self.table_name = 'refinery_<%= plural_name %>' <% end %> attr_accessible <%= names_for_attr_accessible.map { |n| ":#{n}" }.join(', ') %>, :position <% if localized? -%> translates <%= localized_attributes.map { |a| ":#{a.name}" }.join(', ') %> class Translation attr_accessible :locale end <% end -%> <% if string_attributes.any? -%> validates <%= string_attributes.first.name.to_sym.inspect %>, :presence => true, :uniqueness => true <% else -%> # def title was created automatically because you didn't specify a string field # when you ran the refinery:engine generator. <3 <3 Refinery CMS. def title "Override def title in vendor/extensions/<%= namespacing.underscore %>/app/models/refinery/<%= namespacing.underscore %>/<%= singular_name %>.rb" end <% end -%> <% image_attributes.each do |a| -%> belongs_to :<%= a.name -%>, :class_name => '::Refinery::Image' <% end -%> <% resource_attributes.each do |a| -%> belongs_to :<%= a.name %>, :class_name => '::Refinery::Resource' <% end -%> end end end
Version data entries
6 entries across 6 versions & 1 rubygems