-3

I want to generate random name using the following code:

def random_card_holder
  Faker::Name.first_name + " " + Faker::Name.last_name
end

But I get validation error. Is this code valid?

Andrey Deineko
  • 51,333
  • 10
  • 112
  • 145
Peter Penzov
  • 1,126
  • 134
  • 430
  • 808

1 Answers1

2

Is this code valid?

Yes this is a valid code.

But I get validation error.

You validate the (assumably) card_holder column, and the result of this valid code does not meet the validation rules.

Andrey Deineko
  • 51,333
  • 10
  • 112
  • 145