title: Null constraint error while Default value is set Ruby On Rails - Postgresql
body: <p>In my database i have a table with schema like below</p>
  
  <pre><code>  create_table "external_source", force: :cascade do |t|
      t.string   "external_id"
      t.string   "permalink",                             null: false
      t.datetime "created_at",                            null: false
      t.datetime "updated_at",                            null: false
      t.boolean  "is_deleted",         default: false,    null: false
      t.string   "company_name",       default: ""
      t.boolean  "hide_salary",        default: true,     null: false
    end
  </code></pre>
  
  <p>But when i tried to insert values without <code>is_deleted</code> parameter, <code>Rails</code> server throws null constraint violation error like: </p>
  
  <blockquote>
    <p>ActiveRecord::StatementInvalid (PG::NotNullViolation: ERROR:  null
    value in column "is_deleted" violates not-null constraint</p>
  </blockquote>
  
  <p>Now when I have set its default value I am not expecting this error. can you tell me what wrong am I doing. Thank You</p>
  
  <p>here is the JSON to insert</p>
  
  <pre><code>{
    "data":
    [
      {
        "external_id":"2262a0228sf-1b9e-sd4e76-b5d7-a8ba01783ebb9i3413139",
        "permalink": '234242341',
        "hide": true,
        "company_name": "com1",
      }
    ]
  }
  </code></pre>