Fix include_root_in_json misuse
since it is no longer exposed for instances, our post_presenter failed hard.
This commit is contained in:
parent
72fe5a79c2
commit
ad20bb052c
3 changed files with 5 additions and 1 deletions
|
|
@ -1,5 +1,8 @@
|
||||||
# 0.5.6.3
|
# 0.5.6.3
|
||||||
|
|
||||||
|
Fix evil regression caused by Active Model no longer exposing
|
||||||
|
`include_root_in_json` in instances.
|
||||||
|
|
||||||
# 0.5.6.2
|
# 0.5.6.2
|
||||||
|
|
||||||
* Fix [CVE-2016-0751](https://groups.google.com/forum/#!topic/rubyonrails-security/9oLY_FCzvoc) - Possible Object Leak and Denial of Service attack in Action Pack
|
* Fix [CVE-2016-0751](https://groups.google.com/forum/#!topic/rubyonrails-security/9oLY_FCzvoc) - Possible Object Leak and Denial of Service attack in Action Pack
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
# the COPYRIGHT file.
|
# the COPYRIGHT file.
|
||||||
|
|
||||||
class Post < ActiveRecord::Base
|
class Post < ActiveRecord::Base
|
||||||
|
self.include_root_in_json = false
|
||||||
|
|
||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
|
|
||||||
include Diaspora::Federated::Shareable
|
include Diaspora::Federated::Shareable
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ class PostPresenter < BasePresenter
|
||||||
end
|
end
|
||||||
|
|
||||||
def as_json(_options={})
|
def as_json(_options={})
|
||||||
@post.include_root_in_json = false
|
|
||||||
@post.as_json(only: directly_retrieved_attributes).merge(non_directly_retrieved_attributes)
|
@post.as_json(only: directly_retrieved_attributes).merge(non_directly_retrieved_attributes)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue