foreigner 1.7.2 → 1.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/foreigner/helper.rb +2 -2
- data/lib/foreigner/schema_dumper.rb +6 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06dda6720913150207e47f83ac7b0cd2596a7b03
|
4
|
+
data.tar.gz: 0fc6f018adc7a26c4209075eab475107e4d244b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c396e9fc220a759ce00c400f7ef7b0e0f2a85bd254eb6fb554156f3f82d5700274d1bff408ffde47ffaebf813d144fa058d86751d2c186245aa948d3271305b4
|
7
|
+
data.tar.gz: 5f420b8ca90be4d2f3ba21b265e4c544ded45b749d767a1f5cd66dc715efe65f3f32cfabc00e861490f45c306894e4ec3c945dc5e2a571a9aa90460347535105
|
data/lib/foreigner/helper.rb
CHANGED
@@ -2,9 +2,9 @@ module Foreigner
|
|
2
2
|
module Helper
|
3
3
|
def self.active_record_version
|
4
4
|
if ::ActiveRecord.respond_to? :version
|
5
|
-
ActiveRecord.version
|
5
|
+
ActiveRecord.version
|
6
6
|
elsif ::ActiveRecord::VERSION
|
7
|
-
::ActiveRecord::VERSION
|
7
|
+
Gem::Version.new(::ActiveRecord::VERSION)
|
8
8
|
else
|
9
9
|
raise "Unknown ActiveRecord Version API"
|
10
10
|
end
|
@@ -40,12 +40,17 @@ module Foreigner
|
|
40
40
|
module_function :remove_prefix_and_suffix
|
41
41
|
end
|
42
42
|
|
43
|
+
def requires_foreigner_load?
|
44
|
+
major, minor, patch = Foreigner::Helper.active_record_version.segments
|
45
|
+
major == 4 && minor == 1 && patch >= 9
|
46
|
+
end
|
47
|
+
|
43
48
|
def tables_with_foreign_keys(stream)
|
44
49
|
tables_without_foreign_keys(stream)
|
45
50
|
# Ensure Foreigner to be initialized before running foreign_keys.
|
46
51
|
# This is required since schema::load is not initializing the environment
|
47
52
|
# anymore in Rails 4.1.9 (https://github.com/rails/rails/commit/5d6bb89f)
|
48
|
-
stream.puts ' Foreigner.load' if
|
53
|
+
stream.puts ' Foreigner.load' if requires_foreigner_load?
|
49
54
|
@connection.tables.sort.each do |table|
|
50
55
|
next if ['schema_migrations', ignore_tables].flatten.any? do |ignored|
|
51
56
|
case ignored
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreigner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Higgins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
version: 1.3.5
|
109
109
|
requirements: []
|
110
110
|
rubyforge_project: foreigner
|
111
|
-
rubygems_version: 2.
|
111
|
+
rubygems_version: 2.4.5
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: Foreign Keys for Rails
|