mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 09:21:43 +02:00
Write a test that covers missing and non-existent values
This commit is contained in:
parent
7e4aea6991
commit
b0bec41f56
3 changed files with 72 additions and 2 deletions
|
@ -56,7 +56,10 @@
|
|||
- @versions.each do |version|
|
||||
- if version
|
||||
- domain = Domain.new(version.object.to_h)
|
||||
- version.object_changes.to_h.each{|k,v| domain.public_send("#{k}=", v.last) }
|
||||
- version.object_changes.to_h.each do |k, v|
|
||||
- method_name = "#{k}=".to_sym
|
||||
- if domain.respond_to?(method_name)
|
||||
- domain.public_send("#{k}=", v.last)
|
||||
|
||||
%tr
|
||||
%td= link_to(domain.name, admin_domain_version_path(version.id))
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
- domain = Domain.new(@version.object.to_h)
|
||||
- @version.object_changes.to_h.each{|k,v| domain.public_send("#{k}=", v.last) }
|
||||
- @version.object_changes.to_h.each do |k, v|
|
||||
- method_name = "#{k}=".to_sym
|
||||
- if domain.respond_to?(method_name)
|
||||
- domain.public_send("#{k}=", v.last)
|
||||
|
||||
- if @version
|
||||
- children = HashWithIndifferentAccess.new(@version.children)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue