Skip to content
aaronbee edited this page Sep 14, 2010 · 3 revisions

This page describes how to write scripts load data into the database.

If a file db/loader.rb exists it will be run after the PIQL entities and Rails models have been loaded.
Here is a simple loader.rb example:


names = ["Alice", "Bob", "Calvin"]

names.each do |n|
u = User.new
u.name = n
u.save($piql_env)
end


Clone this wiki locally