google-labs-jules[bot] 2e0c8a910d Memoize Planting-related methods for performance optimization
This commit introduces memoization to various methods in the Planting model,
PredictPlanting and PredictHarvest concerns, PlantingsHelper, and
PlantingsController.

Specifically:
- Memoized database-intensive lookups like `nearby_same_crop`, `first_harvest_date`,
  and `last_harvest_date`.
- Memoized calculated fields like `finish_predicted_at`, `expected_lifespan`,
  and `age_in_days`.
- Optimized `PlantingsHelper#transplantable_gardens_by_owner` using a hash
  to cache results per planting instance within a request.
- Applied the `defined?(@variable)` pattern where appropriate to ensure
  efficient handling of `nil` results.

These changes reduce redundant database queries and expensive calculations,
particularly during view rendering where these methods are frequently accessed.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
2026-04-28 03:07:18 +00:00
2026-04-26 13:09:00 +00:00
2026-04-27 17:19:31 +09:30
2026-03-01 05:21:20 +00:00
2026-04-26 03:07:31 +09:30
2026-04-27 07:26:19 +00:00

🌱 Growstuff

Build status

Welcome to the Growstuff project.

You can find our app at https://www.growstuff.org

Growstuff is an open source/open data project for food gardeners. We crowdsource information on what our members are growing and harvesting, aggregate it, and make it available as open data via our API.

Growstuff was founded in 2012 and has been built by dozens of contributors. We are an inclusive, welcoming project, and encourage participation from people of all backgrounds and skill levels.

Want to contribute?

Don't ask to ask, the best way to get started is to fork the project, start a codespace and get hacking. Dive on in and submit your PRs!

Vibe Coding is more than okay, just make sure you indicate if you have done so and ensure there are tests.

  • Issues (features we're working on, known bugs, etc)
  • Wiki (general documentation, etc.)

For coders

Growstuff is built in Ruby on Rails and also uses JavaScript for frontend features. We welcome contributions -- see CONTRIBUTING for details.

  • To set up your development environment, see Getting started.
  • You may also be interested in our API.

For Home Automation enthusiasts

https://github.com/Growstuff/homeassistant-growstuff/

For designers, writers, researchers, data wranglers, and other contributors

There are heaps of ways to get involved and contribute no matter what your skills and interests.

You might like to check out:

Here on Github, you might find these useful:

Feel free to comment on any of the issues on Github.

Contact

For more information about this project, contact info@growstuff.org.

Security Issues: If you find an authorization bypass or data breach, please contact our maintainers directly at maintainers@growstuff.org.

Description
No description provided
Readme 59 MiB
Languages
Ruby 76.4%
Haml 19.4%
SCSS 1.2%
HTML 1%
JavaScript 0.9%
Other 1.1%