lib/i18n/migrations/migrator.rb in i18n-migrations-0.2.3 vs lib/i18n/migrations/migrator.rb in i18n-migrations-0.2.4
- old
+ new
@@ -38,21 +38,22 @@
file_name = "#{Time.now.strftime('%Y%m%d%H%M')}_#{name.downcase.gsub(' ', '_')}.rb"
unless Dir.exist?(config.migration_dir)
puts "Creating migration directory #{config.migration_dir} because it didn't exist."
FileUtils.mkdir_p(config.migration_dir)
end
- File.open(File.join(config.migration_dir, file_name), 'w') do |f|
+ full_file_name = File.join(config.migration_dir, file_name)
+ File.open(full_file_name, 'w') do |f|
f << <<-CONTENTS
require 'i18n-migrations'
class #{name.camelcase} < I18n::Migrations::Migration
def change
# add('foo.bar', 'The foo of the bar')
end
end
CONTENTS
end
- puts "Wrote new migration to #{file_name}"
+ puts "Wrote new migration to #{full_file_name}"
end
def migrate(locale_or_all = 'all')
each_locale(locale_or_all) do |locale|
locale.update_info do |data, notes|