yaddl 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/yaddl.rb +2 -2
- data/lib/yaddl/version.rb +1 -1
- metadata +1 -1
data/lib/yaddl.rb
CHANGED
@@ -202,12 +202,12 @@ class Generator
|
|
202
202
|
v2 = verb == "Add" ? "To" : "On"
|
203
203
|
if changes.count > 0
|
204
204
|
index = ""
|
205
|
-
while Dir.glob("#{Rails.root}/db/migrate/*_#{summary}#{v2}#{name.pluralize}#{index}".underscore.downcase+".rb").count > 0
|
205
|
+
while Dir.glob("#{Rails.root}/db/migrate/*" + "_" + "#{summary}#{v2}#{name.pluralize}#{index}".underscore.downcase+".rb").count > 0
|
206
206
|
index = 1 if index == ""
|
207
207
|
index += 1
|
208
208
|
end
|
209
209
|
|
210
|
-
puts DateTime.now.strftime("%Y%m%d%H%M%S") + "_#{summary}#{v2}#{name.pluralize}#{index}".underscore.downcase + ".rb"
|
210
|
+
puts DateTime.now.strftime("%Y%m%d%H%M%S") + "_" + "#{summary}#{v2}#{name.pluralize}#{index}".underscore.downcase + ".rb"
|
211
211
|
File.write("#{Rails.root}/db/migrate/" + DateTime.now.strftime("%Y%m%d%H%M%S") + "_#{summary}#{v2}#{name.pluralize}#{index}".underscore.downcase+".rb", "class #{summary}#{v2}#{ name.pluralize }#{index} < ActiveRecord::Migration
|
212
212
|
def change
|
213
213
|
#{changes.join("\n ")}
|
data/lib/yaddl/version.rb
CHANGED