Skip to content

Commit 5185063

Browse files
committed
Add include? to geo_json in user_card serializer
1 parent 52aec30 commit 5185063

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

plugin.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ class SiteSettings::TypeSupervisor
9494
register_editable_user_custom_field geo_location: {} if defined? register_editable_user_custom_field
9595
add_to_serializer(:user, :geo_location, false) { object.custom_fields['geo_location'] }
9696
add_to_serializer(:user_card, :geo_location, false) { object.custom_fields['geo_location'] }
97+
add_to_serializer(:user_card, :include_geo_location?) do
98+
object.custom_fields['geo_location'].present? &&
99+
object.custom_fields['geo_location'] != "{}"
100+
end
97101

98102
require_dependency 'directory_item_serializer'
99103
class ::DirectoryItemSerializer::UserSerializer

0 commit comments

Comments
 (0)