I'm new to rails and I haven't been able to find a definitive answer to this question.
Let's say I have
Project.create!([{title: "foo", description: "bar"}])
in my seeds.rb file and then run
$rake db:seed
twice. Would there be two near-identical entries in the database or would it override the initial entry?
It will duplicate.
If you want to run multiple times, but prevent duplication. I guess you could:
validate_uniqueness_of :key_attribute
Test the count of your table like:
MyClass.create if MyClass.count == 0
Better solution might be to use find_or_create_by
method. See the docs: http://easyactiverecord.com/blog/2014/03/24/using-find-or-create-with-multiple-attributes/