File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,10 @@ def self.serialization_adapter_instance
113
113
@serialization_adapter_instance ||= ActiveModelSerializers ::Adapter ::Attributes
114
114
end
115
115
116
+ def self . serialization_include_directive
117
+ @serialization_include_directive ||= { include : '*' }
118
+ end
119
+
116
120
attr_accessor :object , :root , :scope
117
121
118
122
# `scope_name` is set as :current_user by default in the controller.
@@ -166,7 +170,7 @@ def success?
166
170
# serializer.as_json(include: { posts: { include: { comments: { only: :body } }, only: :title } })
167
171
def serializable_hash ( adapter_opts = nil )
168
172
adapter_opts ||= { }
169
- adapter_opts = { include : '*' } . merge! ( adapter_opts )
173
+ adapter_opts = ActiveModel :: Serializer . serialization_include_directive . merge ( adapter_opts )
170
174
serialize ( adapter_opts )
171
175
end
172
176
alias to_hash serializable_hash
You can’t perform that action at this time.
0 commit comments