Sha256: b70788ecbfac2d4ccb5442432ef9bd589e7f8bee49a598523de5cac4a2f2e18e

Contents?: true

Size: 678 Bytes

Versions: 5

Compression:

Stored size: 678 Bytes

Contents

<% module_namespacing do -%>
class <%= class_name %> < <%= parent_class_name.classify %>
  include CronoTrigger::Schedulable

<% 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

5 entries across 5 versions & 1 rubygems

Version Path
crono_trigger-0.8.3 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.8.1 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.8.0 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.7.1 lib/generators/crono_trigger/model/templates/model.rb
crono_trigger-0.7.0 lib/generators/crono_trigger/model/templates/model.rb