Sha256: 7be6ab7baaa991a8bd9efb230307c6083186ea7c91f39a744dff72d4fd777669
Contents?: true
Size: 720 Bytes
Versions: 17
Compression:
Stored size: 720 Bytes
Contents
require 'active_record' ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:") ActiveRecord::Schema.define do create_table :accounts, :force => true do |t| t.column :id, :integer t.column :name, :string t.column :role, :string t.column :crypted_password, :string t.column :salt, :string t.column :email, :string end create_table :categories, :force => true do |t| t.column :name, :string t.column :account_id, :integer end end class Account < ActiveRecord::Base has_many :categories end class Category < ActiveRecord::Base belongs_to :account end Padrino::Admin::Orm.register!
Version data entries
17 entries across 17 versions & 1 rubygems