Search code examples
rubyfaker

Generate random values


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?


Solution

  • 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.