Audit Trail

<%% unless obj.versions.empty? %> <%% obj.versions.each do |version| %> <%% end %> <%% else -%> <%% end -%>
Version # Modified at Modified by Action Changes
<%%= version.index %> <%%= version.created_at.to_s(:db) %> <%% unless version.whodunnit.to_i == 0 %> <%%= User.find(version.whodunnit.to_i).name %> <%% else %> <%%= version.whodunnit || 'N/A' %> <%% end%> <%%= version.event.humanize %> <%% if version.event == 'create'%> Initial Create <%% else %> <%% unless version.next.nil? %> <%% version.reify.diff(version.next.reify).each do |t| %> <%% unless t.first == :updated_at %>

"<%%= t.first.to_s.humanize %>" was changed from "<%%= t.last.first.to_s rescue '' %>" to "<%%= t.last.last.to_s rescue '' %>"

<%% end %> <%% end rescue 'Undetermined Changes'%> <%% else %> <%% version.reify.diff(obj).each do |t| %> <%% unless t.first == :updated_at %>

"<%%= t.first.to_s.humanize %>" was changed from "<%%= t.last.first.to_s rescue '' %>" to "<%%= t.last.last.to_s rescue '' %>"

<%% end %> <%% end rescue 'Undetermined Changes'%> <%% end %> <%% end %>
<%%=t :no_data_available%>