This repository has been archived by the owner on Dec 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Frank Groeneveld
committed
Aug 21, 2015
1 parent
0b71d5e
commit d9a2982
Showing
3 changed files
with
4 additions
and
17 deletions.
There are no files selected for viewing
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
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
15 changes: 1 addition & 14 deletions
15
db/migrate/20140627142428_replace_signatures_markdown_with_tinyce.rb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,6 @@ | ||
class ReplaceSignaturesMarkdownWithTinyce < ActiveRecord::Migration | ||
|
||
def change | ||
markdown = Redcarpet::Markdown.new Redcarpet::Render::HTML | ||
User.all.each do |user| | ||
if user.signature.present? | ||
user.signature = markdown.render(user.signature).html_safe | ||
user.save! | ||
end | ||
end | ||
|
||
Ticket.all.each do |ticket| | ||
if ticket.content.present? | ||
ticket.content = markdown.render(ticket.content).html_safe | ||
ticket.save! | ||
end | ||
end | ||
# this migration has been removed in order for the gems to be removed | ||
end | ||
end |