X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7e5cbe87ed37f9cba8224fa4049047d7f981f66a..8665059a0cabe9395189f3a38df054320dfddd00:/app/models/diary_entry.rb?ds=sidebyside diff --git a/app/models/diary_entry.rb b/app/models/diary_entry.rb index e83dfb9ee..ad9659438 100644 --- a/app/models/diary_entry.rb +++ b/app/models/diary_entry.rb @@ -2,8 +2,8 @@ # # Table name: diary_entries # -# id :bigint(8) not null, primary key -# user_id :bigint(8) not null +# id :bigint not null, primary key +# user_id :bigint not null # title :string not null # body :text not null # created_at :datetime not null @@ -50,7 +50,7 @@ class DiaryEntry < ApplicationRecord after_save :spam_check def body - RichText.new(self[:body_format], self[:body]) + @body ||= RichText.new(self[:body_format], self[:body]) end private