Skip to content

Instantly share code, notes, and snippets.

@ahoward
Created December 16, 2008 02:56
Show Gist options
  • Save ahoward/36239 to your computer and use it in GitHub Desktop.
Save ahoward/36239 to your computer and use it in GitHub Desktop.
def local_request?()
return true if %w( development test ).include?(RAILS_ENV)
local = %w(
0.0.0.0
127.0.0.1
localhost
localhost.localdomain
)
local.include?(request.remote_addr) and local.include?(request.remote_ip)
end
private 'local_request?'
#end
self.consider_all_requests_local = true if %w( development test ).include?(RAILS_ENV)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment