In my seed.rb
puts 'DEFAULT Categories'
categories = Category.create([{name:'cat1'},{name:'cat2'}, {name: 'cat3'} ])
if categories.save
puts "categories saved"
else
puts "categories save failed"
end
I use this to set the default categories
but the problem is that I can't if categories.save
to see if all category item get saved and hence the seed.rb get passed
So, how can I see if an array get saved? (All of its elements)
Thanks