title: ArgumentError (comparison of Fixnum with nil failed)
body: <p>I am using rails 3.2 and ruby 1.9.2. When i try to create a record with some assigned hash value it throws <code>ArgumentError (comparison of Fixnum with nil failed)</code> exception.
  My source code is </p>
  
  <pre><code>doc = ArtifactImage.create!(vars)
  </code></pre>
  
  <p>The value and schema for Image are listed below.</p>
  
  <pre><code>vars : {:parent=&gt;#&lt;ArtifactContainer id: 23, artifact_container_type_id: 2, party_id: 11, parent_id: 21, folder_id: nil, filing_center_group_id: nil, artifact_source_type_id: nil, display_date: nil, record_date: nil, display_name: "Pictures", path: "/bathakarai/Pictures", file: nil, description: nil, type: "ArtifactContainer", recycled: false, discarded_date: nil, signed: false, phr: true, record_status_id: 1, created_at: "2013-07-19 04:29:39", updated_at: "2013-07-19 04:29:39", lock_version: 2, lft: nil, rgt: nil&gt;, :file=&gt;"clip-art-tom-and-jerry-381931.jpg", :display_name=&gt;"Pictures", :artifact_source_type_id=&gt;3, :party_id=&gt;11, :folder_id=&gt;nil}
  </code></pre>
  
  <blockquote>
    <p>ArtifactImage : ArtifactImage(id: integer, artifact_container_type_id:
    integer, party_id: integer, parent_id: integer, folder_id: integer,
    filing_center_group_id: integer, artifact_source_type_id: integer,
    display_date: datetime, record_date: date, display_name: string, path:
    string, file: string, description: string, type: string, recycled:
    boolean, discarded_date: datetime, signed: boolean, phr: boolean,
    record_status_id: integer, created_at: datetime, updated_at: datetime,
    lock_version: integer, lft: integer, rgt: integer)</p>
  </blockquote>
  
  <p>The same code is working fine in rails-2. Please guide me how to solve this issue</p>