[RUBY] If the custom validation method says "Argument Error: You need to supply at least one validation"

Probably it is written as validates as below, so modify it as validate.

Class user < ApplicationRecord
  # NG
  validates :custom_method
  # OK
  validate :custom_method

  def custom_method
    ...
  end
end

Recommended Posts

If the custom validation method says "Argument Error: You need to supply at least one validation"
Rails: You need to supply at least one validation error
[Rails] What to do if you can't get an error message with the errors method
What to do if you get the error message unrecognized selector send to instance "***"
What to do if you get angry with "ERROR: There are no scenarios; must have at least one" even though you should have entered yarn in Docker
When you want to use the method outside
What to do if you get the error Couldn't find Item without an ID
Create an app that uses the weather API to determine if you need an umbrella.