Sha256: 65a8cf581c52637584685026d51619d12a2628b5535618da199621b0d70d9b22
Contents?: true
Size: 893 Bytes
Versions: 14
Compression:
Stored size: 893 Bytes
Contents
# Require this file to append Penthouse rake tasks to ActiveRecord db rake tasks # Enabled by default in the initializer # shamelessly copied & adjusted from Apartment # @see https://github.com/influitive/apartment/blob/development/lib/apartment/tasks/enhancements.rb module Penthouse class RakeTaskEnhancer TASKS = %w(db:migrate db:rollback db:migrate:up db:migrate:down db:migrate:redo db:seed) class << self def enhance! TASKS.each do |name| task = Rake::Task[name] task.enhance do if should_enhance? enhance_task(task) end end end end def should_enhance? Penthouse.configuration.migrate_tenants? end def enhance_task(task) Rake::Task[task.name.sub(/db:/, 'penthouse:')].invoke end end end end Penthouse::RakeTaskEnhancer.enhance!
Version data entries
14 entries across 14 versions & 1 rubygems