Created
June 6, 2019 12:19
-
-
Save edlvj/056b8385e3163806e7d3efb071deaba4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
# Copyright (c) 2017-2019 SwiftComply | |
# | |
# Grease Trap Back Path | |
module GreaseTrapBackPath | |
extend ActiveSupport::Concern | |
def set_grease_traps_back_path | |
return city_grease_traps_path unless request.referer | |
return referer_path if is_establishment_refer_path? | |
city_grease_traps_path | |
end | |
def is_establishment_refer_path? | |
referer_path.include?(city_establishments_path) | |
end | |
def referer_path | |
URI(request.referer).path | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment