Skip to content

Instantly share code, notes, and snippets.

@RSpace
Created August 6, 2009 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RSpace/163187 to your computer and use it in GitHub Desktop.
Save RSpace/163187 to your computer and use it in GitHub Desktop.
module SiteExtension
def self.included(base)
base.class_eval {
extend ClassMethods
}
end
module ClassMethods
# We only have one site, and we want to use that whatever the url might be
def find_by_host(host)
Site.first
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment