use boolean return values in predicate methods - fixed

This commit is contained in:
Alexander Meindl 2023-06-23 16:13:42 +02:00
parent cded86b8da
commit 031298f230
2 changed files with 7 additions and 11 deletions

View File

@ -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:)

View File

@ -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)