wraithdb 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,5 +1,6 @@
1
1
  *.gem
2
2
  *.rbc
3
+ .rvmrc
3
4
  .bundle
4
5
  .config
5
6
  .yardoc
@@ -6,8 +6,9 @@ module ActiveRecord
6
6
  begin
7
7
  ActiveSupport.run_load_hooks(:active_record_connection_established, connection)
8
8
  rescue StandardError => e
9
- # ActiveImport will not work but this shouldn't be an issue as it's only used in Rake tasks.
10
- # If the DB is down we won't be importing anything in a rake task anyhow.
9
+ # ActiveImport will not work but this shouldn't be an issue as it's
10
+ # only used in Rake tasks. If the DB is down we won't be importing
11
+ # anything in a rake task anyhow.
11
12
  end
12
13
  end
13
14
  alias establish_connection establish_connection_with_activerecord_import
@@ -10,6 +10,7 @@ module ActiveRecord
10
10
  # instance variable
11
11
  base = self
12
12
  rel = relation_without_db_charmer
13
+
13
14
  rel.define_singleton_method(:db_charmer_connection) do
14
15
  base.connection
15
16
  end
@@ -34,6 +34,7 @@ module ActiveRecord
34
34
  end
35
35
  end
36
36
  alias_method_chain :columns, :wraithdb_columns
37
+
37
38
  end
38
39
  end
39
40
  end
@@ -1,6 +1,6 @@
1
1
  module WraithDB
2
2
  module Adapters
3
- class Default < ActiveRecord::ConnectionAdapters::AbstractAdapter
3
+ class DefaultAdapter < ActiveRecord::ConnectionAdapters::AbstractAdapter
4
4
  include WraithFunctionality
5
5
 
6
6
  def adapter_name
@@ -7,7 +7,7 @@ module WraithDB
7
7
  @limit = column_definition.limit
8
8
  @precision = column_definition.precision
9
9
  @scale = column_definition.scale
10
- @type = (column_definition.type == :primary_key) ? :integer : column_definition.type
10
+ @type = (column_definition.type == :primary_key) ? :integer : column_definition.type.to_sym
11
11
  @default = column_definition.default
12
12
  @primary = column_definition.type == :primary_key
13
13
  @coder = nil
@@ -9,8 +9,9 @@ module WraithDB
9
9
  end
10
10
 
11
11
  def connection
12
- load
13
12
  @connection ||= build_connection
13
+ load
14
+ @connection
14
15
  end
15
16
 
16
17
  def build_connection
@@ -41,7 +42,6 @@ module WraithDB
41
42
  else
42
43
  raise StandardError.new("Invalid format for #{file}.")
43
44
  end
44
-
45
45
  instance_eval(source)
46
46
  end
47
47
  end
@@ -1,3 +1,3 @@
1
1
  module Wraithdb
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wraithdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-07 00:00:00.000000000 Z
12
+ date: 2013-01-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord