Sha256: da611f1e34fefe470fd701d706910908e195d2132cbf3c3ae5d4425a602f263e

Contents?: true

Size: 844 Bytes

Versions: 5

Compression:

Stored size: 844 Bytes

Contents

require 'rubygems'
require 'test/unit'
require 'active_support'
require 'active_record'
require 'active_model'

$:.unshift "#{File.dirname(__FILE__)}/../"
$:.unshift "#{File.dirname(__FILE__)}/../lib/"

require 'acts_as_keyed'

ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")

ActiveRecord::Schema.define(:version => 1) do
  create_table :objects_with_key_column do |t|
    t.string    :key
  end

  create_table :objects_without_key_column do |t|
    t.string    :name
  end
end

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

class ObjectWithKey < ActiveRecord::Base
  self.table_name = 'objects_with_key_column'
end

class ObjectWithoutKey < ActiveRecord::Base
  self.table_name = 'objects_without_key_column'
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
acts_as_keyed-1.0.0 test/test_helper.rb
acts_as_keyed-0.1.3 test/test_helper.rb
acts_as_keyed-0.1.2 test/test_helper.rb
acts_as_keyed-0.1.1 test/test_helper.rb
acts_as_keyed-0.1.0 test/test_helper.rb