I'm new to studying ruby and have created two arrays. I'm trying to compare each element of array 1 with array 2 and print the ones that don't exist in array 1 and what doesn't exist in array 2.
**#localarraydb**
bdlocal = CTrunk.find_by_sql('select phone_number from phones_trunks;')
connect = PG.connect(:hostaddr => @servers[0], :port => 5432, :dbname => "mydb", :user => "myuser", :connect_timeout => 90)
getdata = connect.exec("select name,active,phone_number from phones_trunks;")
array = []
getdata.each do |re|
array << re.values[2]
puts array
end
**#Local Array DB retrive each item from db**
bdlocal.each do |compare|
puts "Server 11:#{array[2]}\n Server Local:#{compare.phone_number}"
if compare == getdata then
puts "equals"
else
puts "different #{here show diferrence"
end
end