Skip to content

Instantly share code, notes, and snippets.

@ptzn
Created August 19, 2013 11:56
Show Gist options
  • Save ptzn/6268361 to your computer and use it in GitHub Desktop.
Save ptzn/6268361 to your computer and use it in GitHub Desktop.
constraints(OwnDomain) do
match # ...
resources #...
end
class OwnDomain
def self.matches?(request)
request.subdomain.present? && request.subdomain != "www" && request.host !~ /localhost|\.local|hostname\.com/
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment