A Rails plugin I use (google_analytics) that was written for Rails 2.3 contains a file called rails/init.rb, which under Rails 3 yields the warning:
DEPRECATION WARNING: Use toplevel init.rb; rails/init.rb is deprecated: /home/logankoester/hack/active/myapp/vendor/plugins/google_analytics/rails/init.rb. (called from <top (required)> at /home/logankoester/hack/active/myapp/config/environment.rb:5)
Now, I could simply move the file in my fork, but I don't expect this would be backwards-compatible with Rails 2. Is there a solution to this change that w开发者_如何学编程ould work for both versions, or will I have to maintain separate branches for each major version of Rails?
Try to rewrite it to a gem and bundle it. That would work for Rails 2 as well.
精彩评论