Sha256: 462035ad46a810555799849506dec33fe00d7d43a70f87bec2cfeb784c97bf31

Contents?: true

Size: 1.01 KB

Versions: 3

Compression:

Stored size: 1.01 KB

Contents

# encoding: utf-8
module MagicRecipes
  module Db
    def self.load_into(configuration)
      configuration.load do
        
        namespace :db do
          
          desc "seed the database"
          task :seed do
            if use_rvm
              run <<-CMD
                #{rvm_cmd} && 
                cd #{latest_release} && 
                #{rake} db:seed RAILS_ENV=#{rails_env}
              CMD
            else
              run "cd #{latest_release} && #{rake} db:seed RAILS_ENV=#{rails_env}"
            end
          end
  
          desc "migrate the database"
          task :migrate do
            if use_rvm
              run <<-CMD
                #{rvm_cmd} && 
                cd #{latest_release} && 
                #{rake} db:migrate RAILS_ENV=#{rails_env}
              CMD
            else
              run "cd #{latest_release} && #{rake} db:migrate RAILS_ENV=#{rails_env}"
            end
          end
          
        end
        
        # eof
        
      end
    end
  end
end



        

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
magic_recipes-0.0.7 lib/magic_recipes/db.rb
magic_recipes-0.0.6 lib/magic_recipes/db.rb
magic_recipes-0.0.5 lib/magic_recipes/db.rb