active_record_doctor 1.2.0 → 1.2.1

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
  SHA1:
3
- metadata.gz: abe58ec722187467c43488a8959c9759485ed96f
4
- data.tar.gz: 3e50e32c702cd411951f28d842e21cc289fe0cfd
3
+ metadata.gz: 77e91d88c73c0abde19b07e156c791786f7ece7c
4
+ data.tar.gz: 9a3621215ceebc560e49479cca23580a90d8d186
5
5
  SHA512:
6
- metadata.gz: ad20a9304b9683357cc43c9d8828a31de92e74f21d76727b5d33692f4f8d8e1efa171b2b95bb502f4c825e63043413a7315a6ee1898a283bbb448e844a90230b
7
- data.tar.gz: a859ed729543f9dc73ec67b4287efa671e9fede784e14b09e933861458aefee7c9eb949f59adfdd9b7652b42a35ea53ce96309150864e0373a6a5b6aa7acb2cf
6
+ metadata.gz: 699fb4ecf72daf74007b931a3cbb47d80c15a63f3c550249b34f71d75b24c52dee4a2e7c385b30af60593f4e0d78b243a888fcd20a0bf0df74d05b5dd66e2ce7
7
+ data.tar.gz: bfa9df22d097a869538fa7f939841bcfb17cc2ca5b67484f1f091a04614b90f545cc16c2ddff43b496ea669235b833fe314a7222ec6c43e0b8c124ad2aabea9c
@@ -0,0 +1,11 @@
1
+ module ActiveRecordDoctor
2
+ module Compatibility
3
+ def connection_tables
4
+ if Rails::VERSION::MAJOR == 5
5
+ connection.data_sources
6
+ else
7
+ connection.tables
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,8 +1,11 @@
1
+ require "active_record_doctor/compatibility"
1
2
  require "active_record_doctor/printers/io_printer"
2
3
 
3
4
  module ActiveRecordDoctor
4
5
  module Tasks
5
6
  class ExtraneousIndexes
7
+ include Compatibility
8
+
6
9
  def self.run
7
10
  new.run
8
11
  end
@@ -91,7 +94,7 @@ module ActiveRecordDoctor
91
94
  end
92
95
 
93
96
  def tables
94
- @tables ||= connection.tables
97
+ @tables ||= connection_tables
95
98
  end
96
99
 
97
100
  def connection
@@ -1,8 +1,11 @@
1
+ require "active_record_doctor/compatibility"
1
2
  require "active_record_doctor/printers/io_printer"
2
3
 
3
4
  module ActiveRecordDoctor
4
5
  module Tasks
5
6
  class UnindexedForeignKeys
7
+ include Compatibility
8
+
6
9
  def self.run
7
10
  new.run
8
11
  end
@@ -18,7 +21,7 @@ module ActiveRecordDoctor
18
21
  private
19
22
 
20
23
  def unindexed_foreign_keys
21
- hash_from_pairs(connection.tables.select do |table|
24
+ hash_from_pairs(connection_tables.select do |table|
22
25
  "schema_migrations" != table
23
26
  end.map do |table|
24
27
  [
@@ -1,3 +1,3 @@
1
1
  module ActiveRecordDoctor
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -13,8 +13,13 @@ Rails.application.configure do
13
13
  config.eager_load = false
14
14
 
15
15
  # Configure static file server for tests with Cache-Control for performance.
16
- config.serve_static_files = true
17
- config.static_cache_control = 'public, max-age=3600'
16
+ if Rails::VERSION::MAJOR == 5
17
+ config.public_file_server.enabled = true
18
+ config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
19
+ else
20
+ config.serve_static_files = true
21
+ config.static_cache_control = 'public, max-age=3600'
22
+ end
18
23
 
19
24
  # Show full error reports and disable caching.
20
25
  config.consider_all_requests_local = true
metadata CHANGED
@@ -1,41 +1,53 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_doctor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Navis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-24 00:00:00.000000000 Z
11
+ date: 2016-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - "<"
18
+ - !ruby/object:Gem::Version
19
+ version: '5.1'
20
+ - - ">="
18
21
  - !ruby/object:Gem::Version
19
22
  version: '4.2'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - "<"
28
+ - !ruby/object:Gem::Version
29
+ version: '5.1'
30
+ - - ">="
25
31
  - !ruby/object:Gem::Version
26
32
  version: '4.2'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rails
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - "~>"
37
+ - - "<"
38
+ - !ruby/object:Gem::Version
39
+ version: '5.1'
40
+ - - ">="
32
41
  - !ruby/object:Gem::Version
33
42
  version: '4.2'
34
43
  type: :development
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
38
- - - "~>"
47
+ - - "<"
48
+ - !ruby/object:Gem::Version
49
+ version: '5.1'
50
+ - - ">="
39
51
  - !ruby/object:Gem::Version
40
52
  version: '4.2'
41
53
  - !ruby/object:Gem::Dependency
@@ -77,6 +89,7 @@ files:
77
89
  - README.md
78
90
  - Rakefile
79
91
  - lib/active_record_doctor.rb
92
+ - lib/active_record_doctor/compatibility.rb
80
93
  - lib/active_record_doctor/printers.rb
81
94
  - lib/active_record_doctor/printers/io_printer.rb
82
95
  - lib/active_record_doctor/railtie.rb