commit 733504a7fcc9acda78468921fa63dbd3018c7653
parent b537e4cb4021aa1da2540c800c1274c5cb14dc55
Author: Ryan Jeffrey <ryan@ryanmj.xyz>
Date: Mon, 21 Feb 2022 22:51:54 -0800
Save changes
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/config/application.rb b/config/application.rb
@@ -51,11 +51,13 @@ def update_org_db(file_path)
dir_name = dir_name == '.' ? '' : dir_name
url = CGI.escape(File.basename(file_path, '.*'))
# Get the post.
- post = Post.find_by(url: url, where: where)
+ post = Post.find_by(url: url, where: dir_name)
return if not post
# Reset content and title.
+ puts "Setting the post"
post.body = Orgmode::Parser.new(File.read(file_path)).to_html
post.title = title
+ post.save
# TODO add more rescues for different errors
end