Sha256: 5cd9dff826a524b05db477ebb8cb7ee22a4fe31bada530695e7ab3055c7529fe

Contents?: true

Size: 416 Bytes

Versions: 4

Compression:

Stored size: 416 Bytes

Contents

<% module_namespacing do -%>
class <%= class_name %>Command < Slayer::Command
  def call(<%= file_name %>_form:)
    fail! unless arguments_valid?(<%= file_name %>_form)

    transaction do
      # Do your database interaction here!
    end

    pass!
  end

  def arguments_valid?(<%= file_name %>_form)
    <%= file_name %>_form.kind_of?(<%= class_name %>Form) && <%= file_name %>_form.valid?
  end
end
<% end -%>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
slayer_rails-0.4.0.beta4 lib/generators/command/templates/command.rb
slayer_rails-0.4.0.beta3 lib/generators/command/templates/command.rb
slayer_rails-0.3.3 lib/generators/command/templates/command.rb
slayer_rails-0.3.2 lib/generators/command/templates/command.rb