Commit Graph
56 Commits
Author SHA1 Message Date
Brenda Wallace 977a984c24 Remove Elasticsearch integration and related code
- Deleted Elasticsearch gems from Gemfile and Gemfile.lock.
- Updated README and TECH documentation to reflect the removal of Elasticsearch.
- Removed Elasticsearch-related code from models, controllers, services, and factories.
- Adjusted tests to eliminate dependencies on Elasticsearch.
- Cleaned up Docker configuration and environment variables related to Elasticsearch.
- Added a TODO file for future gem reviews and potential removals.
2026-10-22 15:37:03 +13:00
Brenda WallaceandClaude Sonnet 5 27f4282f5b Let plantings use a crop's alternate name
A planting can now choose one of its crop's alternate names (eg. "lauki"
for calabash, "aubergine" for eggplant) and shows it instead of the
crop's primary name.

- plantings.alternate_name_id, validated to belong to the planting's crop
- Planting#display_name, used on cards, the planting page, garden lists,
  the member page, the homepage and the RSS/ICS feeds
- planting form offers the crop's alternate names, preselecting the one
  that was searched for
- crop autosuggest shows the matched alternate name, eg.
  "aubergine (eggplant)", via matched_alternate_name in the search JSON

Part of #554

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-21 21:28:46 +12:00
Daniel O'Connorandgoogle-labs-jules[bot] b6270c8d0c Add pagination to crops#data_improvement (#4807)
In `CropsController#data_improvement`, paginate `@crops` with
`per_page: 50` so tabs like photos/descriptions do not render all
crops at once. In `data_improvement.html.haml`, render `= will_paginate @crops`.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-09-20 15:04:14 +09:30
eb427f00de Optimize PaperTrail whodunnit query in CropsController#show (#4796)
* Optimize PaperTrail whodunnit query in CropsController#show

Replace @crop.versions.map(&:whodunnit) with
@crop.versions.distinct.pluck(:whodunnit) to avoid instantiating all PaperTrail version objects and loading object/object_changes into memory.

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

* Optimize PaperTrail whodunnit query in CropsController#show

Replace @crop.versions.map(&:whodunnit) with
@crop.versions.distinct.pluck(:whodunnit) to avoid instantiating all PaperTrail version objects and loading object/object_changes into memory. Added unit test in spec/controllers/crops_controller_spec.rb.

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

* Optimize PaperTrail whodunnit query in CropsController#show

Use @crop.versions.reorder(nil).distinct.pluck(:whodunnit) to avoid instantiating all PaperTrail version objects into memory and prevent PostgreSQL PG::InvalidColumnReference errors with SELECT DISTINCT.

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

* Fix crop route parameter in controller spec

