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 +12 -12
- data/lib/use_db.rb +1 -0
- data/lib/use_db/version.rb +1 -1
- metadata +1 -1
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
|
-
|
6
|
-
|
7
|
-
|
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
|
-
|
10
|
+
else
|
11
11
|
ActiveRecord::Base.connection.send(method, *arguments, &block)
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
data/lib/use_db/version.rb
CHANGED