use_db 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/migration.rb CHANGED
@@ -2,20 +2,20 @@ module ActiveRecord
2
2
  class Migration
3
3
  class << self
4
4
  def method_missing(method, *arguments, &block)
5
- say_with_time "#{method}(#{arguments.map { |a| a.inspect }.join(", ")})" do
6
- arguments[0] = Migrator.proper_table_name(arguments.first) unless arguments.empty? || method == :execute
7
- if (self.respond_to?(:database_model))
5
+ say_with_time "#{method}(#{arguments.map { |a| a.inspect }.join(", ")})" do
6
+ arguments[0] = Migrator.proper_table_name(arguments.first) unless arguments.empty? || method == :execute
7
+ if (self.respond_to?(:database_model))
8
8
  write "Using custom database model's connection (#{self.database_model}) for this migration"
9
9
  eval("#{self.database_model}.connection.send(method, *arguments, &block)")
10
- else
10
+ else
11
11
  ActiveRecord::Base.connection.send(method, *arguments, &block)
12
- end
13
- end
14
- end
15
-
16
- def uses_db?
17
- true
18
- end
19
- end
12
+ end
13
+ end
14
+ end
15
+
16
+ def uses_db?
17
+ true
18
+ end
19
+ end
20
20
  end
21
21
  end
data/lib/use_db.rb CHANGED
@@ -61,3 +61,4 @@ end
61
61
  ActiveRecord::Base.extend UseDb
62
62
 
63
63
  # require 'use_db_test_setup'
64
+ require 'migration'
@@ -1,3 +1,3 @@
1
1
  module UseDb
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: use_db
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.2
5
+ version: 0.1.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ron Guarisco