Closed hkdnet closed 1 year ago
require "panko_serializer" require "active_support" require "active_support/core_ext" require "active_record" class S1 < Panko::Serializer aliases({ created_at: :createdAt }) end class S2 < Panko::Serializer aliases({ created_at: :createdAt }) def created_at "2023-04-18T09:24:41+00:00" end end result1 = S1.new.serialize({ "created_at" => "2023-04-18T09:24:41+00:00" }) result2 = S2.new.serialize({}) p result1 p result2
S2's result should have createdAt instead of created_at because it has the alias.
createdAt
created_at
$ bundle exec ruby a.rb {"createdAt"=>"2023-04-18T09:24:41+00:00"} {"createdAt"=>"2023-04-18T09:24:41+00:00"}
created_at is used.
$ bundle exec ruby a.rb {"createdAt"=>"2023-04-18T09:24:41+00:00"} {"created_at"=>"2023-04-18T09:24:41+00:00"}
Looks like this issue isn't actual after https://github.com/panko-serializer/panko_serializer/pull/136
I forgot to close the original issue. Thanks!
Step to reproduce
Expected Behavior
S2's result should have
createdAt
instead ofcreated_at
because it has the alias.Actual Behavior
created_at
is used.