Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/tasks/annotate_models.rake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
desc "Add schema information (as comments) to model and fixture files"
task :annotate_models => :environment do
require 'annotate/annotate_models'
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'annotate', 'annotate_models'))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is the right way to fix this. I'd avoid doing a require with full path.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

require with full path is supposed to be OK in Ruby 1.9 -- it won't require the same file twice no matter what (knock wood)

options={}
options[:position_in_class] = ENV['position_in_class'] || ENV['position'] || :before
options[:position_in_fixture] = ENV['position_in_fixture'] || ENV['position'] || :before
Expand All @@ -14,7 +14,7 @@ end

desc "Remove schema information from model and fixture files"
task :remove_annotation => :environment do
require 'annotate/annotate_models'
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'annotate', 'annotate_models'))
options={}
options[:model_dir] = ENV['model_dir']
AnnotateModels.remove_annotations(options)
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/annotate_routes.rake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
desc "Prepends the route map to the top of routes.rb"
task :annotate_routes do
require 'annotate/annotate_routes'
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'annotate', 'annotate_routes'))
AnnotateRoutes.do_annotate
end