seed_data_migrations 0.0.1.12 → 0.0.1.13
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
|
|
1
1
|
class SeedDataMigrationsGenerator < Rails::Generators::NamedBase
|
2
2
|
source_root File.expand_path("../templates", __FILE__)
|
3
3
|
|
4
|
-
def
|
4
|
+
def generate_seed_data_migrations
|
5
5
|
#copy_file "seed_migrations_migration.rb", "db/seeds/#{file_name}.rb"
|
6
6
|
create_file "db/seeds/#{next_migration_number}_#{file_name}.rb", <<-FILE
|
7
7
|
class #{file_name.camelize} < ActiveRecord::DataMigration
|
@@ -12,7 +12,7 @@ end
|
|
12
12
|
|
13
13
|
FILE
|
14
14
|
end
|
15
|
-
|
15
|
+
private
|
16
16
|
def next_migration_number
|
17
17
|
Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
|
18
18
|
end
|