diff --git a/app/helpers/seed_filters_helper.rb b/app/helpers/seed_filters_helper.rb index 97caafb66..6607e3089 100644 --- a/app/helpers/seed_filters_helper.rb +++ b/app/helpers/seed_filters_helper.rb @@ -12,7 +12,6 @@ module SeedFiltersHelper # Pass `path` to look at someone else's seeds with the same filters. def seed_view_path(path: nil, **changes) kept = request.query_parameters.slice(*SEED_VIEW_PARAMS).merge(changes.stringify_keys).compact - kept.delete('page') path ||= request.path kept.empty? ? path : "#{path}?#{kept.to_query}" end @@ -23,8 +22,8 @@ module SeedFiltersHelper end # The source chips: a label and the params it sets, where nil takes a param - # off. Each kind of filter has its own param, so they combine: bought and - # heirloom, near me and planted. Clicking a chosen chip takes it off again. + # off. Each kind of filter has its own param, so they combine: catalogue + # and heirloom, near me and planted. Clicking a chosen chip takes it off again. def seed_source_chips [['All', { from: nil }], ['My own saving', { from: 'own' }], diff --git a/app/models/seed.rb b/app/models/seed.rb index fe9b65de3..09cc068dc 100644 --- a/app/models/seed.rb +++ b/app/models/seed.rb @@ -127,7 +127,7 @@ class Seed < ApplicationRecord scope :from_source, ->(kind) { where(source: SOURCES_BY_KIND.fetch(kind)) } scope :sown_in, ->(months) { where('seeds.sow_months && ARRAY[?]::integer[]', Array(months)) } scope :planted, -> { where(id: Planting.where.not(parent_seed_id: nil).select(:parent_seed_id)) } - scope :not_planted, -> { where.not(id: Planting.where.not(parent_seed_id: nil).select(:parent_seed_id)) } + scope :not_planted, -> { where.not(id: planted.select(:id)) } # Seeds of a crop and of its varieties: choosing tomato finds Brandywine # tomato seeds too.