database_rewinder 0.8.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68f7e55817b3442c32f74c7575d83dec47b44ee73c8e0dd10686869ffca8f720
4
- data.tar.gz: 3f5e43c24343437bd8d69f3ee00015c96f3578092785d9bf166d1f3ddf72e21f
3
+ metadata.gz: f79ac7f52a4377e3b0991fc87a7e0ae0fe50cfc5af519a009d5470e6d8d7e5e3
4
+ data.tar.gz: 1fc00b427798e7bb7a573bd13818da4b8a41abe99182b1da7cebc92d938db931
5
5
  SHA512:
6
- metadata.gz: 1de60041450d9fb332c53a96c36fa20414e39dfb8952834188e0885f2e99d0230b34d3e10fe3c7bd5a8147784aa38136e5f4c3e7af2636e3e6f3a156918f16d4
7
- data.tar.gz: d0b8b8c867fb7149fd0a374a49bcae26330ebc5329b208987dc5f416224e996769b897dc7752205a7ea40f5e05a156fa1e98d1098516d8bfd5b3d3b71608299a
6
+ metadata.gz: 65a551ce2bbe957514861dd56e0e4f758ea4f0c93e7ca6052efb24b2033b68c200228253dfafe6f9737214edaf870087c48300d15be854849f7a5a6d0c797a0d
7
+ data.tar.gz: 841d80ce6639746df70f78b728b5498a117e4f7cfca84e4e8de7de4bc1c2c393f5cfb60c4827e9b551d9a49bd67ecbc30ecf27ad4042cd38d457c23a09e7614c
data/.travis.yml CHANGED
@@ -1,41 +1,64 @@
1
1
  language: ruby
2
2
 
3
+ addons:
4
+ postgresql: '9.4'
5
+ mysql: '5.7'
6
+
3
7
  before_install:
4
- - gem update --system
5
- - gem install bundler
8
+ # install older versions of rubygems and bundler only on Ruby < 2.7
9
+ - if [ `echo "${TRAVIS_RUBY_VERSION:0:3} < 2.7" | bc` == 1 ]; then gem i rubygems-update -v '<3' && update_rubygems; fi;
10
+ - if [ `echo "${TRAVIS_RUBY_VERSION:0:3} < 2.7" | bc` == 1 ]; then gem i bundler -v '<2'; fi;
11
+ - sudo service mysql restart
12
+
6
13
 
7
14
  cache: bundler
8
15
 
9
16
  env:
10
- - DB=sqlite3
11
- - DB=mysql
12
- - DB=postgresql
17
+ matrix:
18
+ - DB=sqlite3
19
+ - DB=mysql
20
+ - DB=postgresql
13
21
 
14
22
  rvm:
15
- - 2.5.0
16
- - 2.4.3
17
- - 2.3.6
18
- - 2.2.9
23
+ - 2.6.3
19
24
 
20
25
  gemfile:
21
- - gemfiles/rails_51.gemfile
22
- - gemfiles/rails_50.gemfile
23
- - gemfiles/rails_42.gemfile
24
- - gemfiles/rails_edge.gemfile
26
+ - gemfiles/rails_52.gemfile
27
+ - gemfiles/rails_60.gemfile
25
28
 
26
29
  sudo: false
27
30
 
31
+ dist: xenial
32
+
28
33
  matrix:
29
34
  include:
30
- - rvm: 2.3.6
35
+ - rvm: 2.7.1
36
+ gemfile: gemfiles/rails_60.gemfile
37
+ env: DB=postgresql
38
+ - rvm: 2.6.3
39
+ gemfile: gemfiles/rails_edge.gemfile
40
+ env: DB=postgresql
41
+ - rvm: 2.5.5
42
+ gemfile: gemfiles/rails_51.gemfile
43
+ env: DB=postgresql
44
+ - rvm: 2.4.6
45
+ gemfile: gemfiles/rails_50.gemfile
46
+ env: DB=postgresql
47
+ - rvm: 2.3.8
31
48
  gemfile: gemfiles/rails_41.gemfile
