summaryrefslogtreecommitdiff
path: root/engines/support/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'engines/support/app/models')
-rw-r--r--engines/support/app/models/account_extension/tickets.rb13
-rw-r--r--engines/support/app/models/ticket.rb6
2 files changed, 4 insertions, 15 deletions
diff --git a/engines/support/app/models/account_extension/tickets.rb b/engines/support/app/models/account_extension/tickets.rb
deleted file mode 100644
index f38d5fd..0000000
--- a/engines/support/app/models/account_extension/tickets.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-module AccountExtension::Tickets
- extend ActiveSupport::Concern
-
- def destroy_with_tickets(destroy_identities=false)
- Ticket.destroy_all_from(self.user)
- destroy_without_tickets(destroy_identities)
- end
-
- included do
- alias_method_chain :destroy, :tickets
- end
-
-end
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