foreigner 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/lib/foreigner.rb +2 -0
- data/lib/foreigner/loader.rb +20 -0
- data/lib/foreigner/railtie.rb +1 -16
- metadata +8 -7
data/README.rdoc
CHANGED
data/lib/foreigner.rb
CHANGED
@@ -3,6 +3,7 @@ require 'active_support/all'
|
|
3
3
|
module Foreigner
|
4
4
|
extend ActiveSupport::Autoload
|
5
5
|
autoload :Adapter
|
6
|
+
autoload :Loader
|
6
7
|
autoload :SchemaDumper
|
7
8
|
|
8
9
|
module ConnectionAdapters
|
@@ -24,5 +25,6 @@ Foreigner::Adapter.register 'mysql', 'foreigner/connection_adapters/mysql_adapte
|
|
24
25
|
Foreigner::Adapter.register 'mysql2', 'foreigner/connection_adapters/mysql2_adapter'
|
25
26
|
Foreigner::Adapter.register 'jdbcmysql', 'foreigner/connection_adapters/mysql2_adapter'
|
26
27
|
Foreigner::Adapter.register 'postgresql', 'foreigner/connection_adapters/postgresql_adapter'
|
28
|
+
Foreigner::Adapter.register 'jdbcpostgresql', 'foreigner/connection_adapters/postgresql_adapter'
|
27
29
|
|
28
30
|
require 'foreigner/railtie' if defined?(Rails)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Foreigner
|
2
|
+
def self.load
|
3
|
+
ActiveRecord::ConnectionAdapters.module_eval do
|
4
|
+
include Foreigner::ConnectionAdapters::SchemaStatements
|
5
|
+
include Foreigner::ConnectionAdapters::SchemaDefinitions
|
6
|
+
end
|
7
|
+
|
8
|
+
ActiveRecord::SchemaDumper.class_eval do
|
9
|
+
include Foreigner::SchemaDumper
|
10
|
+
end
|
11
|
+
|
12
|
+
if defined?(ActiveRecord::Migration::CommandRecorder)
|
13
|
+
ActiveRecord::Migration::CommandRecorder.class_eval do
|
14
|
+
include Foreigner::Migration::CommandRecorder
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
Foreigner::Adapter.load!
|
19
|
+
end
|
20
|
+
end
|
data/lib/foreigner/railtie.rb
CHANGED
@@ -2,22 +2,7 @@ module Foreigner
|
|
2
2
|
class Railtie < Rails::Railtie
|
3
3
|
initializer 'foreigner.load_adapter' do
|
4
4
|
ActiveSupport.on_load :active_record do
|
5
|
-
|
6
|
-
include Foreigner::ConnectionAdapters::SchemaStatements
|
7
|
-
include Foreigner::ConnectionAdapters::SchemaDefinitions
|
8
|
-
end
|
9
|
-
|
10
|
-
ActiveRecord::SchemaDumper.class_eval do
|
11
|
-
include Foreigner::SchemaDumper
|
12
|
-
end
|
13
|
-
|
14
|
-
if defined?(ActiveRecord::Migration::CommandRecorder)
|
15
|
-
ActiveRecord::Migration::CommandRecorder.class_eval do
|
16
|
-
include Foreigner::Migration::CommandRecorder
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
Foreigner::Adapter.load!
|
5
|
+
Foreigner.load
|
21
6
|
end
|
22
7
|
end
|
23
8
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreigner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-03-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
16
|
-
requirement: &
|
16
|
+
requirement: &70307096756980 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.0.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70307096756980
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activerecord
|
27
|
-
requirement: &
|
27
|
+
requirement: &70307096755960 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: 3.1.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70307096755960
|
36
36
|
description: Adds helpers to migrations and dumps foreign keys to schema.rb
|
37
37
|
email: developer@matthewhiggins.com
|
38
38
|
executables: []
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- lib/foreigner/connection_adapters/mysql_adapter.rb
|
51
51
|
- lib/foreigner/connection_adapters/postgresql_adapter.rb
|
52
52
|
- lib/foreigner/connection_adapters/sql2003.rb
|
53
|
+
- lib/foreigner/loader.rb
|
53
54
|
- lib/foreigner/migration/command_recorder.rb
|
54
55
|
- lib/foreigner/railtie.rb
|
55
56
|
- lib/foreigner/schema_dumper.rb
|
@@ -81,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
82
|
version: 1.3.5
|
82
83
|
requirements: []
|
83
84
|
rubyforge_project: foreigner
|
84
|
-
rubygems_version: 1.8.
|
85
|
+
rubygems_version: 1.8.17
|
85
86
|
signing_key:
|
86
87
|
specification_version: 3
|
87
88
|
summary: Foreign Keys for Rails
|