active_model_serializers icon indicating copy to clipboard operation
active_model_serializers copied to clipboard

Getting null id

Open abhiroopABC opened this issue 7 months ago • 0 comments

When the user object is serialized I am getting id as null and rest all the data is correct. I am using active_model_serializers version 0.10.13

class UserSerializer < ActiveModelSerializers::Model attributes :id, :first_name, :last_name, :username end

Getting id as null when checking in the pry using object.id, but getting correct data using object[:id] . I am not sure what could be the reason and it is happening after upgrading rails 5.2 to 6.1. Another catch is, I am getting this error in a specific environment, other than local and stage. ruby version - 2.7.6

abhiroopABC avatar Apr 09 '25 12:04 abhiroopABC