class Rethinker::QueryRunner::TableOnDemand

Public Instance Methods

call(env) click to toggle source
# File lib/rethinker/query_runner/table_on_demand.rb, line 2
def call(env)
  @runner.call(env)
rescue RuntimeError => e
  if e.message =~ /^Table `(.+)` does not exist\.$/
    # TODO Lookup the Model, and get the primary key name
    Rethinker.table_create $1
    retry
  end
  raise e
end