Files
fizzy/app/models/command.rb
T
2025-05-16 13:29:18 +02:00

38 lines
441 B
Ruby

class Command < ApplicationRecord
include Rails.application.routes.url_helpers
belongs_to :user
attribute :context
def title
model_name.human
end
def execute
end
def undo
end
def undo!
transaction do
undo
destroy
end
end
def undoable?
false
end
def needs_confirmation?
false
end
private
def redirect_to(...)
Command::Result::Redirection.new(...)
end
end