Fix hidden attribute leaks in legacy post controller (#3237).

This commit is contained in:
evazion
2017-07-24 20:33:06 -05:00
parent f2bf756422
commit 67528ce5ab
4 changed files with 15 additions and 10 deletions

View File

@@ -1548,7 +1548,7 @@ class Post < ApplicationRecord
super(options)
end
def to_legacy_json
def legacy_attributes
hash = {
"has_comments" => last_commented_at.present?,
"parent_id" => parent_id,
@@ -1574,7 +1574,7 @@ class Post < ApplicationRecord
hash["md5"] = md5
end
hash.to_json
hash
end
def status