Project

General

Profile

« Previous | Next » 

Revision e67fc0bd

Added by Joseph Magen about 10 years ago

fixes #2785 - host model clone method also copies relationships using deep_cloneable gem

View differences:

app/controllers/hosts_controller.rb
# Clone the host
def clone
@clone_host = @host
new = @host.dup
new.name = nil
new.mac = nil
new.ip = nil
@clone_host = @host.clone
@host = @clone_host
load_vars_for_ajax
flash[:warning] = _("The marked fields will need reviewing")
new.valid?
@host = new
@host.valid?
render :action => :new
end

Also available in: Unified diff