mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Add key option to serializer associations
This commit is contained in:
@@ -220,8 +220,9 @@ module ActiveModel
|
||||
association_options[:association_options][:virtual_value] = association_value
|
||||
end
|
||||
|
||||
association_key = association_options[:association_options][:key] || name
|
||||
if block_given?
|
||||
block.call(name, serializer, association_options[:association_options])
|
||||
block.call(association_key, serializer, association_options[:association_options])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user