Sha256: 704032d6c9112d4a712fd48daf55b8cad0540b296f03aebdf767ebff22f59637

Contents?: true

Size: 641 Bytes

Versions: 17

Compression:

Stored size: 641 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 -%>
<% attributes.select { |attribute| attribute.respond_to?(:token?) && attribute.token? }.each do |attribute| -%>
  has_secure_token<% if attribute.name != "token" %> :<%= attribute.name %><% end %>
<% end -%>
<% if attributes.any?(&:password_digest?) -%>
  has_secure_password
<% end -%>

  def execute
    # Implement this
  end
end
<% end -%>

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
crono_trigger-0.6.4 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.6.3 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.6.2 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.6.1 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.6.0 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.5.4 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.5.3 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.5.2 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.5.1 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.5.0 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.4.0 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.3.4 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.3.2 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.3.0 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.2.0 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.1.0 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.0.1 lib/generators/crono_trigger/model/templates/model.rb