inspectar 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/inspectar/version.rb +1 -1
- data/lib/inspectar.rb +4 -2
- metadata +1 -1
data/lib/inspectar/version.rb
CHANGED
data/lib/inspectar.rb
CHANGED
@@ -8,6 +8,7 @@ end
|
|
8
8
|
module Inspectar
|
9
9
|
|
10
10
|
def self.attach(params)
|
11
|
+
ActiveRecord::Base.configurations["inspectar"] = params
|
11
12
|
Connectar.establish_connection params
|
12
13
|
connection_handle = Connectar.connection
|
13
14
|
end
|
@@ -22,7 +23,8 @@ module Inspectar
|
|
22
23
|
|
23
24
|
def self.class_definition(table_data)
|
24
25
|
%Q{
|
25
|
-
class #{table_data[:model_name]} <
|
26
|
+
class #{table_data[:model_name]} < ActiveRecord::Base
|
27
|
+
establish_connection "inspectar"
|
26
28
|
self.table_name = '#{table_data[:table_name]}'
|
27
29
|
self.inheritance_column = :_type_disabled
|
28
30
|
end
|
@@ -45,4 +47,4 @@ end
|
|
45
47
|
tables.map{|table| {table_name: table, model_name: table.tableize.camelize.singularize}}
|
46
48
|
end
|
47
49
|
|
48
|
-
end
|
50
|
+
end
|