Use model accessors explicitly instead of #[]

#660
This commit is contained in:
Artur Beljajev 2018-01-30 19:33:00 +02:00
parent 762f891b84
commit cefa37d081
5 changed files with 6 additions and 6 deletions

View file

@ -58,7 +58,7 @@
- @versions.each do |version|
- if version
- contact = Contact.new(version.object.to_h)
- version.object_changes.to_h.each{|k,v| contact[k]=v.last}
- version.object_changes.to_h.each { |k,v| contact.public_send("#{k}=", v.last) }
%tr
%td= link_to(contact.name, admin_contact_version_path(version.id))

View file

@ -1,5 +1,5 @@
- contact = Contact.new(@version.object.to_h)
- @version.object_changes.to_h.each{|k,v| contact[k]=v.last}
- @version.object_changes.to_h.each { |k,v| contact.public_send("#{k}=", v.last ) }
= render 'shared/title', name: contact.name
.row