Sha256: 23477d73cc6332de2573aedbab61deb7cf42314496282d56c09cc037316fef79

Contents?: true

Size: 913 Bytes

Versions: 16

Compression:

Stored size: 913 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
    [:change, :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 || (ENV['skip_on_db_migrate'] =~ /(true|t|yes|y|1)$/i)
        @@working = true
        Rake::Task['annotate_models'].invoke 
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/annotate-2.6.10/lib/tasks/migrate.rake
annotate-2.6.10 lib/tasks/migrate.rake
annotate-2.6.9 lib/tasks/migrate.rake
annotate-2.6.8 lib/tasks/migrate.rake
annotate-2.6.7 lib/tasks/migrate.rake
annotate-2.6.6 lib/tasks/migrate.rake
annotate-2.6.5 lib/tasks/migrate.rake
annotate-2.6.3 lib/tasks/migrate.rake
annotate-2.6.2 lib/tasks/migrate.rake
annotate-2.6.1 tasks/migrate.rake
annotate-2.6.0 tasks/migrate.rake
annotate-2.6.0.beta2 tasks/migrate.rake
annotate-2.5.0 tasks/migrate.rake
annotate-2.5.0.pre3 tasks/migrate.rake
annotate-2.5.0.pre2 tasks/migrate.rake
annotate-2.5.0.pre1 tasks/migrate.rake