inspectar 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module Inspectar
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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]} < Connectar
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inspectar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: