handle rails' ClassMethods