Skip to content

[Fix] helpers are now available in NestedAttribute#503

Draft
okuramasafumi wants to merge 1 commit intomainfrom
fix-helper-in-nested-attributes
Draft

[Fix] helpers are now available in NestedAttribute#503
okuramasafumi wants to merge 1 commit intomainfrom
fix-helper-in-nested-attributes

Conversation

@okuramasafumi
Copy link
Copy Markdown
Owner

Fix #495

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 10, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fd8698d6-43fe-4cb4-ac43-017664a2f400

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-helper-in-nested-attributes

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 10, 2026

Codecov Report

❌ Patch coverage is 25.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.87%. Comparing base (6bac359) to head (6219193).

Files with missing lines Patch % Lines
lib/alba/resource.rb 25.00% 3 Missing ⚠️
lib/alba/nested_attribute.rb 33.33% 2 Missing ⚠️
lib/alba/association.rb 0.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (6bac359) and HEAD (6219193). Click for more details.

HEAD has 23 uploads less than BASE
Flag BASE (6bac359) HEAD (6219193)
69 46
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #503       +/-   ##
===========================================
- Coverage   97.73%   46.87%   -50.86%     
===========================================
  Files          14       13        -1     
  Lines         661      640       -21     
  Branches      177      174        -3     
===========================================
- Hits          646      300      -346     
- Misses         15      340      +325     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@pgiblock pgiblock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the issue I was experiencing. The code does not run for me (Ruby 3.4.8, Rails 8.1).

Comment thread lib/alba/association.rb
def assign_resource(nesting, key_transformation, block, helper)
@resource = if block
charged_resource_class(helper, key_transformation, block)
Alba.resource_class(helper: helper, key_transformation: key_transformation, &block)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails for me. I get:

wrong number of arguments (given 1, expected 0)

Alba.rb defines the method (with no arguments) as:

def resource_class(&block)

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.

Nested Attributes blocks don't include class-level methods of the parent Resource

2 participants