Sha256: 3b4c9c921606eff1b938557485f419c7dc70b960a22d50bd8f50404cbb140139

Contents?: true

Size: 740 Bytes

Versions: 8

Compression:

Stored size: 740 Bytes

Contents

require "rubygems"
require "rspec"
require "active_record"
require "active_support"
require "yaml"

# Establish DB Connection
config = YAML::load(IO.read(File.join(File.dirname(__FILE__), 'db', 'database.yml')))
ActiveRecord::Base.configurations = {'test' => config[ENV['DB'] || 'sqlite3']}
ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations['test'])

def database_supports_arrays?
  postgresql? && active_record_4?
end

def postgresql?
  ActiveRecord::Base.connection.instance_values["config"][:adapter] == 'postgresql'
end

def active_record_4?
  ActiveRecord::VERSION::MAJOR >= 4
end

# Load Test Schema into the Database
load(File.dirname(__FILE__) + "/db/schema.rb")

require File.dirname(__FILE__) + '/../init'

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
validates_lengths_from_database-0.8.0 spec/spec_helper.rb
validates_lengths_from_database-0.7.0 spec/spec_helper.rb
validates_lengths_from_database-0.6.0 spec/spec_helper.rb
validates_lengths_from_database-0.5.2 spec/spec_helper.rb
validates_lengths_from_database-0.5.1 spec/spec_helper.rb
validates_lengths_from_database-0.5.0 spec/spec_helper.rb
validates_lengths_from_database-0.4.0 spec/spec_helper.rb
validates_lengths_from_database-0.3.0 spec/spec_helper.rb