Skip to content

Commit

Permalink
Prepare the database all in one step, removing another rake task.
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed Dec 6, 2014
1 parent 5b56ec2 commit f1602a8
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions core/lib/generators/refinery/cms/cms_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ def generate

run_additional_generators! if self.options[:fresh_installation]

migrate_database!

seed_database!
prepare_database!

deploy_to_hosting?
end
Expand Down Expand Up @@ -204,10 +202,13 @@ def manage_roadblocks!
end
end

def migrate_database!
def prepare_database!
unless self.options[:skip_migrations]
command = %w[railties:install:migrations]
command |= %w[db:create db:migrate] unless self.options[:skip_db]
unless self.options[:skip_db]
command |= %w[db:create db:migrate]
command |= %w[db:seed] unless self.options[:skip_migrations]
end
rake command.join(' ')
end
end
Expand Down Expand Up @@ -263,10 +264,6 @@ def sanity_check_heroku_application_name!
options[:heroku] = '' if options[:heroku] == 'heroku'
end

def seed_database!
rake 'db:seed' unless self.options[:skip_db] || self.options[:skip_migrations]
end

def start_pretending?
# Only pretend to do the next actions if this is Refinery to stay DRY
if destination_path == Refinery.root
Expand Down

0 comments on commit f1602a8

Please sign in to comment.