Skip to content

Commit 3acdce5

Browse files
committed
Initial setup
This is setup inspired by the previous attempt. It is at the point where you can run tests with `ORM=sequel` or `ORM=active_record` and tests will run (failing even for AR though).
1 parent 12c9471 commit 3acdce5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3800
-926
lines changed

Rakefile

+6
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@ namespace :test do
1515
Rake::TestTask.new(:benchmark) do |t|
1616
t.pattern = 'test/benchmark/*_benchmark.rb'
1717
end
18+
19+
desc "Refresh dump.sql from fixtures and schema."
20+
task :refresh_dump do
21+
require_relative 'test/support/database/generator'
22+
end
1823
end
1924

25+
2026
desc 'Test bug report template'
2127
namespace :test do
2228
namespace :bug_report_template do
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#JSONAPI.configuration.default_record_accessor_klass = JSONAPI::ActiveRecordRecordAccessor
2+
3+
TestApp.class_eval do
4+
config.active_record.schema_format = :none
5+
6+
if Rails::VERSION::MAJOR >= 5
7+
config.active_support.halt_callback_chains_on_return_false = false
8+
config.active_record.time_zone_aware_types = [:time, :datetime]
9+
config.active_record.belongs_to_required_by_default = false
10+
11+
if Rails::VERSION::MINOR >= 2
12+
config.active_record.sqlite3.represent_boolean_as_integer = true
13+
end
14+
end
15+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
require 'active_record'
2+
3+
connection = ActiveRecord::Base.connection
4+
5+
sql = File.read(File.expand_path('../../database/dump.sql', __FILE__))
6+
statements = sql.split(/;$/)
7+
statements.pop # the last empty statement
8+
9+
statements.each do |statement|
10+
connection.execute(statement)
11+
end
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require 'active_record/railtie'

0 commit comments

Comments
 (0)