32
- env: DB=sqlite3
33
- - rvm: 2.3.6
49
+ env: DB=postgresql
50
+ - rvm: 2.3.8
34
51
  gemfile: gemfiles/rails_40.gemfile
35
- env: DB=sqlite3
52
+ env: DB=postgresql
53
+ - rvm: 2.2.10
54
+ gemfile: gemfiles/rails_52.gemfile
55
+ env: DB=postgresql
36
56
  - rvm: 2.1.10
37
57
  gemfile: gemfiles/rails_42.gemfile
38
- env: DB=sqlite3
58
+ env: DB=postgresql
39
59
  - rvm: 2.0.0
40
60
  gemfile: gemfiles/rails_42.gemfile
41
- env: DB=sqlite3
61
+ env: DB=postgresql
62
+
63
+ allow_failures:
64
+ - gemfile: gemfiles/rails_edge.gemfile
data/Gemfile CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  source 'https://rubygems.org'
3
4
 
4
5
  # Specify your gem's dependencies in database_rewinder.gemspec
data/README.md CHANGED
@@ -23,7 +23,7 @@ This strategy was originally devised and implemented by Shingo Morita (@eudoxa)
23
23
 
24
24
  ## Supported versions
25
25
 
26
- * ActiveRecord 4.0, 4.1, 4.2, 5.0, 5.1, 5.2 (edge)
26
+ * ActiveRecord 4.0, 4.1, 4.2, 5.0, 5.1, 5.2, 6.0 (edge)
27
27
 
28
28
  * Ruby 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 (trunk)
29
29
 
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'bundler'
3
4
  require 'bundler/setup'
4
5
  require "bundler/gem_tasks"
@@ -1,11 +1,12 @@
1
1
  # coding: utf-8
2
2
  # frozen_string_literal: true
3
+
3
4
  lib = File.expand_path('../lib', __FILE__)
4
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
6
 
6
7
  Gem::Specification.new do |spec|
7
8
  spec.name = "database_rewinder"
8
- spec.version = '0.8.3'
9
+ spec.version = '0.9.4'
9
10
  spec.authors = ["Akira Matsuda"]
10
11
  spec.email = ["ronnie@dio.jp"]
11
12
  spec.description = "A minimalist's tiny and ultra-fast database cleaner"
@@ -18,7 +19,7 @@ Gem::Specification.new do |spec|
18
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
20
  spec.require_paths = ["lib"]
20
21
 
21
- spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency 'bundler'
22
23
  spec.add_development_dependency "rake"
23
24
  spec.add_development_dependency 'test-unit-rails'
24
25
  spec.add_development_dependency 'rails'
@@ -3,6 +3,7 @@ source 'https://rubygems.org'
3
3
  gem 'rails', '~> 4.0.0'
4
4
  gem 'pg', '~> 0.21'
5
5
  gem 'mysql2', '~> 0.3.10'
6
+ gem 'sqlite3', '< 1.4'
6
7
  gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
7
8
 
8
9
  gemspec path: '../'
@@ -3,6 +3,7 @@ source 'https://rubygems.org'
3
3
  gem 'rails', '~> 4.1.0'
4
4
  gem 'pg', '~> 0.21'
5
5
  gem 'mysql2', '~> 0.3.13'
6
+ gem 'sqlite3', '< 1.4'
6
7
  gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
7
8
 
8
9
  gemspec path: '../'
@@ -2,6 +2,8 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 4.2.0'
4
4
  gem 'pg', '~> 0.21'
5
+ gem 'mysql2', '~> 0.4.0'
6
+ gem 'sqlite3', '< 1.4'
5
7
  gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
6
8
 
7
9
  gemspec path: '../'
@@ -2,5 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 5.0.0'
4
4
  gem 'pg', '~> 0.21'
5
+ gem 'sqlite3', '< 1.4'
5
6
 
6
7
  gemspec path: '../'
@@ -2,5 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 5.1.0'
4
4
  gem 'pg', '~> 0.21'
