Include ugoira data in post JSON API.
This commit is contained in:
@@ -1229,8 +1229,14 @@ class Post < ActiveRecord::Base
|
|||||||
list
|
list
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def associated_attributes
|
||||||
|
[ :pixiv_ugoira_frame_data ]
|
||||||
|
end
|
||||||
|
|
||||||
def serializable_hash(options = {})
|
def serializable_hash(options = {})
|
||||||
options ||= {}
|
options ||= {}
|
||||||
|
options[:include] ||= []
|
||||||
|
options[:include] += associated_attributes
|
||||||
options[:except] ||= []
|
options[:except] ||= []
|
||||||
options[:except] += hidden_attributes
|
options[:except] += hidden_attributes
|
||||||
unless options[:builder]
|
unless options[:builder]
|
||||||
|
|||||||
Reference in New Issue
Block a user