Skip to content

Commit

Permalink
disable cop
Browse files Browse the repository at this point in the history
  • Loading branch information
frontstall committed Aug 18, 2021
1 parent 945d69b commit 2c3df6e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,11 @@ def get_continue_study_path(slug)
end

def supported_browser?
# NOTE https://github.com/browserslist/browserslist-useragent-ruby#3-add-helper
# rubocop:disable Rails/HelperInstanceVariable
@browsers ||= JSON.parse(File.read('browsers.json'))
matcher = BrowserslistUseragent::Match.new(@browsers, request.user_agent)
matcher.browser? && matcher.version?(allow_higher: true)
# rubocop:enable Rails/HelperInstanceVariable
end
end

0 comments on commit 2c3df6e

Please sign in to comment.