summaryrefslogtreecommitdiff
path: root/engines/support/app/models/ticket.rb
diff options
context:
space:
mode:
authorNavaL <ayoyo@thoughtworks.com>2016-07-14 15:44:07 +0200
committerNavaL <ayoyo@thoughtworks.com>2016-07-14 15:44:07 +0200
commite3c2cb91dfef5c39c608b967e702e9de977d1bd2 (patch)
tree154dc28dd986bd6e0a48e933c5da46994ffaa0cb /engines/support/app/models/ticket.rb
parente2f19bcfb6dbce77746c2d61715340525b29a592 (diff)
parentf09e6ec1337962ab279f021a6a6d0ff30479ebe0 (diff)
Merge branch 'develop' of https://github.com/leapcode/leap_web into feature/expose_admin_in_api
Diffstat (limited to 'engines/support/app/models/ticket.rb')
-rw-r--r--engines/support/app/models/ticket.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/support/app/models/ticket.rb b/engines/support/app/models/ticket.rb
index b1bdf8d..025e2ab 100644
--- a/engines/support/app/models/ticket.rb
+++ b/engines/support/app/models/ticket.rb
@@ -37,9 +37,11 @@ class Ticket < CouchRest::Model::Base
# email can be nil, "", or valid address.
# validation provided by 'valid_email' gem.
+ # mx validation depends on network availability and is disabled in test
+ # and development environment
validates :email, :allow_blank => true,
:email => true,
- :mx_with_fallback => true
+ :mx_with_fallback => Rails.env.production?
def self.search(options = {})
@selection = TicketSelection.new(options)
@@ -50,7 +52,7 @@ class Ticket < CouchRest::Model::Base
self.by_created_by.key(user.id).each do |ticket|
ticket.destroy
end
- rescue RestClient::ResourceNotFound
+ rescue RESOURCE_NOT_FOUND
# silently ignore if design docs are not yet created
end