5
+ gem 'capybara', '~> 2.13'
6
+ gem 'puma'
5
7
 
6
8
  gemspec path: '../'
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '~> 5.2.0', git: 'https://github.com/rails/rails', branch: '5-2-stable'
4
+ gem 'pg', '~> 0.21'
5
+
6
+ gemspec path: '../'
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '~> 6.0.0'
4
+ gem 'selenium-webdriver'
5
+
6
+ gemspec path: '../'
@@ -5,6 +5,6 @@ git_source(:github) do |repo_name|
5
5
  end
6
6
 
7
7
  gem 'rails', github: 'rails/rails'
8
- gem 'arel', github: 'rails/arel'
8
+ gem 'selenium-webdriver'
9
9
 
10
10
  gemspec path: '../'
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
- require_relative 'database_rewinder/cleaner'
3
2
 
4
3
  module DatabaseRewinder
5
4
  VERSION = Gem.loaded_specs['database_rewinder'].version.to_s
@@ -48,13 +47,15 @@ module DatabaseRewinder
48
47
  end
49
48
  end or return
50
49
 
51
- match = sql.match(/\A\s*INSERT(?:\s+IGNORE)?(?:\s+INTO)?\s+(?:\.*[`"]?([^.\s`"]+)[`"]?)*/i)
52
- return unless match
50
+ sql.split(';').each do |statement|
51
+ match = statement.match(/\A\s*INSERT(?:\s+IGNORE)?(?:\s+INTO)?\s+(?:\.*[`"]?([^.\s`"(]+)[`"]?)*/i)
52
+ next unless match
53
53
 
54
- table = match[1]
55
- if table
56
- cleaner.inserted_tables << table unless cleaner.inserted_tables.include? table
57
- cleaner.pool ||= connection.pool
54
+ table = match[1]
55
+ if table
56
+ cleaner.inserted_tables << table unless cleaner.inserted_tables.include? table
57
+ cleaner.pool ||= connection.pool
58
+ end
58
59
  end
59
60
  end
60
61
 
@@ -72,7 +73,7 @@ module DatabaseRewinder
72
73
 
73
74
  # cache AR connection.tables
74
75
  def all_table_names(connection)
75
- cache_key = connection.pool.spec.config
76
+ cache_key = get_cache_key(connection.pool)
76
77
  #NOTE connection.tables warns on AR 5 with some adapters
77
78
  tables = ActiveSupport::Deprecation.silence { connection.tables }
78
79
  @table_names_cache[cache_key] ||= tables.reject do |t|
@@ -80,7 +81,17 @@ module DatabaseRewinder
80
81
  (ActiveRecord::Base.respond_to?(:internal_metadata_table_name) && (t == ActiveRecord::Base.internal_metadata_table_name))
81
82
  end
82
83
  end
84
+
85
+ def get_cache_key(connection_pool)
86
+ if connection_pool.respond_to?(:db_config) # ActiveRecord >= 6.1
87
+ connection_pool.db_config.config
88
+ else
89
+ connection_pool.spec.config
90
+ end
91
+ end
83
92
  end
93
+
94
+ private_class_method :get_cache_key
84
95
  end
85
96
 
86
97
  begin
@@ -89,4 +100,5 @@ begin
89
100
  rescue LoadError
90
101
  DatabaseRewinder.init
91
102
  require_relative 'database_rewinder/active_record_monkey'
103
+ require_relative 'database_rewinder/cleaner'
92
104
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module DatabaseRewinder
3
4
  module InsertRecorder
4
5
  def execute(sql, *)
@@ -6,9 +7,16 @@ module DatabaseRewinder
6
7
  super
7
8
  end
8
9
 
9
- def exec_query(sql, *)
10
- DatabaseRewinder.record_inserted_table self, sql
11
- super
10
+ if ActiveRecord::VERSION::MAJOR < 5
11
+ def exec_query(sql, *)
12
+ DatabaseRewinder.record_inserted_table self, sql
13
+ super
14
+ end
15
+ else
16
+ def exec_query(sql, *, **)
17
+ DatabaseRewinder.record_inserted_table self, sql
18
+ super
19
+ end
12
20
  end
