Created
November 30, 2011 13:35
-
-
Save WaYdotNET/1409071 to your computer and use it in GitHub Desktop.
Migrate All Of Your Model Classes When Using MiniRecord with Padrino
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
many thx for your fix...