# app/avo/resources/user.rb
class Avo::Resources::User < Avo::BaseResource
  def fields
    # Only show when accessed from the Store resource
    if params[:resource_name] == 'stores' || params[:via_resource_class] == 'Avo::Resources::Store'
      field :review,
        format_using: -> {
          # Fetch the review from the StorePatron join table
          record.patronships.find_by(user_id: record.id.to_i)&.review
        }
    end
  end
end
```

## Gotchas & Tips

- Computed fields (using a block) do not render on forms. Use `format_using` and provide a writer on the model.
- Avo checks for a writer method to decide if a field is editable.
- If the form fails to save, your join field may revert to its original value — consider validations and persistence carefully.

---