Sha256: 275fd81f65a2120ea630b7c1568bdb43a4efc117fe91229d95b0a5f145ecd3f3

Contents?: true

Size: 1.19 KB

Versions: 2

Compression:

Stored size: 1.19 KB

Contents

desc "Add schema information (as comments) to model and fixture files"
task :annotate_models => :environment do
  require File.join(File.dirname(__FILE__), '..', 'annotate/annotate_models')
  options={}
  options[:position_in_class]   = ENV['position_in_class']   || ENV['position'] || :before
  options[:position_in_factory] = ENV['position_in_factory'] || ENV['position'] || :before
  options[:position_in_fixture] = ENV['position_in_fixture'] || ENV['position'] || :before
  options[:show_indexes]        = ENV['show_indexes']
  options[:simple_indexes]      = ENV['simple_indexes']
  options[:model_dir]           = ENV['model_dir']
  options[:include_version]     = ENV['include_version']
  options[:require]             = ENV['require'] ? ENV['require'].split(', ') : []
  options[:exclude_tests]       = ENV['exclude_tests']
  options[:exclude_fixtures]    = ENV['exclude_fixtures']
  AnnotateModels.do_annotations(options)
end

desc "Remove schema information from model and fixture files"
task :remove_annotation => :environment do
  require File.join(File.dirname(__FILE__), '..', 'annotate/annotate_models')
  options={}
  options[:model_dir] = ENV['model_dir']
  AnnotateModels.remove_annotations(options)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
annotated_models-3.0.2 lib/tasks/annotate_models.rake
annotated_models-3.0.0 lib/tasks/annotate_models.rake