Skip to content

Commit d636957

Browse files
author
Kyle d'Oliveira
committed
Switch to sqlite3 for the database as it is easier to manage. Update the migrations so they work under rails 5.2
1 parent 6309c21 commit d636957

8 files changed

Lines changed: 10 additions & 9 deletions

polymorphic_integer_type.gemspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ Gem::Specification.new do |spec|
1818
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
1919
spec.require_paths = ["lib"]
2020

21-
spec.add_development_dependency "bundler", "~> 1.2"
21+
spec.add_dependency "activerecord"
22+
spec.add_development_dependency "bundler"
2223
spec.add_development_dependency "rake"
2324
spec.add_development_dependency "rspec"
24-
spec.add_development_dependency "activerecord", "4.2.0"
25-
spec.add_development_dependency "mysql2", "0.3.16"
25+
spec.add_development_dependency "sqlite3"
2626
spec.add_development_dependency "byebug"
2727
end

spec/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
config.before(:suite) do
1414
database_config = YAML.load(File.open("#{File.dirname(__FILE__)}/support/database.yml"))
1515
ActiveRecord::Base.establish_connection(database_config)
16+
ActiveRecord::MigrationContext.new("#{File.dirname(__FILE__)}/support/migrations").migrate
1617
end
1718

1819
config.around do |example|

spec/support/database.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
:adapter: mysql2
2+
:adapter: sqlite3
33
:host: localhost
44
:database: polymorphic_integer_type_test
55
:username: root

spec/support/migrations/1_create_link_table.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateLinkTable < ActiveRecord::Migration
1+
class CreateLinkTable < ActiveRecord::Migration[5.2]
22

33
def up
44
create_table :links do |t|

spec/support/migrations/2_create_animal_table.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateAnimalTable < ActiveRecord::Migration
1+
class CreateAnimalTable < ActiveRecord::Migration[5.2]
22

33
def up
44
create_table :animals do |t|

spec/support/migrations/3_create_person_table.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreatePersonTable < ActiveRecord::Migration
1+
class CreatePersonTable < ActiveRecord::Migration[5.2]
22

33
def up
44
create_table :people do |t|

spec/support/migrations/4_create_food_table.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateFoodTable < ActiveRecord::Migration
1+
class CreateFoodTable < ActiveRecord::Migration[5.2]
22

33
def up
44
create_table :foods do |t|

spec/support/migrations/5_create_drink_table.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateDrinkTable < ActiveRecord::Migration
1+
class CreateDrinkTable < ActiveRecord::Migration[5.2]
22

33
def up
44
create_table :drinks do |t|

0 commit comments

Comments
 (0)