Sha256: f430f99eed79690bcd8b789e79836f47c5cda1550f97c879a0395fcdeaff6979
Contents?: true
Size: 587 Bytes
Versions: 13
Compression:
Stored size: 587 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? %><%= ', required: true' if attribute.required? %> <% end -%> scope :active, -> { where(archived_at: nil) } <% 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
13 entries across 13 versions & 1 rubygems