Updated crm.rb edit code for db