use boolean return values in predicate methods - fixed
This commit is contained in:
parent
cded86b8da
commit
031298f230
@ -284,15 +284,11 @@ module AdditionalsQueriesHelper
|
||||
return false if token.blank? || !token.is_a?(String)
|
||||
|
||||
# Match http, https or ftp URL
|
||||
if %r{\A[fh]tt?ps?://}.match?(token) ||
|
||||
%r{\A[fh]tt?ps?://}.match?(token) ||
|
||||
# Match mailto:
|
||||
token.start_with?('mailto:') ||
|
||||
# Match internal or external sheet link
|
||||
/\A(?:in|ex)ternal:/.match?(token)
|
||||
true
|
||||
end
|
||||
|
||||
false
|
||||
end
|
||||
|
||||
def set_flash_from_bulk_save(entries, unsaved_ids, name_plural:)
|
||||
|
@ -182,10 +182,10 @@ class Dashboard < ActiveRecord::Base
|
||||
else
|
||||
user.memberships.joins(:member_roles).where(member_roles: { role_id: roles.map(&:id) }).any?
|
||||
end
|
||||
end
|
||||
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def content
|
||||
@content ||= "DashboardContent#{dashboard_type[0..-10]}".constantize.new(project: content_project.presence || project)
|
||||
|
Loading…
x
Reference in New Issue
Block a user