summaryrefslogtreecommitdiff
path: root/engines/support/app/models
diff options
context:
space:
mode:
authorazul <azul@leap.se>2014-05-30 18:02:20 +0200
committerazul <azul@leap.se>2014-05-30 18:02:20 +0200
commit9f04e4c8e50f1dc5a7ff6f2e58974254731a6bc4 (patch)
tree84db71a6e52c47bc2f2f1aabce578ce367fcb0e8 /engines/support/app/models
parent568a5c243f0a0ef90807c96b19643ec341994bbb (diff)
parent9e3be686ff2751707369894382293924420830d0 (diff)
Merge pull request #167 from azul/feature/i18n-for-ticket-system0.5.2-rc
Feature/i18n for ticket system
Diffstat (limited to 'engines/support/app/models')
-rw-r--r--engines/support/app/models/ticket.rb2
-rw-r--r--engines/support/app/models/ticket_comment.rb5
2 files changed, 7 insertions, 0 deletions
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
diff --git a/engines/support/app/models/ticket_comment.rb b/engines/support/app/models/ticket_comment.rb
index bed5237..2c5df41 100644
--- a/engines/support/app/models/ticket_comment.rb
+++ b/engines/support/app/models/ticket_comment.rb
@@ -18,6 +18,11 @@ class TicketComment
# view :by_body
#end
+ # translations are in the same scope as those of a "proper" couchrest model
+ def self.i18n_scope
+ "couchrest"
+ end
+
def is_comment_validated?
!!posted_by
end