class ZuoraConnect::AppInstanceBase

def check_oauth_state(method)

### START Connect OAUTH methods ####
def check_oauth_state(method)
  #Refresh token if already expired
  if self.oauth_expired?
    ZuoraConnect.logger.debug("[#{self.id}] Before '#{method}' method, Oauth expired")
    self.refresh_oauth
  end
end