inspectar 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Inspectar
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/inspectar.rb CHANGED
@@ -1,12 +1,10 @@
1
1
  require "active_record"
2
2
  require "inspectar/version"
3
3
 
4
- class Connectar < ActiveRecord::Base
5
-
6
- end
7
-
8
4
  module Inspectar
9
5
 
6
+ class Connectar < ActiveRecord::Base; end
7
+
10
8
  def self.attach(params)
11
9
  ActiveRecord::Base.configurations["inspectar"] = params
12
10
  Connectar.establish_connection params
@@ -42,9 +40,7 @@ end
42
40
  end
43
41
 
44
42
  def self.fetch
45
- conn = Connectar.connection
46
- tables = conn.execute("show tables").map { |r| r[0] }
47
- tables.map{|table| {table_name: table, model_name: table.tableize.camelize.singularize}}
43
+ Connectar.connection.tables.map{|table| {table_name: table, model_name: table.tableize.camelize.singularize}}
48
44
  end
49
45
 
50
46
  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.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: