def valid_user
      if (self.username.blank? || self.password_digest.blank?) &&
          (self.oauth_provider.blank? || self.oauth_uid.blank?)
        errors.add(:username, " and password OR oauth must be specified")
      end
    end
def valid_user
      if (self.username.blank? || self.password_digest.blank?) &&
          (self.oauth_provider.blank? || self.oauth_uid.blank?)
        errors.add(:username, " and password OR oauth must be specified")
      end
    end
This method validates if the user object is valid. A user is valid if
 username and password exist OR oauth integration exists.