Sha256: c22ca931978b4953c4f6e08999d21a28774c9c9c63e910a8f1e2b650677c5daa

Contents?: true

Size: 1.63 KB

Versions: 1

Compression:

Stored size: 1.63 KB

Contents

ENV["RAILS_ENV"] ||= 'test'

require 'rails'
require 'rspec-rails'
require 'active_record'

$:.unshift File.dirname(__FILE__) + '/../lib'

# Thie first line isn't working so I have added the second...
require File.dirname(__FILE__) + '/../lib/super_sti'
ActiveRecord::Base.send(:extend, SuperSTI::Hook)
 
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
 
# AR keeps printing annoying schema statements
$stdout = StringIO.new

ActiveRecord::Base.logger
ActiveRecord::Schema.define(:version => 1) do
  create_table :accounts do |t|
    t.float :balance
    t.boolean :is_approved, :null => false
    t.string :type, :null => false
  end

  create_table :basic_account_data do |t|
    t.integer :basic_account_id, :null => false
  end
  
  create_table :bank_account_data do |t|
    t.integer :bank_account_id, :null => false
    t.integer :bank_id, :null => false
    t.string :account_number, :null => false
    t.string :sort_code, :null => false
  end

  create_table :credit_card_data do |t|
    t.integer :credit_card_id, :null => false
    t.string :credit_card_number, :null => false
    t.date :expiry_date, :null => false
  end

  create_table :banks do |t|
    t.string :name, :null => false
  end
  
  create_table :unusual_table_name do |t|
    t.integer :unusual_table_name_id, :null => false
  end

  create_table :unusual_foreign_key_data do |t|
    t.integer :unusual_foreign_key, :null => false
  end

  create_table :scoped_accounts do |t|
    t.boolean :is_live, :null => false
  end

  create_table :scoped_account_data do |t|
    t.boolean :scoped_account_id, :null => false
  end
end

require 'test_classes'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
super_sti-0.3.0 spec/spec_helper.rb