Skip to content

feat: infer singular actions based on route path parameters#47

Merged
vincentvanbush merged 9 commits intomainfrom
46-feature-infer-singular-actions-based-on-route-path-parameters
Jan 15, 2026
Merged

feat: infer singular actions based on route path parameters#47
vincentvanbush merged 9 commits intomainfrom
46-feature-infer-singular-actions-based-on-route-path-parameters

Conversation

@vincentvanbush
Copy link
Contributor

Pull Request

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • Test improvements
  • CI/CD improvements

Related Issues

Closes #46

Changes Made

  • Infer singular actions from route path parameters: if an ID-like parameter (id or uuid) is present, or it is a POST route, or it ends with a parameter path segment, the action is singular by default

Testing

Test Environment

  • Elixir version: latest
  • OTP version: latest
  • Phoenix version: latest
  • LiveView version: latest
  • Database (if applicable): latest Postgres

Test Cases

  • All existing tests pass
  • New tests added for new functionality at appropriate levels
  • [ x] Manual testing performed
  • Controller integration tests (if applicable)
  • LiveView integration tests (if applicable)
  • Router integration tests (if applicable)

Test Commands Run

# List the commands you ran to test
mix test
MIX_ENV=test mix credo
MIX_ENV=test mix dialyzer

Documentation

  • Updated README.md (if applicable)
  • Updated documentation comments (with examples for new features)
  • Updated CHANGELOG.md (if applicable)
  • Updated controller/LiveView usage examples (if applicable)

Code Quality

  • Code follows the existing style conventions
  • Self-review of the code has been performed
  • Code has been commented, particularly in hard-to-understand areas
  • No new linting warnings introduced
  • No new Dialyzer warnings introduced
  • Follows Phoenix and LiveView conventions

Phoenix/LiveView Specific

  • Controller changes properly handle conn state
  • LiveView changes properly handle socket state
  • Router integration works correctly
  • Error handling follows Phoenix patterns
  • Authorization flows work as expected

Backward Compatibility

  • This change is backward compatible
  • This change includes breaking changes (please describe below)
  • Migration guide provided for breaking changes

Breaking Changes

Performance Impact

  • No performance impact
  • Performance improvement
  • Potential performance regression (please describe)

Performance Notes

Security Considerations

  • No security impact
  • Security improvement
  • Potential security impact (please describe)

Additional Notes

Screenshots/Examples

Checklist

  • I have read the Contributing Guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Reviewer Notes


@vincentvanbush vincentvanbush linked an issue Jan 13, 2026 that may be closed by this pull request
3 tasks
end

@doc false
def skip_preload(opts) do
Copy link

Choose a reason for hiding this comment

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

nit: that's the same code as is defined https://github.com/curiosum-dev/permit_phoenix/pull/47/files#diff-9143256074a9d57c2ab996f40831c72b0fc7abc6b342f06a32a5561957f57dccR760 - maybe it could be extracted somewhere as a source of truth?

@vincentvanbush vincentvanbush merged commit 30793fd into main Jan 15, 2026
73 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.

[Feature]: Infer singular actions based on route path parameters

2 participants