Im new to ruby, wrote this code and works but i know is not the most elegant way to do it, can you please help me to refactor it in the ruby way¡
#Ckeck that is not a repetead user
next if Profile.exists?(:screen_name => t.from_user)
next if SearchResults.exists?(:username => t.from_user)
next if usernames.include? t.from_user
I think your method is fine but personally, I would do something like this (with the info provided) …
Use
rejectto limit your collection to the desired elements.