lib/tasks/my.rake in borda-0.0.11 vs lib/tasks/my.rake in borda-0.0.12
- old
+ new
@@ -6,18 +6,23 @@
desc 'load migrations'
task :oyaeby do
require 'rubygems'
require 'rubygems/gem_runner'
- require 'ruby-debug'
+ #require 'ruby-debug'
Rake::Task[:environment].invoke
Rake::Task["db:load_config"].invoke
ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
migrate_path = 'db/migrate'
- debugger
+ seed_file = File.join(Rails.root, 'db', 'seeds.rb')
+ #debugger
if Rails::configuration.gems.map(&:name).include?('borda')
- migrate_path = Gem.searcher.find('borda').full_gem_path + '/db/migrate'
- end
+ borda_gem_path = Gem.searcher.find('borda').full_gem_path
+ migrate_path = borda_gem_path + '/db/migrate'
+ seed_file = File.join(borda_gem_path, 'db', 'seeds.rb')
+ end
ActiveRecord::Migrator.migrate(migrate_path, ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
+ load(seed_file) if File.exist?(seed_file)
end
+
end
\ No newline at end of file