Rubocop chokes on the following setup:
desc 'Clear the db data of development records'
task clear: :environment do
msg('Clearing the development database and rebuilding the default values')
'job,company'.split(/, ?/).each do |model|
# rubocop:disable all
eval("#{model.capitalize}.destroy_all")
# rubocop:enable all
end
end
As you can I skipped the eval section for now so I can use this rake task, but I wonder if there is a better way to achieve this. As we expand the app and add more models I wanted to save time by appending them to the list.