Skip to content

Instantly share code, notes, and snippets.

@MarkMenard
Created December 16, 2009 22:53
Show Gist options
  • Save MarkMenard/258290 to your computer and use it in GitHub Desktop.
Save MarkMenard/258290 to your computer and use it in GitHub Desktop.
class Member < ActiveRecord::Base
class << self
def new (attributes = nil, &block)
if self == Member
klass = Object.const_get("#{(ENV['MORI_ENV'] ? ENV['MORI_ENV'] : "").camelize}Member".to_sym)
if klass != Member
return klass.new(attributes, &block)
end
end
super
end
end
def hi
"Regular Member"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment