Sha256: 9d4d13288bef15f3121cd598fb1823747e429e2912e5e8c595d9c8640c567244

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

begin
  ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
rescue ArgumentError
  ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :dbfile => ":memory:")
end

ActiveRecord::Base.configurations = true

ActiveRecord::Schema.define(:version => 1) do

  create_table :layouts, :force => true do |t|
    t.text :description
    t.string :name
    t.string :path # path to the layout, same as the 'render' method
    t.string :key # some layouts use same views, but have different sub areas
    t.timestamps
  end
  
  create_table :areas, :force => true do |t|
    t.string :name
    t.references :layout
    t.timestamps
  end
  
  create_table :widgets, :force => true do |t|
    t.string :name
    t.references :area
    t.string :type
    t.timestamps
  end
  
  create_table :links, :force => true do |t|
    t.string :name
    t.timestamps
  end
  
  create_table :pages, :force => true do |t|
    t.string :title
    t.timestamps
  end
  
  create_table :relationships do |t|
    t.references :parent, :polymorphic => true
    t.references :child, :polymorphic => true
    t.string :context
    t.timestamps
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acts-as-layoutable-0.0.1.7 test/lib/database.rb