Class: Gemgento::Magento::BaseController

Inherits:
ApplicationController show all
Defined in:
app/controllers/gemgento/magento/base_controller.rb

Instance Method Summary collapse

Instance Method Details

#validate_ipObject



8
9
10
11
12
13
14
# File 'app/controllers/gemgento/magento/base_controller.rb', line 8

def validate_ip
  whitelist = Config[:magento][:ip_whitelist].to_s.split(',').map(&:strip)

  if Rails.env.production? && !whitelist.include?(request.remote_ip.to_s)
    raise ActionController::RoutingError.new('Not Found')
  end
end