app/views/model_info/models/display.html.erb in model_info-0.0.2 vs app/views/model_info/models/display.html.erb in model_info-0.0.3
- old
+ new
@@ -22,10 +22,10 @@
<td>
<% relationship_hash ={}, a1=[], a2=[]%>
<% @model_class.constantize.reflect_on_all_associations.each do |reflection|%>
<% reflection.options[:polymorphic] ? a1.push(reflection.active_record.name) : a2.push(reflection.klass.name) %>
<% end %>
- <% relationship_hash = @model_class.constantize.reflect_on_all_associations.map{|x| [x.name, x.macro]}.zip(a1+a2).to_h %>
+ <% relationship_hash = @model_class.constantize.reflect_on_all_associations.map{|x| [x.name, x.macro]}.zip(a1+a2).inject({}){|h,e| h[e.first] = e.last; h}%>
<% if relationship_hash.empty? %>
<%= 'Sorry no relationship!'%>
<% else %>
<% relationship_hash.each do |k,v| %>