We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
could you please provide a minimal example of how to populate the database, assuming the table and the fields exist. Usual rails example doesn't work.
country_list = [ [ "Germany", 81831000 ], [ "France", 65447374 ], [ "Belgium", 10839905 ], [ "Netherlands", 16680000 ] ] country_list.each do |name, population| Country.create!( name: name, population: population ) end
Thank you
The text was updated successfully, but these errors were encountered:
I had to add the code inside a class extending ActiveRecord so for example your code would be:
class Country < ActiveRecord::Base # ... Country.create!( name: name, population: population ) end
Sorry, something went wrong.
No branches or pull requests
Hello,
could you please provide a minimal example of how to populate the database, assuming the table and the fields exist. Usual rails example doesn't work.
Thank you
The text was updated successfully, but these errors were encountered: