title: Rails: error displaying all projects
body: <p>I'm having a problem displaying project statuses with relationships.</p>
  
  <p>task.rb model: </p>
  
  <pre><code>class Task &lt; ActiveRecord::Base
    belongs_to :project
    has_one :status
    has_one :kind
  
  
    validates :title, presence: true, length: { maximum: 200 }
    validates :alias, length: { maximum: 200 }
    validates :mail_cc, length: { maximum: 200 }
    validates :description, presence: true
    validates :keywords, length: { maximum: 200 }
  end
  </code></pre>
  
  <p>status.rb model:</p>
  
  <pre><code>class Status &lt; ActiveRecord::Base
    belongs_to :task
    belongs_to :project
    =begin
      OPEN
      TESTING
      CLOSED
    =end
   validates :value, presence: true
  </code></pre>
  
  <p>end</p>
  
  <p>status have 3 objects with value: a) open b) testing c) closed</p>
  
  <p>projects/index.html.erb</p>
  
  <pre><code>&lt;%= link_to "New", new_project_path %&gt; |
  &lt;%= link_to "Active", projects_path(active: "active") %&gt; |
  &lt;%= link_to "All", projects_path %&gt;
  
  &lt;hr&gt;
  
  &lt;h3&gt;Projects&lt;/h3&gt;
  
  &lt;hr&gt;
  
  &lt;table class="table table-hover"&gt;
  
  &lt;thead&gt;
     &lt;tr&gt;
       &lt;th&gt;Name&lt;/th&gt;
       &lt;th&gt;Status&lt;/th&gt;
       &lt;th&gt;Actions&lt;/th&gt;
     &lt;/tr&gt;
   &lt;/thead&gt;
  &lt;% @projects.each do |project| %&gt;
  &lt;tr&gt;
    &lt;th&gt;&lt;%= link_to project.name, project %&gt;&lt;/th&gt;
    &lt;th&gt;&lt;%= project.status.value %&gt;&lt;/th&gt;
    &lt;th&gt;
      &lt;%= link_to "Show", '#' %&gt; |
      &lt;%= link_to "Destroy", project_path(project), method: :delete %&gt;
    &lt;/th&gt;
  &lt;/tr&gt;
  &lt;% end %&gt;
  
   &lt;/table&gt;
  </code></pre>
  
  <p>It's all working when all have one status. When I create another project with "open" or "testing" or "closed" status I get an error.</p>
  
  <p><a href="http://i.stack.imgur.com/6QycR.png" rel="nofollow">Crash</a> </p>
  
  <p>It create a new project but can't show more than one project with same status.</p>