Skip to content

Instantly share code, notes, and snippets.

@roadev
Last active September 14, 2018 16:33
Show Gist options
  • Save roadev/2fbeca548f47771767bc94a465128458 to your computer and use it in GitHub Desktop.
Save roadev/2fbeca548f47771767bc94a465128458 to your computer and use it in GitHub Desktop.
CSV.open("file.csv", "wb") do |csv|
csv << ["Name", "Phone"]
people = Person.by_role("assistant").by_gender("f").by_days("vs")
people.each do |p|
p.phone[5..9] = "xxxxx"
csv << [p.name, p.phone]
end
people = Person.by_role("assistant").by_gender("f").by_days("s")
people.each do |p|
csv << [p.name, p.phone]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment