Use pokemon for plant parts

This commit is contained in:
Brenda Wallace
2020-02-29 19:51:53 +13:00
parent c099580b70
commit f4acbaa89a
4 changed files with 6 additions and 17 deletions

View File

@@ -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)

View File

@@ -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,

View File

@@ -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

View File

@@ -4,6 +4,6 @@
FactoryBot.define do
factory :plant_part do
name { Faker::Lorem.unique.word }
name { Faker::Games::Pokemon.unique.name }
end
end