File tree 1 file changed +4
-4
lines changed
lib/active_model/serializer/adapter 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -176,13 +176,13 @@ def relationship_value_for(serializer, options = {})
176
176
end
177
177
end
178
178
179
- def relationship_links_for ( name , serializer , options = { } )
179
+ def relationship_links_for ( name , owner , options = { } )
180
180
if options [ :links ] == true
181
- { related : url_helper . url_for ( [ serializer . object , name ] ) }
181
+ { related : url_helper . url_for ( [ owner , name ] ) }
182
182
else
183
183
options [ :links ] . inject ( { } ) do |hash , ( key , link ) |
184
184
hash [ key ] = if link . is_a? Proc
185
- link . call ( serializer . object , name )
185
+ link . call ( owner , name )
186
186
else
187
187
link
188
188
end
@@ -201,7 +201,7 @@ def relationships_for(serializer)
201
201
end
202
202
203
203
if association . options . fetch ( :links , false )
204
- hash [ association . key ] [ :links ] = relationship_links_for ( association . name , serializer , association . options )
204
+ hash [ association . key ] [ :links ] = relationship_links_for ( association . name , serializer . object , association . options )
205
205
end
206
206
end
207
207
end
You can’t perform that action at this time.
0 commit comments