Merge pull request #297 from Skud/cropbot-over-enthusiasm

reined in over-enthusiastic rake task
This commit is contained in:
pozorvlak
2013-08-27 08:07:36 -07:00
2 changed files with 11 additions and 9 deletions

View File

@@ -138,12 +138,16 @@ namespace :growstuff do
cropbot.account.account_type = AccountType.find_by_name("Staff") # set this just because it's nice
cropbot.account.save
Crop.find_each do |crop|
crop.creator = cropbot
crop.save
unless crop.creator
crop.creator = cropbot
crop.save
end
end
ScientificName.find_each do |sn|
sn.creator = cropbot
sn.save
unless sn.creator
sn.creator = cropbot
sn.save
end
end
end

View File

@@ -6,8 +6,6 @@
# when it was added. This will help us know which ones have been run
# and can safely be commented out or removed.
echo "2013-08-18 - reset crop planting counts"
rake growstuff:oneoff:reset_crop_plantings_count
echo "2013-08-21 - set default crop creator"
rake growstuff:oneoff:set_default_crop_creator
# Default format is:
# echo "YYYY-MM-DD - do something or other"
# rake growstuff:oneoff:something