Sha256: 7ee9c82add51b77111716f6022bdf0d2b6c5535608691ec79279975f508b5340
Contents?: true
Size: 831 Bytes
Versions: 83
Compression:
Stored size: 831 Bytes
Contents
<% 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 -%> <% attributes.select(&:rich_text?).each do |attribute| -%> has_rich_text :<%= attribute.name %> <% end -%> <% attributes.select(&:attachment?).each do |attribute| -%> has_one_attached :<%= attribute.name %> <% end -%> <% attributes.select(&:attachments?).each do |attribute| -%> has_many_attached :<%= attribute.name %> <% end -%> <% attributes.select(&:token?).each do |attribute| -%> has_secure_token<% if attribute.name != "token" %> :<%= attribute.name %><% end %> <% end -%> <% if attributes.any?(&:password_digest?) -%> has_secure_password <% end -%> end <% end -%>
Version data entries
83 entries across 80 versions & 8 rubygems