global

def account_from_unlock_key(key)

def account_from_unlock_key(key)
  id, key = key.split('_', 2)
  id_column = account_lockouts_id_column
  ds = db[account_lockouts_table].
    select(account_lockouts_id_column).
    where(account_lockouts_id_column=>id, account_lockouts_key_column=>key)
  account_model.where(account_id=>ds).first
end