json - Rails active_model_serializer applied on grouped active record -
i using active_model_serializer https://github.com/rails-api/active_model_serializers , want apply serialisation of model grouped active records.
i have model represents blogpost title, content , published date. use serializer format date more user friendly format during serialisation. works if applied on active records, firstly want group blogpost records :published , :unpublished so
posts.group_by |post| if post.published_at.nil? :unpublished else :published end end
if render json output of grouped data, serializer not applied on blogpost objects , data gets returned is.
does know way how apply serializer on grouped (grouped_by) active records?
Comments
Post a Comment