mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-30 18:58:39 -04:00
* 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>
36 lines
741 B
Ruby
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
|