I am debugging a rails app for my boss while he is on vacation. We have an app the company uses that we can use to fill out timesheets and view customer tickets. On the open tickets page, there is a column with a brief description of the ticket. We have an environment on Ubuntu for production, and an XP environment for development, both of those don't experience the bug. But if I run the environment on Windows 7 or newer, the description doesn't show up as a string but as a BigDecimal, usually as "0.0" some of the tickets show other numbers. I would post screenshots but I won't for the privacy of the company.
Here's what I know so far, and please bare with me as I'm just learning rails and coding in frameworks (intern who just finished his first year of University): The database we are using displays the actual description in the table. The view and controller are both explicitly converting to string, when I got rid of .to_s in the code, the bug persisted. I have the class type being sent to a logfile as well that confirms it is a BigDecimal. When running the production code from my machine the bug persisted. I think it is an OS compatibility issue possibly. Or somewhere between the database and the app itself, the data is being converted to BigDecimal in a file that I don't yet know about. I am running rails 3.0.7 and ruby 1.9.2p290
Here is the code I think is suspect:
<div id="page_center">
<div id="branding_row">
<%= label_tag("Show_Open", "Show Open Tickets",{:class => 'page_label'}) -%>
</div>
<div id="tabs">
<ul>
<% @locationHash.keys.each do |keyItem| %>
<li><a href="#tabs-<%= keyItem %>"><%= keyItem %></a></li>
<% end %>
</ul>
<% @locationHash.keys.each do |keyItem| %>
<div id="tabs-<%= keyItem %>">
<table >
<tr >
<th style="width:50px; empty-cells:hide;">WO#</th>
<th style="width:125px; empty-cells:hide;">Customer Name</th>
<th style="width:125px; empty-cells:hide;">Description</th>
<th style="width:65px; empty-cells:hide;">Tech</th>
<th style="width:125px; empty-cells:hide;">Date/Time</th>
</tr>
<% @locationHash[keyItem].each do |ticketItem| %>
<tr>
<td><%= ticketItem.work_order.to_s %></td>
<td><%= ticketItem.customer_name.to_s %></td>
<td><%= ticketItem.woDesc.to_s %></td>
<td><%= ticketItem.tech.to_s %></td>
<td><%= ticketItem.created_at.to_s %></td>
</tr>
<% end %>
</table>
</div>
<% end %>
</div>
</div>
<div id="right_column">
</div>
Let me know if you need to see other files.
Thanks in advance for any help, I hope this isn't seen as homework help, there are no other developers to help at my work.
Aucun commentaire:
Enregistrer un commentaire