Sha256: 055139d218c3c0d4b4d5550a7397331340b5bfa927a6cc23b7e127f9aa652892
Contents?: true
Size: 630 Bytes
Versions: 5
Compression:
Stored size: 630 Bytes
Contents
# Model <%= class_name %> defines ... TODO: # <% module_namespacing do -%> class <%= class_name %> < <%= parent_class_name.classify %> <% attributes.select(&:reference?).each do |attribute| -%> belongs_to :<%= attribute.name %><%= ', polymorphic: true' if attribute.polymorphic? %> <% end -%> <% if attributes.any?(&:password_digest?) -%> has_secure_password <% end -%> <% if attribute = attributes.detect{|a| a.name == 'position'} || attributes.detect{|a| a.name == 'name'} || attributes.detect{|a| a.name == 'title'} || attributes.first -%> scope :ordered, -> { order(:<%=attribute.name %>) } <% end -%> end <% end -%>
Version data entries
5 entries across 5 versions & 1 rubygems