Skip to content

Commit

Permalink
Generate migrations in the default Rails way
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Jun 13, 2016
1 parent 218f9c6 commit 779b3f5
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 45 deletions.
31 changes: 0 additions & 31 deletions lib/generators/curation_concerns/abstract_migration_generator.rb

This file was deleted.

18 changes: 4 additions & 14 deletions lib/generators/curation_concerns/models_generator.rb
@@ -1,28 +1,18 @@
require_relative 'abstract_migration_generator'

class CurationConcerns::ModelsGenerator < CurationConcerns::AbstractMigrationGenerator
class CurationConcerns::ModelsGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
argument :model_name, type: :string, default: 'user'
desc '
This generator makes the following changes to your application:
1. Creates several database migrations if they do not exist in /db/migrate
2. Creates the curation_concerns.rb configuration file and several others
3. Creates the file_set.rb and collection.rb models
1. Creates the curation_concerns.rb configuration file and several others
2. Creates the file_set.rb and collection.rb models
'
def banner
say_status('warning', 'GENERATING CURATION_CONCERNS MODELS', :yellow)
end

# Setup the database migrations
def copy_migrations
[
'create_version_committers.rb',
'create_checksum_audit_logs.rb',
'create_single_use_links.rb',
'create_operations.rb'
].each do |file|
better_migration_template file
end
rake 'curation_concerns:install:migrations'
end

# Add behaviors to the user model
Expand Down

0 comments on commit 779b3f5

Please sign in to comment.