Files
fizzy/app/models/command/go_to_card.rb
T

19 lines
277 B
Ruby

class Command::GoToCard < Command
store_accessor :data, :card_id
validates_presence_of :card
def title
"Visit card '#{card&.title}'"
end
def execute
redirect_to card
end
private
def card
user.accessible_cards.find_by_id(card_id)
end
end