summaryrefslogtreecommitdiff
path: root/engines/support/app/models
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2016-05-22 21:11:48 +0200
committerAzul <azul@riseup.net>2016-05-22 21:14:45 +0200
commitb851fe2fd6e0029df81976b647ede7190a1fd547 (patch)
tree2f1335fa1de85d3bf078e0dcc98fa7ce364e67db /engines/support/app/models
parenta1b494e334406660a1f49fb7de9b043493809640 (diff)
make ticket tests pass without network connection
MX validations relied on network connection. Only using them in production environment now. I want to be able to develop and test when disconnected.
Diffstat (limited to 'engines/support/app/models')
-rw-r--r--engines/support/app/models/ticket.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/support/app/models/ticket.rb b/engines/support/app/models/ticket.rb
index 4615a10..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)