13
21
  end
14
22
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require_relative 'multiple_statements_executor'
3
4
 
4
5
  using DatabaseRewinder::MultipleStatementsExecutor
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module DatabaseRewinder
3
4
  module Compatibility
4
- def clean_with(*args)
5
- cleaners.each {|c| c.clean_with(*args)}
5
+ def clean_with(*args, **opts)
6
+ cleaners.each {|c| c.clean_with(*args, **opts)}
6
7
  end
7
8
 
8
9
  def cleaning
@@ -35,7 +36,7 @@ module DatabaseRewinder
35
36
  # DatabaseRewinder[:active_record, connection: 'the_db_name']
36
37
  #
37
38
  # You can cleanup multiple databases for each test using this configuration.
38
- def [](orm, connection: nil, **)
39
+ def [](orm = nil, connection: nil, **)
39
40
  if connection.nil?
40
41
  if orm.is_a? String
41
42
  connection = orm
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module DatabaseRewinder
3
4
  class DummyModel < ActiveRecord::Base
4
5
  class << self
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module DatabaseRewinder
3
4
  module MultipleStatementsExecutor
4
5
  refine ActiveRecord::ConnectionAdapters::AbstractAdapter do
@@ -1,10 +1,13 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module DatabaseRewinder
3
4
  class Railtie < ::Rails::Railtie
4
5
  initializer 'database_rewinder', after: 'active_record.initialize_database' do
5
6
  ActiveSupport.on_load :active_record do
6
7
  DatabaseRewinder.init
7
8
  require_relative 'active_record_monkey'
9
+
10
+ require_relative 'cleaner'
8
11
  end
9
12
  end
10
13
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'test_helper'
3
4
 
4
5
  class DatabaseRewinder::InsertRecorderTest < ActiveSupport::TestCase
data/test/cleaner_test.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'test_helper'
3
4
 
4
5
  class DatabaseRewinder::CleanerTest < ActiveSupport::TestCase
@@ -1,45 +1,44 @@
1
- sqlite3: &sqlite3
1
+ <% case ENV['DB']
2
+ when 'sqlite3' %>
3
+ test:
2
4
  adapter: sqlite3
3
5
  database: db/database_rewinder_test.sqlite3
4
6
  pool: 5
5
7
  timeout: 5000
6
8
 
7
- sqlite3_2: &sqlite3_2
9
+ test2:
8
10
  adapter: sqlite3
9
11
  database: db/database_rewinder_test2.sqlite3
10
12
  pool: 5
11
13
  timeout: 5000
12
14
 
13
- mysql: &mysql
15
+ <% when 'mysql' %>
16
+ test:
14
17
  adapter: mysql2
15
18
  host: localhost
16
19
  username: root
17
20
  password:
18
21
  database: database_rewinder_test
19
22
 
20
- mysql_2: &mysql_2
23
+ test2:
21
24
  adapter: mysql2
22
25
  host: localhost
23
26
  username: root
24
27
  password:
25
28
  database: database_rewinder_test2
26
29
 
27
- postgresql: &postgresql
30
+ <% when 'postgresql' %>
31
+ test:
28
32
  adapter: postgresql
29
33
  host: localhost
30
34
  username: postgres
31
35
  password:
32
36
  database: database_rewinder_test
33
37
 
34
- postgresql_2: &postgresql_2
38
+ test2:
35
39
  adapter: postgresql
36
40
  host: localhost
37
41
  username: postgres
38
42
  password:
39
43
  database: database_rewinder_test2
40
-
41
- test:
42
- <<: *<%= ENV['DB'] %>
43
-
44
- test2:
45
- <<: *<%= "#{ENV['DB']}_2" %>
44
+ <% end %>
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'test_helper'
3
4
 
4
5
  class DatabaseRewinder::DatabaseRewinderTest < ActiveSupport::TestCase
