combustion 0.7.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.gitignore +2 -1
- data/.rubocop.yml +39 -0
- data/.travis.yml +5 -5
- data/Appraisals +17 -0
- data/Gemfile +2 -0
- data/HISTORY +12 -0
- data/README.md +2 -2
- data/Rakefile +11 -1
- data/combustion.gemspec +26 -22
- data/exe/combust +3 -2
- data/gemfiles/rails_3.1.gemfile +1 -0
- data/gemfiles/rails_3.2.gemfile +1 -0
- data/gemfiles/rails_4.0.gemfile +1 -0
- data/gemfiles/rails_4.1.gemfile +1 -0
- data/gemfiles/rails_4.2.gemfile +2 -0
- data/gemfiles/rails_5.0.gemfile +2 -0
- data/gemfiles/rails_5.1.gemfile +2 -0
- data/gemfiles/rails_5.2.gemfile +8 -0
- data/lib/combustion/application.rb +23 -28
- data/lib/combustion/configurations/action_controller.rb +11 -0
- data/lib/combustion/configurations/action_mailer.rb +10 -0
- data/lib/combustion/configurations/active_record.rb +13 -0
- data/lib/combustion/database/load_schema.rb +14 -4
- data/lib/combustion/database/migrate.rb +29 -12
- data/lib/combustion/database/reset.rb +40 -21
- data/lib/combustion/database.rb +23 -14
- data/lib/combustion/databases/base.rb +4 -2
- data/lib/combustion/databases/firebird.rb +3 -1
- data/lib/combustion/databases/mysql.rb +55 -26
- data/lib/combustion/databases/oracle.rb +3 -1
- data/lib/combustion/databases/postgresql.rb +12 -11
- data/lib/combustion/databases/sql_server.rb +4 -2
- data/lib/combustion/databases/sqlite.rb +9 -7
- data/lib/combustion/generator.rb +16 -14
- data/lib/combustion.rb +34 -22
- data/spec/database_spec.rb +16 -12
- data/spec/dummy/db/migrate/20150717075542_create_dummy_test_table.rb +3 -1
- data/spec/dummy/db/migrate/20150717075543_create_dummy_test_table_in_another_db.rb +3 -1
- data/spec/dummy/lib/engine.rb +3 -1
- data/spec/dummy/spec/internal/app/models/model.rb +3 -1
- data/spec/dummy/spec/internal/app/models/model_in_another_db.rb +3 -1
- data/spec/dummy/spec/internal/config/routes.rb +3 -1
- data/spec/dummy/spec/internal/db/schema.rb +4 -1
- data/spec/spec_helper.rb +7 -6
- data/templates/config.ru +4 -2
- data/templates/routes.rb +3 -1
- data/templates/schema.rb +4 -1
- metadata +22 -4
- data/bin/literals +0 -9
data/lib/combustion/database.rb
CHANGED
@@ -1,25 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Combustion
|
2
4
|
module Databases
|
3
|
-
#
|
4
5
|
end
|
5
6
|
|
6
7
|
class Database
|
8
|
+
DEFAULT_OPTIONS = {
|
9
|
+
:database_reset => true,
|
10
|
+
:load_schema => true,
|
11
|
+
:database_migrate => true
|
12
|
+
}.freeze
|
13
|
+
|
7
14
|
def self.setup(options = {})
|
8
|
-
|
9
|
-
|
10
|
-
Combustion::Database::
|
15
|
+
options = DEFAULT_OPTIONS.merge options
|
16
|
+
|
17
|
+
Combustion::Database::Reset.call if options[:database_reset]
|
18
|
+
Combustion::Database::LoadSchema.call if options[:load_schema]
|
19
|
+
Combustion::Database::Migrate.call if options[:database_migrate]
|
11
20
|
end
|
12
21
|
end
|
13
22
|
end
|
14
23
|
|
15
|
-
require
|
16
|
-
require
|
17
|
-
require
|
24
|
+
require "combustion/databases/base"
|
25
|
+
require "combustion/databases/firebird"
|
26
|
+
require "combustion/databases/mysql"
|
27
|
+
require "combustion/databases/oracle"
|
28
|
+
require "combustion/databases/postgresql"
|
29
|
+
require "combustion/databases/sql_server"
|
30
|
+
require "combustion/databases/sqlite"
|
18
31
|
|
19
|
-
require
|
20
|
-
require
|
21
|
-
require
|
22
|
-
require 'combustion/databases/oracle'
|
23
|
-
require 'combustion/databases/postgresql'
|
24
|
-
require 'combustion/databases/sql_server'
|
25
|
-
require 'combustion/databases/sqlite'
|
32
|
+
require "combustion/database/load_schema"
|
33
|
+
require "combustion/database/migrate"
|
34
|
+
require "combustion/database/reset"
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "active_support/core_ext/module/delegation"
|
2
4
|
|
3
5
|
class Combustion::Databases::Base
|
4
6
|
def initialize(configuration)
|
@@ -9,7 +11,7 @@ class Combustion::Databases::Base
|
|
9
11
|
drop
|
10
12
|
create
|
11
13
|
|
12
|
-
establish_connection
|
14
|
+
establish_connection Rails.env.to_sym
|
13
15
|
end
|
14
16
|
|
15
17
|
private
|
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Combustion::Databases::MySQL < Combustion::Databases::Base
|
2
|
-
ACCESS_DENIED_ERROR =
|
4
|
+
ACCESS_DENIED_ERROR = 10_145
|
3
5
|
|
4
6
|
def reset
|
5
|
-
establish_connection(configuration.merge(
|
7
|
+
establish_connection(configuration.merge("database" => nil))
|
6
8
|
|
7
9
|
super
|
8
10
|
end
|
@@ -10,34 +12,36 @@ class Combustion::Databases::MySQL < Combustion::Databases::Base
|
|
10
12
|
private
|
11
13
|
|
12
14
|
def charset
|
13
|
-
configuration[
|
15
|
+
configuration["charset"] || ENV["CHARSET"] || "utf8"
|
16
|
+
end
|
17
|
+
|
18
|
+
def charset_error
|
19
|
+
return "" unless config["charset"]
|
20
|
+
|
21
|
+
"(if you set the charset manually, make sure you have a matching collation)"
|
14
22
|
end
|
15
23
|
|
16
24
|
def collation
|
17
|
-
configuration[
|
25
|
+
configuration["collation"] || ENV["COLLATION"] || "utf8_unicode_ci"
|
18
26
|
end
|
19
27
|
|
20
28
|
def create
|
21
|
-
connection.create_database configuration[
|
29
|
+
connection.create_database configuration["database"], creation_options
|
22
30
|
establish_connection configuration
|
23
31
|
rescue error_class => error
|
24
|
-
|
25
|
-
create_as_root
|
26
|
-
else
|
27
|
-
$stderr.puts error.error
|
28
|
-
$stderr.puts "Couldn't create database for #{config.inspect}, charset: #{charset}, collation: #{collation}"
|
29
|
-
$stderr.puts "(if you set the charset manually, make sure you have a matching collation)" if config['charset']
|
30
|
-
end
|
32
|
+
rescue_create_from error
|
31
33
|
end
|
32
34
|
|
33
|
-
def create_as_root
|
34
|
-
print "#{sqlerr.error}. \nPlease provide the root password for your mysql installation\n>"
|
35
|
-
root_password = $stdin.gets.strip
|
35
|
+
def create_as_root(error)
|
36
36
|
establish_connection configuration.merge(
|
37
|
-
|
37
|
+
"database" => nil,
|
38
|
+
"username" => "root",
|
39
|
+
"password" => request_password(error)
|
38
40
|
)
|
39
|
-
|
41
|
+
|
42
|
+
connection.create_database config["database"], creation_options
|
40
43
|
connection.execute grant_statement
|
44
|
+
|
41
45
|
establish_connection configuration
|
42
46
|
end
|
43
47
|
|
@@ -46,24 +50,49 @@ class Combustion::Databases::MySQL < Combustion::Databases::Base
|
|
46
50
|
end
|
47
51
|
|
48
52
|
def drop
|
49
|
-
connection.drop_database configuration[
|
53
|
+
connection.drop_database configuration["database"]
|
50
54
|
end
|
51
55
|
|
52
56
|
def error_class
|
53
|
-
if configuration[
|
54
|
-
#FIXME After Jdbcmysql gives this class
|
55
|
-
require
|
56
|
-
|
57
|
+
if configuration["adapter"][/jdbc/]
|
58
|
+
# FIXME: After Jdbcmysql gives this class
|
59
|
+
require "active_record/railties/jdbcmysql_error"
|
60
|
+
ArJdbcMySQL::Error
|
61
|
+
elsif config["adapter"][/mysql2/] && defined?(Mysql2)
|
62
|
+
Mysql2::Error
|
57
63
|
else
|
58
|
-
|
64
|
+
Mysql::Error
|
59
65
|
end
|
60
66
|
end
|
61
67
|
|
62
68
|
def grant_statement
|
63
69
|
<<-SQL
|
64
|
-
GRANT ALL PRIVILEGES ON #{configuration[
|
65
|
-
TO '#{configuration[
|
66
|
-
IDENTIFIED BY '#{configuration[
|
70
|
+
GRANT ALL PRIVILEGES ON #{configuration["database"]}.*
|
71
|
+
TO '#{configuration["username"]}'@'localhost'
|
72
|
+
IDENTIFIED BY '#{configuration["password"]}' WITH GRANT OPTION;
|
67
73
|
SQL
|
68
74
|
end
|
75
|
+
|
76
|
+
def request_password(error)
|
77
|
+
print <<-TXT.strip
|
78
|
+
#{error.error}.
|
79
|
+
Please provide the root password for your mysql installation
|
80
|
+
>
|
81
|
+
TXT
|
82
|
+
|
83
|
+
$stdin.gets.strip
|
84
|
+
end
|
85
|
+
|
86
|
+
def rescue_create_from(error)
|
87
|
+
if error.errno == ACCESS_DENIED_ERROR
|
88
|
+
create_as_root(error)
|
89
|
+
return
|
90
|
+
end
|
91
|
+
|
92
|
+
warn <<-TXT
|
93
|
+
#{error.error}
|
94
|
+
Couldn't create database for #{config.inspect}, charset: #{charset}, collation: #{collation}
|
95
|
+
#{charset_error}
|
96
|
+
TXT
|
97
|
+
end
|
69
98
|
end
|
@@ -1,6 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Combustion::Databases::Oracle < Combustion::Databases::Base
|
2
4
|
def reset
|
3
|
-
establish_connection
|
5
|
+
establish_connection Rails.env.to_sym
|
4
6
|
connection.structure_drop.split(";\n\n").each do |ddl|
|
5
7
|
connection.execute(ddl)
|
6
8
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Combustion::Databases::PostgreSQL < Combustion::Databases::Base
|
2
4
|
def reset
|
3
5
|
base.clear_active_connections!
|
@@ -10,31 +12,30 @@ class Combustion::Databases::PostgreSQL < Combustion::Databases::Base
|
|
10
12
|
|
11
13
|
def create
|
12
14
|
connection.create_database(
|
13
|
-
configuration[
|
14
|
-
configuration.merge(
|
15
|
+
configuration["database"],
|
16
|
+
configuration.merge("encoding" => encoding)
|
15
17
|
)
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
$stderr.puts "Couldn't create database for #{configuration.inspect}"
|
18
|
+
rescue StandardError => error
|
19
|
+
warn error, *error.backtrace
|
20
|
+
warn "Couldn't create database for #{configuration.inspect}"
|
20
21
|
end
|
21
22
|
|
22
23
|
def drop
|
23
|
-
connection.drop_database(configuration[
|
24
|
+
connection.drop_database(configuration["database"])
|
24
25
|
end
|
25
26
|
|
26
27
|
def encoding
|
27
|
-
configuration[
|
28
|
+
configuration["encoding"] || ENV["CHARSET"] || "utf8"
|
28
29
|
end
|
29
30
|
|
30
31
|
def postgres_configuration
|
31
32
|
configuration.merge(
|
32
|
-
|
33
|
-
|
33
|
+
"database" => "postgres",
|
34
|
+
"schema_search_path" => schema_search_path
|
34
35
|
)
|
35
36
|
end
|
36
37
|
|
37
38
|
def schema_search_path
|
38
|
-
configuration[
|
39
|
+
configuration["adapter"][/postgis/] ? "public, postgis" : "public"
|
39
40
|
end
|
40
41
|
end
|
@@ -1,6 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Combustion::Databases::SQLServer < Combustion::Databases::Base
|
2
4
|
def reset
|
3
|
-
establish_connection configuration.merge(
|
4
|
-
connection.recreate_database! configuration[
|
5
|
+
establish_connection configuration.merge("database" => "master")
|
6
|
+
connection.recreate_database! configuration["database"]
|
5
7
|
end
|
6
8
|
end
|
@@ -1,20 +1,22 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "fileutils"
|
4
|
+
require "pathname"
|
3
5
|
|
4
6
|
class Combustion::Databases::SQLite < Combustion::Databases::Base
|
5
7
|
private
|
6
8
|
|
7
9
|
def create
|
8
10
|
if exists?
|
9
|
-
|
11
|
+
warn "#{config["database"]} already exists"
|
10
12
|
return
|
11
13
|
end
|
12
14
|
|
13
15
|
establish_connection configuration
|
14
16
|
connection
|
15
|
-
rescue
|
16
|
-
|
17
|
-
|
17
|
+
rescue StandardError => error
|
18
|
+
warn error, *error.backtrace
|
19
|
+
warn "Couldn't create database for #{configuration.inspect}"
|
18
20
|
end
|
19
21
|
|
20
22
|
def drop
|
@@ -30,6 +32,6 @@ class Combustion::Databases::SQLite < Combustion::Databases::Base
|
|
30
32
|
end
|
31
33
|
|
32
34
|
def path
|
33
|
-
@path ||= Pathname.new configuration[
|
35
|
+
@path ||= Pathname.new configuration["database"]
|
34
36
|
end
|
35
37
|
end
|
data/lib/combustion/generator.rb
CHANGED
@@ -1,29 +1,31 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "thor/group"
|
2
4
|
|
3
5
|
module Combustion
|
4
6
|
class Generator < Thor::Group
|
5
7
|
include Thor::Actions
|
6
8
|
|
7
9
|
def self.source_root
|
8
|
-
File.expand_path File.join(File.dirname(__FILE__),
|
10
|
+
File.expand_path File.join(File.dirname(__FILE__), "..", "..")
|
9
11
|
end
|
10
12
|
|
11
13
|
def create_directories
|
12
|
-
empty_directory
|
13
|
-
empty_directory
|
14
|
-
empty_directory
|
15
|
-
empty_directory
|
16
|
-
empty_directory
|
14
|
+
empty_directory "spec/internal"
|
15
|
+
empty_directory "spec/internal/config"
|
16
|
+
empty_directory "spec/internal/db"
|
17
|
+
empty_directory "spec/internal/log"
|
18
|
+
empty_directory "spec/internal/public"
|
17
19
|
end
|
18
20
|
|
19
21
|
def create_files
|
20
|
-
template
|
21
|
-
template
|
22
|
-
template
|
23
|
-
template
|
24
|
-
create_file
|
25
|
-
create_file
|
26
|
-
|
22
|
+
template "templates/routes.rb", "spec/internal/config/routes.rb"
|
23
|
+
template "templates/database.yml", "spec/internal/config/database.yml"
|
24
|
+
template "templates/schema.rb", "spec/internal/db/schema.rb"
|
25
|
+
template "templates/config.ru", "config.ru"
|
26
|
+
create_file "spec/internal/public/favicon.ico"
|
27
|
+
create_file "spec/internal/log/.gitignore" do
|
28
|
+
"*.log"
|
27
29
|
end
|
28
30
|
end
|
29
31
|
end
|
data/lib/combustion.rb
CHANGED
@@ -1,38 +1,48 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails"
|
4
|
+
require "active_support/dependencies"
|
3
5
|
|
4
6
|
module Combustion
|
5
|
-
|
6
|
-
|
7
|
+
module Configurations
|
8
|
+
end
|
9
|
+
|
10
|
+
mattr_accessor :path, :schema_format, :setup_environment
|
7
11
|
|
8
|
-
self.path =
|
12
|
+
self.path = "/spec/internal"
|
9
13
|
self.schema_format = :ruby
|
10
14
|
|
11
|
-
if Rails.version.
|
12
|
-
|
13
|
-
sprockets )
|
15
|
+
MODULES = if Rails.version.to_f >= 3.1
|
16
|
+
%w[ active_record action_controller action_view action_mailer sprockets ]
|
14
17
|
else
|
15
|
-
|
18
|
+
%w[ active_record action_controller action_view action_mailer ]
|
16
19
|
end
|
17
20
|
|
18
21
|
def self.initialize!(*modules, &block)
|
19
|
-
|
22
|
+
self.setup_environment = block if block_given?
|
20
23
|
|
21
24
|
options = modules.extract_options!
|
22
|
-
modules =
|
25
|
+
modules = MODULES if modules == [:all]
|
23
26
|
modules.each { |mod| require "#{mod}/railtie" }
|
24
27
|
|
25
28
|
Bundler.require :default, Rails.env
|
26
29
|
|
27
30
|
Combustion::Application.configure_for_combustion
|
31
|
+
include_database modules, options
|
32
|
+
Combustion::Application.initialize!
|
33
|
+
include_rspec
|
34
|
+
end
|
28
35
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
36
|
+
def self.include_database(modules, options)
|
37
|
+
return unless modules.map(&:to_s).include? "active_record"
|
38
|
+
|
39
|
+
Combustion::Application.config.to_prepare do
|
40
|
+
Combustion::Database.setup(options)
|
33
41
|
end
|
42
|
+
end
|
34
43
|
|
35
|
-
|
44
|
+
def self.include_rspec
|
45
|
+
return unless defined?(RSpec) && RSpec.respond_to?(:configure)
|
36
46
|
|
37
47
|
RSpec.configure do |config|
|
38
48
|
include_capybara_into config
|
@@ -41,7 +51,7 @@ module Combustion
|
|
41
51
|
if Combustion::Application.routes.respond_to?(:mounted_helpers)
|
42
52
|
config.include Combustion::Application.routes.mounted_helpers
|
43
53
|
end
|
44
|
-
end
|
54
|
+
end
|
45
55
|
end
|
46
56
|
|
47
57
|
def self.include_capybara_into(config)
|
@@ -49,12 +59,14 @@ module Combustion
|
|
49
59
|
|
50
60
|
config.include Capybara::RSpecMatchers if defined?(Capybara::RSpecMatchers)
|
51
61
|
config.include Capybara::DSL if defined?(Capybara::DSL)
|
62
|
+
return if defined?(Capybara::RSpecMatchers) || defined?(Capybara::DSL)
|
52
63
|
|
53
|
-
|
54
|
-
config.include Capybara
|
55
|
-
end
|
64
|
+
config.include Capybara
|
56
65
|
end
|
57
66
|
end
|
58
67
|
|
59
|
-
require
|
60
|
-
require
|
68
|
+
require "combustion/application"
|
69
|
+
require "combustion/configurations/action_controller"
|
70
|
+
require "combustion/configurations/action_mailer"
|
71
|
+
require "combustion/configurations/active_record"
|
72
|
+
require "combustion/database"
|
data/spec/database_spec.rb
CHANGED
@@ -1,28 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Combustion
|
2
4
|
describe Database do
|
3
5
|
before(:all) do
|
4
|
-
Dir.chdir(File.expand_path(
|
6
|
+
Dir.chdir(File.expand_path("dummy", __dir__)) do
|
5
7
|
Combustion.initialize! :active_record
|
6
8
|
end
|
7
9
|
end
|
8
10
|
|
9
|
-
it
|
10
|
-
expect(Model.connection.table_exists?(
|
11
|
-
expect(Model.connection.table_exists?(
|
11
|
+
it "creates dummy table from migration in base database" do
|
12
|
+
expect(Model.connection.table_exists?("dummy_table")).to eq true
|
13
|
+
expect(Model.connection.table_exists?("dummy_in_another_db")).to eq false
|
12
14
|
end
|
13
15
|
|
14
|
-
it
|
15
|
-
expect(ModelInAnotherDb.connection.table_exists?(
|
16
|
-
|
17
|
-
|
16
|
+
it "creates another dummy table from another database" do
|
17
|
+
expect(ModelInAnotherDb.connection.table_exists?("dummy_table")).
|
18
|
+
to eq false
|
19
|
+
expect(ModelInAnotherDb.connection.table_exists?("dummy_in_another_db")).
|
20
|
+
to eq true
|
18
21
|
end
|
19
22
|
|
20
|
-
it
|
21
|
-
expect(Model.connection_config[:database]).to match
|
23
|
+
it "returns test database for model with default connection" do
|
24
|
+
expect(Model.connection_config[:database]).to match(/test/)
|
22
25
|
end
|
23
26
|
|
24
|
-
it
|
25
|
-
expect(ModelInAnotherDb.connection_config[:database]).
|
27
|
+
it "returns test_another for model with connection to second database" do
|
28
|
+
expect(ModelInAnotherDb.connection_config[:database]).
|
29
|
+
to match(/test_another/)
|
26
30
|
end
|
27
31
|
end
|
28
32
|
end
|
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
superclass = ActiveRecord::VERSION::MAJOR < 5 ?
|
2
4
|
ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
3
5
|
class CreateDummyTestTable < superclass
|
4
6
|
def change
|
5
|
-
create_table
|
7
|
+
create_table "dummy_table"
|
6
8
|
end
|
7
9
|
end
|
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
superclass = ActiveRecord::VERSION::MAJOR < 5 ?
|
2
4
|
ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
3
5
|
class CreateDummyTestTableInAnotherDb < superclass
|
4
6
|
def change
|
5
|
-
create_table
|
7
|
+
create_table "dummy_in_another_db"
|
6
8
|
end
|
7
9
|
|
8
10
|
def connection
|
data/spec/dummy/lib/engine.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dummy
|
2
4
|
class Engine < ::Rails::Engine
|
3
|
-
initializer :dummy, before
|
5
|
+
initializer :dummy, :before => :load_init_rb do |app|
|
4
6
|
app.config.paths["db/migrate"].concat(config.paths["db/migrate"].expanded)
|
5
7
|
end
|
6
8
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
require
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "combustion"
|
4
5
|
|
5
6
|
if Rails::VERSION::STRING.to_f < 4.1
|
6
|
-
require
|
7
|
-
require
|
7
|
+
require "active_record"
|
8
|
+
require "active_record/connection_adapters/mysql2_adapter"
|
8
9
|
|
9
10
|
class ActiveRecord::ConnectionAdapters::Mysql2Adapter
|
10
11
|
NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"
|
11
12
|
end
|
12
13
|
end
|
13
14
|
|
14
|
-
require File.expand_path("
|
15
|
+
require File.expand_path("dummy/lib/engine.rb", __dir__)
|
data/templates/config.ru
CHANGED
data/templates/routes.rb
CHANGED