# app/avo/resources/user.rb
class Avo::Resources::User < Avo::BaseResource
  def fields
    if params[:resource_name] == 'stores' || params[:via_resource_class] == 'Avo::Resources::Store'
      field :review,
        update_using: -> {
          # Update the review in the StorePatron join table
          patronship = record.patronships.find_by(user_id: record.id.to_i)
          patronship.update(review: value)
        },
        format_using: -> {
          record.patronships.find_by(user_id: record.id.to_i)&.review
        }
    end
  end
end
```

**Note:**
- The field will only render on the form if the model has a writer for it.
- You may need to adjust the logic for finding the join record depending on your association direction.

## Conditional Display Based on Parent Resource

You can use the `params` to control when the field is shown or editable. For example:

```ruby