Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

To auto-invoke on rake:db:migrate in Rails 3 using as gem #23

Closed
aceofspades opened this Issue · 3 comments

4 participants

@aceofspades

Add to the end of your Rakefile.

Dir["#{Gem.searcher.find('annotate').full_gem_path}/**/tasks/**/*.rake"].each {|ext| load ext}
@ctran
Owner

Added this to the wiki.

@ctran ctran closed this
@igorbernstein

To avoid deprecation warnings use:

Dir["#{Gem::Specification.find_by_name("annotate").full_gem_path}/**/tasks/**/*.rake"].each {|ext| load ext}
@eLafo

I think this should be done only in development mode. So maybe it is better to use:

Dir["#{Gem::Specification.find_by_name("annotate").full_gem_path}/**/tasks/**/*.rake"].each {|ext| load ext} if Rails.env.development?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.