Top Level Namespace

Defined Under Namespace

Modules: ActsAsListAR, DefaultBehavior Classes: ListMixin, ListMixinSub1, ListMixinSub2, ListSubTest, ListTest, ListWithStringIdsTest, ListWithStringScopeMixin, Mixin, MixinWithStrings, StiMixin, StiMixinSub1, StiMixinSub2

Instance Method Summary collapse

Instance Method Details

#setup_dbObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'test/test_helper.rb', line 8

def setup_db
  ActiveRecord::Schema.define(:version => 1) do
    create_table :mixins do |t|
      t.column :pos, :integer
      t.column :parent_id, :integer
      t.column :created_at, :datetime      
      t.column :updated_at, :datetime
    end

    create_table :sti_mixins do |t|
      t.column :position, :integer
      t.column :type, :string
    end   
    
    create_table :mixin_with_strings do |t|
      t.column :id, :string
      t.column :pos, :integer
      t.column :parent_id, :string
      t.column :created_at, :datetime
      t.column :updated_at, :datetime
    end   
  end
end

#teardown_dbObject



32
33
34
35
36
# File 'test/test_helper.rb', line 32

def teardown_db
  ActiveRecord::Base.connection.tables.each do |table|
    ActiveRecord::Base.connection.drop_table(table)
  end
end