Created
May 24, 2017 01:03
-
-
Save equivalentideas/39585f72451a542fe11e646769cf5933 to your computer and use it in GitHub Desktop.
Command to create markdown file of visible comments on a planning application in PlanningAlerts
This file contains hidden or 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
# Run these commands on the production Rails console | |
# This creates a markdown file with the comments in the format: | |
# | |
# From: Luke Bacon | |
# Date of Submission: 6 April 2017 | |
# | |
# Comment text bla bla bla | |
# | |
# * * * | |
# | |
app_number = 793257 | |
File.open("application_#{app_number}_comments.md", "w") {|file| Application.find(app_number).comments.visible.each {|c| file.puts "From: #{c.name}\nDate of Submission: #{c.confirmed_at.strftime('%e %B %Y').strip}\n\n#{c.text}\n\n* * *\n\n"} } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment