Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix specs on ruby 2.6.x #1316

Merged
merged 2 commits into from Jul 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions app/models/notice.rb
@@ -1,6 +1,7 @@
require 'recurse'

class Notice
UNAVAILABLE = 'N/A'
MESSAGE_LENGTH_LIMIT = 1000

include Mongoid::Document
Expand Down Expand Up @@ -47,7 +48,7 @@ def user_agent

def user_agent_string
if user_agent.nil? || user_agent.none?
"N/A"
UNAVAILABLE
else
"#{user_agent.browser} #{user_agent.version} (#{user_agent.os})"
end
Expand Down Expand Up @@ -82,9 +83,10 @@ def url

def host
uri = url && URI.parse(url)
uri && uri.host || "N/A"
return uri.host if uri && uri.host.present?
UNAVAILABLE
rescue URI::InvalidURIError
"N/A"
UNAVAILABLE
end

def env_vars
Expand Down