title: How can make a decision based on multiple models in Rails?
body: <p>i have three model project_site, project_manager and human_resource. each model has status Boolean attribute i want to print "approve" only if all status==true but want to print "reject" if any one of the status is set to false. each status has nil value by default.</p>
  
  <pre><code>        &lt;% if project_site.human_resources.empty? %&gt;
                &lt;td class="pending fi-eye"&gt;&lt;%= " Pending" %&gt;&lt;/td&gt;
              &lt;% elsif %&gt;
                &lt;% project_site.human_resources.each do |human_resource| %&gt;
                  &lt;% if human_resource.status == false %&gt;
                    &lt;td class="rejected fi-x"&gt;&lt;%= ' Rejected' %&gt;&lt;/td&gt;
                  &lt;% elsif human_resource.status == true %&gt;
                    &lt;td class="approved fi-check"&gt;&lt;%= " Approved" %&gt;&lt;/td&gt;
                  &lt;% end %&gt;
                &lt;% end %&gt;
  
                &lt;% elsif %&gt;
                  &lt;% project_site.project_directors.each do |project_director| %&gt;
                    &lt;% if project_director.status == false %&gt;
                      &lt;td class="rejected fi-x"&gt;&lt;%= ' Rejected' %&gt;&lt;/td&gt;
                    &lt;% end %&gt;
                  &lt;% end %&gt;
  
                  &lt;% elsif %&gt;
                    &lt;% project_site.project_managers.each do |project_manager| %&gt;
                      &lt;% if project_manager.status == false %&gt;
                        &lt;td class="rejected fi-x"&gt;&lt;%= ' Rejected' %&gt;&lt;/td&gt;
                      &lt;% end %&gt;
                    &lt;% end %&gt;
              &lt;% end %&gt;
  
  </code></pre>