Update parameter key from id to slug in CropsController show spec to match param: :slug route definition.

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

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-09-20 13:53:58 +09:30
Daniel O'Connor 1f6f3c4dfd Merge pull request #4612 from Growstuff/fix-crops-csv-export-11894001552728801282
Fix ArgumentError in Crops CSV export
2026-05-02 15:31:10 +09:30
Daniel O'Connor f1acb35520 Merge pull request #4537 from Growstuff/FactoryBot/SyntaxMethods
Rubocop: FactoryBot/SyntaxMethods
2026-04-23 22:29:24 +09:30
Daniel O'Connor 474f09e110 Merge pull request #4332 from Growstuff/crops-controller
Add coverage for crops
2025-11-29 15:32:08 +10:30
google-labs-jules[bot] bc11a1b8db Merge pull request #4209 from Growstuff/extend-crop-model
Extend Crop Model and Migrate Data from OpenFarm
2025-09-07 20:03:18 +09:30
Daniel O'Connor 81060cccf7 Ruby 3.2: Rubocop - Lint/* and Style/* (#3786)
* Rubocop - Layout/*
* Rubocop - Lint and Style
2024-07-13 15:38:37 +09:30
Daniel O'Connor e69467f056 Ruby 3.2: Rubocop - RSpec/excessive docstring spacing (#3782)
* RSpec/ExcessiveDocstringSpacing
2024-07-13 15:12:56 +09:30
Daniel O'Connor d1f754a288 Rubocop 2022-11-08 00:23:38 +10:30
Daniel O'Connor 2db3d1bacc Various corrections 2022-11-08 00:21:23 +10:30
Brenda Wallace 43a577fa50 Update rubocop config 2021-01-05 19:46:07 +13:00
Brenda Wallace 0108224e4e Tests for crop creation 2020-08-26 12:36:58 +12:00
Brenda Wallace bcc722d0c2 Updating content type in tests to include charset 2020-08-26 12:36:58 +12:00
Brenda Wallace f1d830bfa9 fixed ambiguous negative 2020-08-26 12:36:58 +12:00
Brenda 7257b2ada1 Update with frozen literals 2020-01-10 16:50:52 +13:00
Brenda Wallace 7c38f7eca6 Pull homepage data directly from elasticsearch (#2316)
* Pull homepage data directly from elasticsearch

* Removing non-elasticsearch options

* [CodeFactor] Apply fixes to commit c46b2e7
2019-12-09 10:03:48 +13:00
Brenda Wallace 8faa712e07 be_success -> be_successfull
fixes a deprecation warning
2019-06-27 22:26:15 +12:00
Awesome Code 78c8fdb743 Auto corrected by following Lint Ruby RSpec/AlignLeftLetBrace 2019-04-20 09:44:42 +00:00
Brenda Wallace 026efe5d15 Rubocop lint 2019-04-13 09:50:49 +12:00
Brenda Wallace 526450f0eb Added search controller specs 2019-04-13 09:42:13 +12:00
Awesome Code 24fb818b2b Auto corrected by following Lint Ruby RSpecEmptyLine 2019-03-19 07:22:50 +00:00
Awesome Code 2a12d8966e Auto corrected by following Lint Ruby EmptyLine 2019-03-14 23:17:55 +13:00
Awesome Code 5ca65840a8 Auto corrected by following Lint Ruby RSpec/LeadingSubject 2019-03-14 10:08:50 +00:00
Awesome Code cb9d05e355 Auto corrected by following Lint Ruby RSpec/ExpectChange 2019-03-13 16:51:13 +13:00
Awesome Code 3bc1bba448 Auto corrected by following Lint Ruby RSpecEmptyLine 2019-03-12 22:51:12 +00:00
Brenda Wallace d3a542727c Fixing crop deleting and adding tests 2019-02-15 08:45:18 +13:00
Brenda Wallace 7b01fcbd4b Align all the hashes 2018-12-30 15:22:29 +13:00
Awesome Code 90f4db4853 Auto corrected by following Ruby rspec layout 2018-09-10 22:20:12 +00:00
Brenda Wallace 65b4c7dbc1 Revert "Auto corrected by following Style/StringLiterals"
This reverts commit ab56a3c6b3.
2018-02-09 07:58:47 +13:00
Awesome Code ab56a3c6b3 Auto corrected by following Style/StringLiterals 2018-02-07 10:20:26 +13:00
Brenda Wallace 16ad5384d1 Moved gardens chart to dedicated controller 2018-01-23 09:00:34 +13:00
Brenda Wallace 9db4736229 Permissions (and specs) for charts json 2018-01-23 09:00:34 +13:00
Brenda Wallace 8d0bec34a6 Crops controller spec, use let, other cleanup 2017-11-29 20:59:37 +13:00
milesgould d8bf8ae4df De-deprecate controller and view specs
We deprecated controller and view specs on the grounds that they were
brittle, and were a poorer measure of user experience than feature
specs. However, feature specs have their own problems: they're much
slower to run, and flakier (see #901). We also ran into a few cases
where feature specs erroneously passed because they were checking for
the presence of a string that occurred in the error page!

Hence, we're cautiously un-deprecating controller and view specs.

Fixes #1132
2017-11-17 16:51:24 +00:00
Brenda Wallace 62e7c716dd Removed extra empty blank lines 2016-11-26 12:06:02 +13:00
Brenda Wallace bdb057ca0f Removed all trailing white space 2016-11-14 15:05:32 +13:00
Daniel O'Connor 4b4e0cf69a $ rubocop --only HashSyntax --auto-correct
483 files inspected, 2018 offenses detected, 2018 offenses corrected
2016-05-19 15:53:11 -04:00
Taylor Griffin 95974ab21b add deprecation not to all controller and view specs 2015-02-12 19:52:53 +11:00
Taylor Griffin 2f67ffd2f8 fix regressions 2015-02-02 00:01:49 +11:00
Taylor Griffin 7fc886f43c implement custom Sweeper class as stop gap against errors when running specs 2014-11-16 12:01:27 +11:00
Marlena Compton ec25f2ab91 created list of crop wranglers on the crop wranglers page 2014-08-21 20:11:10 -07:00
Skud 0a3ecdc5ad Added crop search controller and views 2014-01-03 22:29:44 +11:00
Miles Gould 9c5b6f6192 Rename Crop.system_name to Crop.name 2013-10-18 11:52:05 +01:00
Skud 772eec77a7 added routes and controller stuff for crop hierarchy 2013-09-02 11:13:02 +10:00
Skud 8f7becfa78 added a basic crop wrangler homepage 2013-08-21 21:24:22 +10:00
Skud 923f01cd72 cleaned up boring controller tests 2013-07-08 13:24:26 +10:00
Craig Read d563f0ceae Converting crops RSS to HAML
Added spec for crops RSS

Removed redundant @new_crops instance variable (not needed as we now
have pagination).
2013-05-24 12:22:41 +10:00
Skud 536cf21e3e make it easier to wrangle scientific names 2013-05-09 11:39:22 +10:00