Sha256: 67d218efee5ef820628be514cc78b0d98adfe5263e0c5083e08396f2b97c7d2b
Contents?: true
Size: 822 Bytes
Versions: 1
Compression:
Stored size: 822 Bytes
Contents
require 'rubygems' require 'ruby-debug' require 'minitest/autorun' # require 'mocha' require 'active_support/core_ext' require 'active_record' require 'better_ar' class Object def must_be_like other self.gsub(/\s+/, ' ').strip.must_equal other.gsub(/\s+/, ' ').strip end end ActiveRecord::Base.establish_connection( :adapter => defined?(JRUBY_VERSION) ? 'jdbcsqlite3' : 'sqlite3', :database => ':memory:' ) users_table = %{CREATE TABLE users (id INTEGER PRIMARY KEY, age INTEGER, name TEXT);} records_table = %{CREATE TABLE records (id INTEGER PRIMARY KEY, user_id INTEGER, name TEXT);} ActiveRecord::Base.connection.execute(users_table) ActiveRecord::Base.connection.execute(records_table) class User < ActiveRecord::Base has_many :records end class Record < ActiveRecord::Base belongs_to :user end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
better_ar-0.0.6 | test/helper.rb |