mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-02-26 03:36:17 -05:00
Use pokemon for plant parts
This commit is contained in:
@@ -31,18 +31,6 @@ module ButtonsHelper
|
||||
data: { confirm: 'All plantings associated with this garden will be marked as finished. Are you sure?' }
|
||||
end
|
||||
|
||||
def crop_plant_button(crop)
|
||||
create_button(Planting,
|
||||
new_planting_path(params: { crop_id: crop.id }),
|
||||
planting_icon, t('buttons.plant'))
|
||||
end
|
||||
|
||||
def crop_save_seeds_button(crop)
|
||||
create_button(Seed,
|
||||
new_seed_path(params: { crop_id: crop.id }),
|
||||
seed_icon, t('buttons.save_seeds'))
|
||||
end
|
||||
|
||||
def create_button(model_to_create, path, icon, label)
|
||||
return unless can?(:create, model_to_create)
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ module SearchPlantings
|
||||
percentage_grown: percentage_grown.to_i,
|
||||
planted_at: planted_at,
|
||||
planted_from: planted_from,
|
||||
planted_year: planted_at.year,
|
||||
planted_year: planted_at&.year,
|
||||
quantity: quantity,
|
||||
sunniness: sunniness,
|
||||
garden_id: garden_id,
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
namespace :search do
|
||||
desc 'reindex'
|
||||
task reindex: :environment do
|
||||
Crop.all.each_slice(50) do |batch|
|
||||
Crop.searchkick_index.import(batch)
|
||||
end
|
||||
Crop.reindex
|
||||
Planting.reindex
|
||||
Harvest.reindex
|
||||
Seed.reindex
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
|
||||
FactoryBot.define do
|
||||
factory :plant_part do
|
||||
name { Faker::Lorem.unique.word }
|
||||
name { Faker::Games::Pokemon.unique.name }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user