Skip to content

Instantly share code, notes, and snippets.

@dekart
Created December 29, 2010 07:21
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 dekart/758298 to your computer and use it in GitHub Desktop.
Save dekart/758298 to your computer and use it in GitHub Desktop.
ActiveRecord::Base.class_eval do
before_save :set_site
def set_site
self.site_id = $current_site[:id] if respond_to?(:site_id=)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment