Sha256: c26dc31a7037779acbd02be8e024eb2fc18faa907906cdac86412e338e68ce5f
Contents?: true
Size: 1.21 KB
Versions: 11
Compression:
Stored size: 1.21 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 %> <% if localized? -%> translates <%= localized_attributes.map { |a| ":#{a.name}" }.join(', ') %> <% 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 -%> # To enable admin searching, add acts_as_indexed on searchable fields, for example: # # acts_as_indexed :fields => [:title] end end end
Version data entries
11 entries across 11 versions & 1 rubygems