Skip to content

Instantly share code, notes, and snippets.

@thedrow
Created July 31, 2016 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thedrow/0863823f347ff3a27229e8343482476c to your computer and use it in GitHub Desktop.
Save thedrow/0863823f347ff3a27229e8343482476c to your computer and use it in GitHub Desktop.
def clean_objects(relation)
return relation if relation.is_a? Class
without_dups = []
relation.each do |obj|
next if $exported[relation.class.name].include?(obj.id)
user_obfuscator(obj) if obj.is_a? User
product_images_sync(obj) if obj.is_a? Product
user_profile_image_sync(obj) if obj.is_a? Profile
$exported[relation.class.name] << obj.id
without_dups << obj
end
without_dups
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment