Rails Validate Presence If Another Field Is Not Present

[Solved] Rails Validate Presence If Another Field Is Not Present | Ruby - Code Explorer | yomemimo.com
Question : rails validate presence if another field is not present

Answered by : muhammad-zubair-hsmd9dcm7hd8

validates :first_name, presence: true, unless: :last_name?

Source : https://stackoverflow.com/questions/6273289/validate-presence-of-field-only-if-another-field-is-blank-rails | Last Update : Wed, 10 Aug 22

Answers related to rails validate presence if another field is not present

Code Explorer Popular Question For Ruby