From 467dd712a19d48fc653cfc0e58201e6657d2c1f9 Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 20 May 2014 12:30:55 +0200 Subject: split up and refactor TicketController#update close and open actions for plain opening and closing the tickets respond_with so fields are not cleared on invalid update the custom actions are not strictly restful. But adding a subresource felt like too much overhead and is conceptually hard to grasp (so we destroy the openess of the ticket to close it?). --- engines/support/app/models/ticket.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/support/app/models/ticket.rb') diff --git a/engines/support/app/models/ticket.rb b/engines/support/app/models/ticket.rb index bf5df53..161507c 100644 --- a/engines/support/app/models/ticket.rb +++ b/engines/support/app/models/ticket.rb @@ -39,6 +39,8 @@ class Ticket < CouchRest::Model::Base # * valid email address validates :email, :allow_blank => true, :format => /\A(([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,}))?\Z/ + # validates :comments, presence: true + def self.search(options = {}) @selection = TicketSelection.new(options) @selection.tickets -- cgit v1.2.3