Skip to content

Adding for_collection to the BaseSerializer.#884

Merged
jwoertink merged 3 commits intoluckyframework:mainfrom
russ:issues/866-for-collection-pagination-serializer
Jun 27, 2025
Merged

Adding for_collection to the BaseSerializer.#884
jwoertink merged 3 commits intoluckyframework:mainfrom
russ:issues/866-for-collection-pagination-serializer

Conversation

@russ
Copy link
Copy Markdown
Contributor

@russ russ commented Jun 6, 2025

Fixes #866

This for_collection override takes a Lucky::Paginator argument as an option and changes the output to have extra pagination data added in.

This for_collection override takes a Lucky::Paginator argument as an
option and changes the output to have extra pagination data added in.
@jwoertink
Copy link
Copy Markdown
Member

Nice! Looks good. It's just missing the part that actually adds this to the generated app.

src_dir.add_folder("serializers") do |serializers_dir|
serializers_dir.add_file(".keep")
serializers_dir.add_file("base_serializer.cr") do |io|
ECR.embed("#{__DIR__}/../web_app_skeleton/src/serializers/base_serializer.cr.ecr", io)
end

@russ
Copy link
Copy Markdown
Contributor Author

russ commented Jun 6, 2025

Oops. That would make sense wouldn't it. lol

@jwoertink
Copy link
Copy Markdown
Member

For this, you may need to run earthly +update-snapshot locally. I think that should update the fixtures and set all of this

@jwoertink jwoertink merged commit 3c29ba9 into luckyframework:main Jun 27, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New for_collection method on Serializers that is pagination aware

2 participants