Created
July 31, 2016 15:02
-
-
Save thedrow/0863823f347ff3a27229e8343482476c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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