title: How to use with_options for conditional validation
body: <p>How can I use <code>with_options</code> for conditional validation ?</p>
  
  <p>My code is </p>
  
  <pre><code>with_options if: (AppUser::User.creator=="is_admin") do |admin|
    admin.validates :first_name, :presence =&gt; true
    admin.validates :last_name, :presence =&gt; true
  end
  </code></pre>
  
  <p>I have already set <code>creator</code> method in application controller.</p>
  
  <pre><code>before_action :set_global_user
  
  def set_global_user
    if current_admin
      AppUser::User.creator= "is_admin"
    elsif current_user
      AppUser::User.creator= "is_user"
    else
      AppUser::User.creator=nil
    end
  end
  </code></pre>
  
  <p>but I am getting </p>
  
  <blockquote>
    <p>undefined method `validate' for false:FalseClass</p>
  </blockquote>
  
  <p>what is wrong with this code.</p>