@@ -75,6 +76,25 @@ class DatabaseRewinder::DatabaseRewinderTest < ActiveSupport::TestCase
75
76
  DatabaseRewinder.database_configuration = nil
76
77
  end
77
78
 
79
+ sub_test_case 'via General Active Record insertions' do
80
+ setup do
81
+ DatabaseRewinder.cleaners
82
+ @cleaner = DatabaseRewinder.instance_variable_get(:'@cleaners').detect {|c| c.db == (ENV['DB'] == 'sqlite3' ? 'db/database_rewinder_test.sqlite3' : 'database_rewinder_test')}
83
+ end
84
+
85
+ test 'create' do
86
+ Bar.create name: 'bar1'
87
+ assert_equal ['bars'], @cleaner.inserted_tables
88
+ end
89
+
90
+ if ActiveRecord::VERSION::STRING >= '6'
91
+ test 'insert_all' do
92
+ Bar.insert_all! [{name: 'bar1'}]
93
+ assert_equal ['bars'], @cleaner.inserted_tables
94
+ end
95
+ end
96
+ end
97
+
78
98
  sub_test_case 'common database' do
79
99
  test 'include database name' do
80
100
  perform_insert 'INSERT INTO "database"."foos" ("name") VALUES (?)'
@@ -94,6 +114,18 @@ class DatabaseRewinder::DatabaseRewinderTest < ActiveSupport::TestCase
94
114
  SQL
95
115
  assert_equal ['foos'], @cleaner.inserted_tables
96
116
  end
117
+ test 'without spaces between table name and columns list' do
118
+ perform_insert 'INSERT INTO foos(name) VALUES (?)'
119
+ assert_equal ['foos'], @cleaner.inserted_tables
120
+ end
121
+
122
+ test 'with multi statement query' do
123
+ perform_insert <<-SQL
124
+ INSERT INTO "foos" ("name") VALUES (?);
125
+ INSERT INTO "bars" ("name") VALUES (?)
126
+ SQL
127
+ assert_equal ['foos', 'bars'], @cleaner.inserted_tables
128
+ end
97
129
  end
98
130
 
99
131
  sub_test_case 'Database accepts more than one dots in an object notation (e.g. SQLServer)' do
@@ -151,7 +183,7 @@ class DatabaseRewinder::DatabaseRewinderTest < ActiveSupport::TestCase
151
183
  @except = @cleaner.instance_variable_get(:@except)
152
184
  Foo.create! name: 'foo1'
153
185
  Bar.create! name: 'bar1'
154
- DatabaseRewinder.clean_with :truncation, options
186
+ DatabaseRewinder.clean_with :truncation, **options
155
187
  end
156
188
 
157
189
  test 'with only option' do
data/test/fake_app.rb CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  ENV['DB'] ||= 'sqlite3'
4
4
  require 'active_record/railtie'
5
- load 'active_record/railties/databases.rake'
6
5
 
7
6
  module DatabaseRewinderTestApp
8
7
  Application = Class.new(Rails::Application) do
@@ -14,32 +13,34 @@ module DatabaseRewinderTestApp
14
13
  end.initialize!
15
14
  end
16
15
 
16
+ load 'active_record/railties/databases.rake'
17
+
17
18
  require 'active_record/base'
18
19
  ActiveRecord::Tasks::DatabaseTasks.root ||= Rails.root
19
- ActiveRecord::Tasks::DatabaseTasks.drop_current ENV['DB']
20
- ActiveRecord::Tasks::DatabaseTasks.drop_current "#{ENV['DB']}_2"
21
- ActiveRecord::Tasks::DatabaseTasks.create_current ENV['DB']
22
- ActiveRecord::Tasks::DatabaseTasks.create_current "#{ENV['DB']}_2"
20
+ ActiveRecord::Tasks::DatabaseTasks.drop_current 'test'
21
+ ActiveRecord::Tasks::DatabaseTasks.drop_current 'test2'
22
+ ActiveRecord::Tasks::DatabaseTasks.create_current 'test'
23
+ ActiveRecord::Tasks::DatabaseTasks.create_current 'test2'
23
24
 
