Sha256: 93f43ccc2b7733ce487f20d7e88a3b7fbb2d70bc8d10a8fb359c6e908ae26c52
Contents?: true
Size: 641 Bytes
Versions: 15
Compression:
Stored size: 641 Bytes
Contents
class E9Crm::ContactMergesController < E9Crm::BaseController before_filter :build_resources def create if @contact_a.update_attributes(params[:contact]) @contact_a.merge_and_destroy!(@contact_b) redirect_to @contact_a else render :new end end protected def build_resources @contact ||= Contact.new @contact_a ||= Contact.find(params[:contact_a_id]) # NOTE lets see if this works @contact_b ||= if params[:contact] Contact.new(params[:contact]) else Contact.find(params[:contact_b_id]) end end end
Version data entries
15 entries across 15 versions & 1 rubygems