Files
growstuff/spec/factories/seeds.rb
T
6e7cf1c813 Refactor Seeds to remove Elasticsearch dependency (#4684)
* Refactor Seeds to remove Elasticsearch dependency

This commit refactors the `SeedsController` and `Seed` model to remove
dependency on Elasticsearch and Searchkick.

Key changes:
- Removed `SearchSeeds` concern from the `Seed` model.
- Reimplemented `Seed.homepage_records` using ActiveRecord.
- Refactored `SeedsController#index` to use ActiveRecord for filtering,
  eager loading, and pagination.
- Deleted `app/models/concerns/search_seeds.rb`.
- Updated relevant specs to remove Searchkick-specific tags and setup.

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

* Remove Seed.reindex

* Remove trait

* Fix tests

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-06-24 21:54:43 +09:30

36 lines
741 B
Ruby

# frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_bot
FactoryBot.define do
factory :seed do
owner
crop
description { "MyText" }
quantity { 1 }
plant_before { "2013-07-15" }
tradable_to { 'nowhere' }
organic { 'unknown' }
gmo { 'unknown' }
heirloom { 'unknown' }
days_until_maturity_min { nil }
days_until_maturity_max { nil }
finished_at { nil }
factory :finished_seed do
finished { true }
finished_at { Date.new }
end
factory :tradable_seed do
tradable_to { "locally" }
finished { false }
finished_at { nil }
end
factory :untradable_seed do
tradable_to { "nowhere" }
end
end
end