diff options
author | azul <azul@leap.se> | 2014-05-30 18:02:20 +0200 |
---|---|---|
committer | azul <azul@leap.se> | 2014-05-30 18:02:20 +0200 |
commit | 9f04e4c8e50f1dc5a7ff6f2e58974254731a6bc4 (patch) | |
tree | 84db71a6e52c47bc2f2f1aabce578ce367fcb0e8 /engines/support/app/models | |
parent | 568a5c243f0a0ef90807c96b19643ec341994bbb (diff) | |
parent | 9e3be686ff2751707369894382293924420830d0 (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.rb | 2 | ||||
-rw-r--r-- | engines/support/app/models/ticket_comment.rb | 5 |
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 |