24
25
  # models
25
26
  class Foo < ActiveRecord::Base; end
26
27
  class Bar < ActiveRecord::Base; end
27
28
  class Baz < ActiveRecord::Base; end
28
29
  class Quu < ActiveRecord::Base
29
- establish_connection "#{ENV['DB']}_2".to_sym
30
+ establish_connection :test2
30
31
  end
31
32
 
32
33
  # migrations
33
34
  class CreateAllTables < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration
34
35
  def self.up
35
- ActiveRecord::Base.establish_connection ENV['DB'].to_sym
36
- create_table(:bars) {|t| t.string :name }
36
+ ActiveRecord::Base.establish_connection :test
37
+ create_table(:bars) {|t| t.string :name; t.index :name, unique: true }
37
38
  create_table(:foos) {|t| t.string :name; t.references :bar, foreign_key: true }
38
39
  create_table(:bazs) {|t| t.string :name }
39
40
 
40
- test2_connection = ActiveRecord::Base.establish_connection("#{ENV['DB']}_2".to_sym).connection
41
+ test2_connection = ActiveRecord::Base.establish_connection(:test2).connection
41
42
  test2_connection.create_table(:quus) {|t| t.string :name }
42
- ActiveRecord::Base.establish_connection ENV['DB'].to_sym
43
+ ActiveRecord::Base.establish_connection :test
43
44
  end
44
45
 
45
46
  def self.down
@@ -47,8 +48,8 @@ class CreateAllTables < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migrat
47
48
  drop_table(:bars) {|t| t.string :name }
48
49
  drop_table(:bazs) {|t| t.string :name }
49
50
 
50
- test2_connection = ActiveRecord::Base.establish_connection("#{ENV['DB']}_2".to_sym).connection
51
+ test2_connection = ActiveRecord::Base.establish_connection(:test2).connection
51
52
  test2_connection.drop_table :quus
52
- ActiveRecord::Base.establish_connection ENV['DB'].to_sym
53
+ ActiveRecord::Base.establish_connection :test
53
54
  end
54
55
  end
data/test/test_helper.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  ENV['RAILS_ENV'] ||= 'test'
3
4
 
4
5
  $LOAD_PATH.unshift(File.join(__dir__, '..', 'lib'))
@@ -9,6 +10,10 @@ require 'active_record'
9
10
  require 'database_rewinder'
10
11
  require 'fake_app'
11
12
  require 'test/unit/rails/test_help'
13
+ begin
14
+ require 'selenium/webdriver' # rails 6
15
+ rescue LoadError
16
+ end
12
17
 
13
18
  migrated = ActiveRecord::Base.connection.respond_to?(:data_source_exists?) ? ActiveRecord::Base.connection.data_source_exists?('foos') : ActiveRecord::Base.connection.table_exists?('foos')
14
19
  CreateAllTables.up unless migrated
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database_rewinder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akira Matsuda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-30 00:00:00.000000000 Z
11
+ date: 2020-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.3'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -127,6 +127,8 @@ files:
127
127
  - gemfiles/rails_42.gemfile
128
128
  - gemfiles/rails_50.gemfile
129
129
  - gemfiles/rails_51.gemfile
130
+ - gemfiles/rails_52.gemfile
131
+ - gemfiles/rails_60.gemfile
130
132
  - gemfiles/rails_edge.gemfile
131
133
  - lib/database_rewinder.rb
132
134
  - lib/database_rewinder/active_record_monkey.rb
@@ -161,8 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
163
  - !ruby/object:Gem::Version
162
164
  version: '0'
163
165
  requirements: []
164
- rubyforge_project:
165
- rubygems_version: 2.7.4
166
+ rubygems_version: 3.2.0.pre1
166
167
  signing_key:
167
168
  specification_version: 4
168
169
  summary: A minimalist's tiny and ultra-fast database cleaner