Just write the code you'd use to generate them manually and put it in the seeds.rb. You can use normal ruby in that file; so either just write plain create
's or load a csv you store in, e.g. db/seeds/measurements.csv
. To get the path to that file, use Rails.root.join("db/seeds/measurements.csv")
.
Example:
File.open(Rails.root.join("db/seeds/measurements.csv")) do |f|
# use f here
end