title: Rails presence validation didn't working in params key as array
body: <p>I got this problem where my test fails because the validation presence: true didn't work. I wonder why it didn't trigger. So, here's the code that I have:</p>
  
  <p>A simple update in controller</p>
  
  <pre><code>def update
     person = Person.find_by( params[:id] )
  
     if person.update( params_person )
        render json: {}, status: :ok
     else
        render json: person.errors, status: :422
     end
  end
  
  def params_person
    params.require( :person ).permit( :firstname, :lastname, ... , hobbies: [] )
  end
  </code></pre>
  
  <p>The <code>hobbies: []</code> is an array of strings hobbies like <code>['playing dota', 'basketball', 'coding', ... ]</code></p>
  
  <p>Person model</p>
  
  <pre><code>class Person &lt; ActiveRecord::Base
    ...
    validates :hobbies, presence: true
    ...
  end
  </code></pre>
  
  <p>if I did a request which</p>
  
  <pre><code>{ ...
    ...
    hobbies: nil/'',
    ...
    ...
  }
  </code></pre>
  
  <p>the validation still passing without update hobbies as the data <code>nil/''</code></p>
  
  <h1>Updated</h1>
  
  <pre><code>describe '#update' do
      let( :user ) { create( :user ) }
  
      fcontext 'when params missing' do
        before do
          put :update, id: person.id,
              person: {
                ....,
                ....,
                hobbies: nil 
              }
        end
  
        it 'respond an error message' do
          expect( response_body ).to include( "Hobbies can't be blank" )
        end
  
        it { expect( response ).to have_http_status( 422 ) }
      end
  </code></pre>