Another try at getting the youtube titles in
This commit is contained in:
parent
597a7a8a03
commit
f2a27ea970
1 changed files with 16 additions and 2 deletions
|
|
@ -85,7 +85,14 @@ module DataConversion
|
||||||
|
|
||||||
def comments_json_to_csv model_hash
|
def comments_json_to_csv model_hash
|
||||||
generic_json_to_csv(model_hash) do |hash|
|
generic_json_to_csv(model_hash) do |hash|
|
||||||
model_hash[:mongo_attrs].map { |attr_name| hash[attr_name] }
|
model_hash[:mongo_attrs].map { |attr_name|
|
||||||
|
attr_val = hash[attr_name]
|
||||||
|
if (attr_name == "youtube_titles" && attr_val && !attr_val.empty?)
|
||||||
|
attr_val.to_yaml
|
||||||
|
else
|
||||||
|
attr_val
|
||||||
|
end
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -155,7 +162,14 @@ module DataConversion
|
||||||
|
|
||||||
def posts_json_to_csv model_hash
|
def posts_json_to_csv model_hash
|
||||||
generic_json_to_csv(model_hash) do |hash|
|
generic_json_to_csv(model_hash) do |hash|
|
||||||
model_hash[:mongo_attrs].map { |attr_name| hash[attr_name] }
|
model_hash[:mongo_attrs].map { |attr_name|
|
||||||
|
attr_val = hash[attr_name]
|
||||||
|
if (attr_name == "youtube_titles" && attr_val && !attr_val.empty?)
|
||||||
|
attr_val.to_yaml
|
||||||
|
else
|
||||||
|
attr_val
|
||||||
|
end
|
||||||
|
}
|
||||||
end
|
end
|
||||||
#has to handle the polymorphic stuff
|
#has to handle the polymorphic stuff
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue