Multiple Validations Grouped By A Condition In Rails

Posted By Weston Ganger

Sometimes you need to apply a if or unless condition to many validations at once. Well heres how to do it in Rails

if: :is_admin?
if: "is_admin?"
if: Proc.new {|x| x.is_admin?}

Article Topic:Software Development - Ruby / Rails

Date:March 18, 2015