Skip to content

Instantly share code, notes, and snippets.

@guenin
Created November 29, 2008 21:38
Show Gist options
  • Save guenin/30325 to your computer and use it in GitHub Desktop.
Save guenin/30325 to your computer and use it in GitHub Desktop.
module RouteMatcher
class NoSubdomain
def === (other)
other.blank? || SubdomainFu.mirrors.include?(other)
end
end
class Subdomain < NoSubdomain
def === (other)
!super
end
end
class ExistingSubdomain < Subdomain
def === (other)
super && User.find_by_name(other)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment