How to check if the value is repeated?

hi!

as the subject says, :stuck_out_tongue: how can i check if a value is already in a
table??

ty!!

if (Modelname.find_by_columnname(…value_to_check…))

another entry exists with columnname === value to check

else

no other entry exists with columnname === value to check

end

vincent vega wrote:

hi!

as the subject says, :stuck_out_tongue: how can i check if a value is already in a
table??

ty!!

This may come in handy:

validate_uniqueness_of :column_name

Max