Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add serializer keyword argument as an alias for resource #408

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

youyoumu
Copy link

because we have Serializer alias here

Serializer = Resource

i thought it would be cool if we can alias serializer as keyword argument for resource 😄

class ApplicationSerializer
  include Alba::Serializer
end

class CustomerSerializer < ApplicationSerializer
  attributes :id, :name, :notes, :address, :contact, :updated_at
  has_many :invoices, serializer: InvoiceSerializer
  has_many :today_invoices, serializer: InvoiceSerializer
end

Copy link

codecov bot commented Jan 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.83%. Comparing base (d565832) to head (5f31610).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #408   +/-   ##
=======================================
  Coverage   99.83%   99.83%           
=======================================
  Files          14       14           
  Lines         600      601    +1     
  Branches      154      154           
=======================================
+ Hits          599      600    +1     
  Misses          1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant