rake - how to detect whether my rails is running in migration or not in environment.rb -
Any easy way to find out? I want to leave some code in envirmonment.rb while migration rack.
I had this problem in a legacy application I was maintaining some observers who migrated to a certain point before Were interfering with them, so I disabled them during migration by checking application names and arguments
activate # supervisors who should always run # config.active_record. Supervisor =: cacher ,: garbage_collector,: migrators # migrants break migrating from VERSION xxx - disable them for Rake DB: as long as the file (.basename ($ 0) == "rake" & amp; & Amp; ARGV.include? ("DB: Migrate") config.active_record.observers =: user_observer end
Comments
Post a Comment