Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: d0808351ee
Fetching contributors…

Cannot retrieve contributors at this time

48 lines (40 sloc) 1.583 kB
require 'sequel'
require 'tasks/sequel'
task :environment do
puts "dummy environment"
DB = Sequel.sqlite
DB.create_table :nodes do
primary_key :id
String :name
Integer :parent_id
Integer :position
end
NODES = [
{:id => 1, :name => 'one', :parent_id => nil, :position => 1},
{:id => 2, :name => 'two', :parent_id => nil, :position => 2},
{:id => 3, :name => 'three', :parent_id => nil, :position => 3},
{:id => 4, :name => "two.one", :parent_id => 2, :position => 1},
{:id => 5, :name => "two.two", :parent_id => 2, :position => 2},
{:id => 6, :name => "two.two.one", :parent_id => 5, :position => 1},
{:id => 7, :name => "one.two", :parent_id => 1, :position => 2},
{:id => 8, :name => "one.one", :parent_id => 1, :position => 1},
{:id => 9, :name => "five", :parent_id => nil, :position => 5},
{:id => 10, :name => "four", :parent_id => nil, :position => 4},
{:id => 11, :name => "five.one", :parent_id => 9, :position => 1},
{:id => 12, :name => "two.three", :parent_id => 2, :position => 3},
]
DB.create_table :lorems do
primary_key :id
String :name
Integer :ipsum_id
Integer :neque
end
LOREMS = [
{:id => 1, :name => 'Lorem', :ipsum_id => nil, :neque => 4},
{:id => 2, :name => 'Ipsum', :ipsum_id => nil, :neque => 3},
{:id => 4, :name => "Neque", :ipsum_id => 2, :neque => 2},
{:id => 5, :name => "Porro", :ipsum_id => 2, :neque => 1},
]
NODES.each{|node| DB[:nodes].insert(node)}
LOREMS.each{|lorem| DB[:lorems].insert(lorem)}
end
Jump to Line
Something went wrong with that request. Please try again.