Skip to content

Fix dropping readonly fields from Change#1780

Open
kepi wants to merge 1 commit intonaymspace:developfrom
kepi:fix/drop-readonly-fields
Open

Fix dropping readonly fields from Change#1780
kepi wants to merge 1 commit intonaymspace:developfrom
kepi:fix/drop-readonly-fields

Conversation

@kepi
Copy link

@kepi kepi commented Jan 28, 2026

When experimenting with AshBackpex, I found out that :readonly fields aren't correctly dropped from a Change.

As I have :update action which accepts only some of fields, I need this working. Only alternative would be to omit read only fields from edit form which doesn't suit my use case.

I also added simple tests for this, but I don't really know how to test this correctly with existing tests structure. For now, I used dirty workaround and copied private drop_readonly_changes function directly to tests, just so I can test if it works.

But I think better (not ideal) way would be making the drop_readonly_changes non-private and add @doc false. Are you OK with that? Ideal would be probably to setup some "infrastructure" for LiveView and check whole process, but I'm not even sure where to begin with that.

When experimenting with AshBackpex, I found out that :readonly fields
aren't correctly dropped from a Change.

As I have :update action which accepts only some of fields, I need this
working. Only alternative would be to omit read only fields from edit
form which doesn't suit my use case.

I also added simple tests for this, but as there is currently no
LiveView test infrastructure, I used dirty workaround and copied private
drop_readonly_changes function directly to tests for now so I can see if
it works.
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