Commit 012f533e39a1a2bcc480c12eead25260108d38c1
1 parent
dfaacfd5
Exists in
master
and in
28 other branches
Make rakismet work with Noosfero (Rails 2)
When we upgrade to Rails 3, we should remove this bundled version of rakismet and depend on rakismet the right way (i.e. using the Gemfile). I am not publishing this change anywhere because I do not want to give incentives for people to keep using Rails 2. ;-)
Showing
1 changed file
with
5 additions
and
1 deletions
Show diff stats
vendor/plugins/rakismet/lib/rakismet.rb
... | ... | @@ -6,7 +6,11 @@ require 'yaml' |
6 | 6 | require 'rakismet/model' |
7 | 7 | require 'rakismet/middleware' |
8 | 8 | require 'rakismet/version' |
9 | -require 'rakismet/railtie.rb' if defined?(Rails) | |
9 | + | |
10 | +if defined?(Rails) && Rails::VERSION::STRING > '3.2.0' | |
11 | + require 'rakismet/railtie.rb' | |
12 | + $stderr.puts "W: on Rails 3, this vendored version of rakismet should be replaced by a proper dependency" | |
13 | +end | |
10 | 14 | |
11 | 15 | module Rakismet |
12 | 16 | Request = Struct.new(:user_ip, :user_agent, :referrer) | ... | ... |