Sha256: 6ff98e56906cb52e22326b519697e3e600adc93b3c140a6853423a0d9b921692

Contents?: true

Size: 846 Bytes

Versions: 6

Compression:

Stored size: 846 Bytes

Contents

# These tasks are added to the project if you install annotate as a Rails plugin.
# (They are not used to build annotate itself.)

# Append annotations to Rake tasks for ActiveRecord, so annotate automatically gets
# run after doing db:migrate. 
# Unfortunately it relies on ENV for options; it'd be nice to be able to set options
# in a per-project config file so this task can read them.
namespace :db do
  task :migrate do
    Annotate::Migration.update_annotations
  end

  namespace :migrate do
    [:up, :down, :reset, :redo].each do |t|
      task t do
        Annotate::Migration.update_annotations
      end
    end
  end
end

module Annotate
  class Migration
    @@working = false

    def self.update_annotations
      unless @@working
        @@working = true
        Rake::Task['annotate_models'].invoke
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 4 rubygems

Version Path
netsign-annotate-2.4.5 tasks/migrate.rake
netsign-annotate-2.4.4 tasks/migrate.rake
doubledrones-annotate-2.4.0.2 tasks/migrate.rake
doubledrones-annotate-2.4.0.1 tasks/migrate.rake
masa-iwasaki-annotate-2.4.2 tasks/migrate.rake
annotate-2.4.0 tasks/migrate.rake