Fix test suite for ActiveRecord 3.x; assume primary key is INT if 'versions' table doesn't exist yet

This commit is contained in:
Ben Atkins 2014-05-09 11:43:30 -04:00
parent 4dba95a082
commit 8ae62c8b8e
2 changed files with 5 additions and 0 deletions

View File

@ -18,6 +18,9 @@ group :development, :test do
gem 'rspec-rails', '~> 2.14'
gem 'generator_spec'
# To do proper transactional testing with ActiveSupport::TestCase on MySQL
gem 'database_cleaner', '~> 1.2'
platforms :ruby do
gem 'sqlite3', '~> 1.2'
gem 'mysql2', '~> 0.3'

View File

@ -70,6 +70,8 @@ module PaperTrail
def primary_key_is_int?
@primary_key_is_int ||= columns_hash[primary_key].type == :integer
rescue
true
end
# Returns whether the `object` column is using the `json` type supported by PostgreSQL