I'm trying to use with_options to group my conditional validations together for admin users. The second validation for username uniqueness ends up overriding the with_options condition.
Is there a better way to do this? Or should I just forget about with_options and write two separate statements?
with_options :if => Proc.new { |user| user.admin? } do |admin|
admin.validates :email, :presence => true
admin.validates :username, :uniqueness => true, :if => Proc.new { |user| user.category == "customized_username" }
end