Created
August 17, 2016 05:18
-
-
Save akshaysmurthy/fc42c2de7a131e39096de69fe00a663b to your computer and use it in GitHub Desktop.
Validates presence with if clause
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
validates :response_options, presence: { if: Proc.new { |item| item.type == 'single-select' }, message: 'single select item cannot be empty.' } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment