I have added custom field in user model but when I tried to fetch in current user object I did not get the custom field. how can I fetch the custom field?
I tried below code
require_dependency 'user_serializer'
class ::UserSerializer
attributes :custom_thumbnail_style_dropdown
def custom_thumbnail_style_dropdown
object.custom_fields[custom_thumbnail_style_dropdown]
end
end
even I tried object.custom_thumbnail_style_dropdown in the defination but it didnt’ work.
Also tried below code
add_to_serializer(:user, :custom_thumbnail_style_dropdown, false) do
object.custom_thumbnail_style_dropdown
end