title: Empty string as default value for enum type column instead of nil in Rails
body: <p>The problem is that I'm receiving empty string instead of <em>nil</em> as default value for <em>enum</em> column in PostgreSQL database, while creating new <em>ActiveRecord</em> object. Here is some more information. </p>
  
  <p>My migration:</p>
  
  <pre><code>class CreateTickets &lt; ActiveRecord::Migration
    def change
      execute &lt;&lt;-SQL
        CREATE TYPE ticket_status AS ENUM ('submitted', 'open', 'closed');
      SQL
  
      create_table :tickets do |t|
        t.string :name
        t.column :status, :ticket_status
  
        t.timestamps null: false
      end
    end
  end
  </code></pre>
  
  <p>My model:</p>
  
  <pre><code>class Ticket &lt; ActiveRecord::Base
    STATUS = {
      submitted:  'submitted',
      open:       'open',
      closed:     'closed'
    }
  
    validates :status, inclusion: { in: Ticket::STATUS.values }, allow_nil: true
  end
  </code></pre>
  
  <p>My goal is to allow <em>nil</em> value in database table, but when I'm trying to create new object, I'm receiving "not included in the list error": </p>
  
  <pre><code>2.2.0 :005 &gt;   Ticket.create!
     (0.8ms)  BEGIN
     (0.5ms)  ROLLBACK
  ActiveRecord::RecordInvalid: Validation failed: Status is not included in the list 
  </code></pre>
  
  <p>This happens because new object is created with empty string as default value in status column, while other columns get correct nil values:</p>
  
  <pre><code>2.2.0 :010 &gt;   Ticket.new
   =&gt; #&lt;Ticket id: nil, name: nil, status: "", created_at: nil, updated_at: nil&gt; 
  </code></pre>
  
  <p>One more condition here, that I do want to use native PostgreSQL ENUM type, instead of integer mapping. </p>