Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix uploading flow for Mockr instances without Campfire configured

Users without a Campfire subdomain set were seeing an error message when
uploading a mock. The mock went through, but we were encountering an error in
attempting to parse the URI ".campfire.now", which does not exist. We now only
parse if a proper campfire subdomain has been configured.

Change-Id: I18af41801b9115baf159869dbb11593d1c96c662
Reviewed-on: https://gerrit.causes.com/5217
Tested-by: Chris Chan <chris@causes.com>
Reviewed-by: Adam Derewecki <adam@causes.com>
  • Loading branch information...
commit 6b0fdf318006aadb6fa79467c86dbba9ae725e44 1 parent be438ae
Chris Chan authored Adam Derewecki committed
Showing with 4 additions and 4 deletions.
  1. +4 −4 app/models/campfire.rb
View
8 app/models/campfire.rb
@@ -2,8 +2,8 @@ class Campfire
KEYS = ["campfire_subdomain", "campfire_token", "campfire_room"]
def self.notify_mocks_created(mocks, url)
- room = find_room
- if use? && room
+ if use?
+ room = find_room
mock = mocks.first
mocks_text = mocks.size == 1 ? "a new mock" : "#{mocks.size} new mocks"
room.speak "#{mock.author.name} posted #{mocks_text}:"
@@ -11,7 +11,7 @@ def self.notify_mocks_created(mocks, url)
room.speak url
end
# Handle invalid token and invalid subdomain errors respectively.
- rescue Tinder::AuthenticationFailed, NoMethodError
+ rescue Tinder::AuthenticationFailed, NoMethodError
# Do nothing.
end
@@ -34,7 +34,7 @@ def self.settings
end
settings
end
-
+
def self.use?
!self.settings["campfire_subdomain"].blank?
end
Please sign in to comment.
Something went wrong with that request. Please try again.