Skip to content

Commit

Permalink
EPBR-1719 Move constants to base controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Christine-horrocks committed Oct 22, 2024
1 parent 7abad14 commit 182a2ee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
9 changes: 8 additions & 1 deletion lib/controller/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def initialize(*args)
super
setup_locales
@toggles = Helper::Toggles

@container = Container.new
@logger = Logger.new($stdout)
@logger.level = Logger::INFO
Expand All @@ -48,6 +47,14 @@ def initialize(*args)
end
end

FIND_ENERGY_CERTIFICATE_HOST_NAME = "find-energy-certificate".freeze
GETTING_NEW_ENERGY_CERTIFICATE_HOST_NAME = "getting-new-energy-certificate".freeze

EXCLUDE_GREEN_DEAL_REFERRER_PATHS = %w[
/find-a-certificate/search-by-postcode
/find-a-certificate/search-by-street-name-and-town
].freeze

def show(template, locals, layout = :layout)
locals[:errors] = @errors
erb template, layout:, locals:
Expand Down
8 changes: 0 additions & 8 deletions lib/controller/find_energy_certificate_controller.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
module Controller
class FindEnergyCertificateController < Controller::BaseController
FIND_ENERGY_CERTIFICATE_HOST_NAME = "find-energy-certificate".freeze
GETTING_NEW_ENERGY_CERTIFICATE_HOST_NAME = "getting-new-energy-certificate".freeze

EXCLUDE_GREEN_DEAL_REFERRER_PATHS = %w[
/find-a-certificate/search-by-postcode
/find-a-certificate/search-by-street-name-and-town
].freeze

find_a_certificate_property_type =
lambda do
query = params.map { |key, value| "#{key}=#{value}" }.join("&")
Expand Down
3 changes: 0 additions & 3 deletions lib/controller/getting_new_energy_certificate_controller.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
module Controller
class GettingNewEnergyCertificateController < Controller::BaseController
GETTING_NEW_ENERGY_CERTIFICATE_HOST_NAME = "getting-new-energy-certificate".freeze
FIND_ENERGY_CERTIFICATE_HOST_NAME = "find-energy-certificate".freeze

find_an_assessor_property_type =
lambda do
query = params.map { |key, value| "#{key}=#{value}" }.join("&")
Expand Down

0 comments on commit 182a2ee

Please sign in to comment.