Using sqlite3, whenever I call the rake task multiple times, everything works.
Using postgresql, first time works like a charm (asuming I just migrated the database) but the second+ times it fails. When looking at
A.all.to_a (using Rails 4)
B.all.to_a
I have data for both models but each record in b has an invalid id for a_id and associations are lost (ie. I cannot do a.bs)
obvious here a, b are places holders.
This seems to happen with postgresql and not sqlite3. Getting the same error on heroku (uses postresql) and in local machine
Hello,
I have a rake task that looks like this:
namespace :db do desc "Erase and fill database" task :populate => :environment do
end#namespace
Using sqlite3, whenever I call the rake task multiple times, everything works. Using postgresql, first time works like a charm (asuming I just migrated the database) but the second+ times it fails. When looking at A.all.to_a (using Rails 4) B.all.to_a
I have data for both models but each record in b has an invalid id for a_id and associations are lost (ie. I cannot do a.bs)
obvious here a, b are places holders.
This seems to happen with postgresql and not sqlite3. Getting the same error on heroku (uses postresql) and in local machine