seed_data_migrations 0.0.1.11 → 0.0.1.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,19 @@
1
+ class SeedDataMigrationsGenerator < Rails::Generators::NamedBase
2
+ source_root File.expand_path("../templates", __FILE__)
3
+
4
+ def create_data_migration_file
5
+ #copy_file "seed_migrations_migration.rb", "db/seeds/#{file_name}.rb"
6
+ create_file "db/seeds/#{next_migration_number}_#{file_name}.rb", <<-FILE
7
+ class #{file_name.camelize} < ActiveRecord::DataMigration
8
+ def up
9
+ #
10
+ end
11
+ end
12
+
13
+ FILE
14
+ end
15
+
16
+ def next_migration_number
17
+ Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
18
+ end
19
+ end
@@ -0,0 +1,5 @@
1
+ class #{file_name} < ActiveRecord::DataMigration
2
+ def up
3
+ #
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module SeedDataMigrations
2
- VERSION = "0.0.1.11"
2
+ VERSION = "0.0.1.12"
3
3
  end
@@ -29,6 +29,12 @@ db_namespace = namespace :db do
29
29
  db_namespace['_dump'].invoke
30
30
  end
31
31
 
32
+ # desc 'creates a new data migration.'
33
+ #task :new => [:environment, :load_config] do
34
+ # version = ENV['VERSION'] ? ENV['VERSION'].to_i : nil
35
+ # raise 'VERSION is required' unless version
36
+ #end
37
+
32
38
  desc 'Display status of migrations'
33
39
  task :status => [:environment, :load_config] do
34
40
  unless ActiveRecord::Base.connection.table_exists?(ActiveRecord::DataMigrator.schema_data_migrations_table_name)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seed_data_migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.11
4
+ version: 0.0.1.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -54,6 +54,8 @@ extra_rdoc_files: []
54
54
  files:
55
55
  - db/migrate/20140220214847_add_seed_migrations_table.rb
56
56
  - lib/generators/seed_data_migrations/install/install_generator.rb
57
+ - lib/generators/seed_data_migrations/install/seed_data_migrations_generator.rb
58
+ - lib/generators/seed_data_migrations/templates/seed_data_migrations.rb
57
59
  - lib/generators/seed_data_migrations/templates/seed_migrations_migration.rb
58
60
  - lib/seed_data_migrations/data_migration.rb
59
61
  - lib/seed_data_migrations/engine.rb