Releases: yosiat/panko_serializer
Releases · yosiat/panko_serializer
v0.6.0
v0.5.10
v0.5.9
v0.5.8
v0.5.7
v0.5.6
v0.5.3
Changes
this version includes changes from 0.5.0 to 0.5.3
- Serialize json dates correctly - Until 0.5.3 we serialized dates as ISO8601 with milliseconds since this version we will serialize milliseconds as well. example: we serialized
2017-03-04T12:45:23Z
instead of2017-03-04T12:45:23.000Z
- Handling concurrent use of the same serializer - Panko re-uses serializers for has-one/has-many associations between runs - which can cause a bug in concurrent serialization
- Deeply nesting
context
andscope
- passingMySerializer.new(user, scope: current_user)
will pass the scope to all nested associations. (same ascontext
) - Code cleanups
v0.4.4
Changes
- Rubocop fixes to all code
- Panko::Response enchantments - handling array and nice "DSL"
Panko::Response.create
Panko::Response
is a nice utility, but building nested objects with JSON values can be really ugly and fast.
Let's take this example (from specs):
Panko::Response.new([
data: Panko::Response.new(
json_data: Panko::JsonValue.from({ a: 1 }.to_json),
foos: Panko::ArraySerializer.new(Foo.all, each_serializer: FooSerializer),
foo: Panko::JsonValue.from(FooSerializer.new.serialize_to_json(Foo.first)),
)
])
Will be changed to:
Panko::Response.create do |t|
[
{
data: t.value(
json_data: t.json({ a: 1 }.to_json),
foos: t.array_serializer(Foo.all, FooSerializer),
foo: t.serializer(Foo.first, FooSerializer)
)
}
]
end