Sha256: 7e7401ffe42684f7cf308cc9a4895f0176ea6983b56b08f33db885e900a3c99a

Contents?: true

Size: 863 Bytes

Versions: 8

Compression:

Stored size: 863 Bytes

Contents

require 'rubygems'

require 'active_support'
require 'active_support/test_case'
require 'active_record'
require 'test/unit'

require "#{File.dirname(__FILE__)}/../init"

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

class User < ActiveRecord::Base
  has_settings
end

def setup_db
  ActiveRecord::Schema.define(:version => 1) do
    create_table :settings do |t|
      t.string :var, :null => false
      t.text   :value, :null => true
      t.integer :target_id, :null => true
      t.string :target_type, :limit => 30, :null => true
      t.timestamps
    end
    add_index :settings, [ :target_type, :target_id, :var ], :unique => true
    
    create_table :users do |t|
      t.string :name
    end
  end
end

puts "Testing with ActiveRecord #{ActiveRecord::VERSION::STRING}"

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
ledermann-rails-settings-1.2.0 test/test_helper.rb
ledermann-rails-settings-1.1.0 test/test_helper.rb
jamesearl-rails-settings-1.0.5 test/test_helper.rb
jamesearl-rails-settings-1.0.4 test/test_helper.rb
jamesearl-rails-settings-1.0.3 test/test_helper.rb
jamesearl-rails-settings-1.0.2 test/test_helper.rb
ledermann-rails-settings-1.0.1 test/test_helper.rb
ledermann-rails-settings-1.0.0 test/test_helper.rb