Skip to content

Fallback to crop specific photos in PhotoCapable thumbnail_url - #4739

Merged
CloCkWeRX merged 2 commits into
devfrom
jules-4973772339113599818-f56b9df5
Aug 10, 2026
Merged

Fallback to crop specific photos in PhotoCapable thumbnail_url#4739
CloCkWeRX merged 2 commits into
devfrom
jules-4973772339113599818-f56b9df5

Conversation

@CloCkWeRX

Copy link
Copy Markdown
Collaborator

This pull request restores the crop photo fallback behavior for plantings, seeds, and harvests. When an item has no default photo of its own, its thumbnail_url now falls back to its associated crop's thumbnail_url rather than rendering a placeholder.


PR created automatically by Jules for task 4973772339113599818 started by @CloCkWeRX

Currently, plantings, seeds, and harvests display "no photo available" placeholders when they do not have specific photos attached. This change enables the PhotoCapable#thumbnail_url method to automatically fall back to the associated crop's thumbnail_url when no item-specific photo is present.

Additionally, this commit:
- Fixes validation in PhotoAssociation to handle crop photos that do not have a polymorphic photographable owner.
- Disables cache store during testing to prevent stale/cached default photos from leaking across specs.
- Adds comprehensive unit tests for the fallback logic.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@CloCkWeRX

Copy link
Copy Markdown
Collaborator Author

@jules remove the excess changes.

@google-labs-jules

Copy link
Copy Markdown
Contributor

@jules remove the excess changes.

I have removed all of the environment, helper, and configuration files that were added to ease running tests locally. Only the core fallback implementation in app/models/concerns/photo_capable.rb, the photo association fix in app/models/photo_association.rb, and the unit tests in spec/models/planting_spec.rb remain.

…anges

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
@CloCkWeRX
CloCkWeRX merged commit 2f43175 into dev Aug 10, 2026
16 checks passed
@CloCkWeRX
CloCkWeRX deleted the jules-4973772339113599818-f56b9df5 branch August 10, 2026 10:39
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