zefaker icon indicating copy to clipboard operation
zefaker copied to clipboard

Script doesn't work when column is named `name`

Open zikani03 opened this issue 3 years ago • 0 comments

The script below results in an exception because of the name token in the script;

import java.time.LocalDate;

name        = column(index= 0, name="name")
quantity    = column(index= 1, name="quantity")
created_at  = column(index= 2, name="created_at")
category    = column(index= 3, name="category")
deleted     = column(index= 4, name="deleted")
description = column(index= 5, name="description")
modified_at = column(index= 6, name="modified_at")

columns = [
    (name):         { ctx -> ctx.name().firstName() },
    (quantity):     { ctx -> ctx.number().numberBetween(1, 70) },
    (created_at):   { ctx -> LocalDate.now() },
    (category):     { ctx -> ctx.number().numberBetween(0, 5) },
    (deleted):      { ctx -> false },
    (description):  { ctx -> ctx.name().firstName() },
    (modified_at):  { ctx -> LocalDate.now() }
]

generateFrom columns

As reported by @SharkFourSix

zikani03 avatar Aug 12 '21 21:08 zikani03