title: Ruby on Rails: wrong argument type nil (expected Fixnum)
body: <p>I'm getting strange error</p>
  
  <pre><code>ActionView::Template::Error (wrong argument type nil (expected Fixnum)):
  </code></pre>
  
  <p>On this line:</p>
  
  <pre><code>&lt;%= (!attach.file_size.nil?) ? "(#{number_to_human_size(attach.file_size.to_i).to_s})": ""  %&gt;
  </code></pre>
  
  <p>Here's my code:</p>
  
  <pre><code>&lt;% if !pr.attachments.empty? %&gt;
  &lt;ul class="attached_files"&gt;
    &lt;% pr.attachments.each do |attach| %&gt;
      &lt;li&gt;&lt;a href="&lt;%= attach.path_url%&gt; " target="_blank"&gt;&lt;%= attach.path_identifier%&gt;&lt;/a&gt; 
      &lt;%= (!attach.file_size.nil?) ? "(#{number_to_human_size(attach.file_size.to_i).to_s})": ""  %&gt;
      &lt;/li&gt;
    &lt;%end%&gt;
  &lt;/ul&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>I don't get where problem is. Help me please. Thanks!</p>