Skip to content

Instantly share code, notes, and snippets.

@WaYdotNET
Created November 30, 2011 13:35
Show Gist options
  • Save WaYdotNET/1409071 to your computer and use it in GitHub Desktop.
Save WaYdotNET/1409071 to your computer and use it in GitHub Desktop.
Migrate All Of Your Model Classes When Using MiniRecord with Padrino
# /rake/minirecord.rake
namespace :mini_record do
desc "Auto migration of database"
task :migrate => :environment do
Dir["models/*.rb"].each do |file_path|
basename = File.basename(file_path, File.extname(file_path))
clazz = basename.camelize.constantize
clazz.auto_upgrade! if clazz.ancestors.include?(ActiveRecord::Base)
end
end
end
@WaYdotNET
Copy link
Author

many thx for your fix...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment