Permalink
Browse files

workaround ruby string compare for Rails.version

  • Loading branch information...
1 parent 79a5ac3 commit 53b40182fd54979b2339f34dd3c83ae87259317b @phlipper committed Oct 15, 2010
Showing with 5 additions and 4 deletions.
  1. +5 −4 init.rb
View
@@ -1,7 +1,8 @@
unless $gems_rake_task
- if Rails.version <= "2.3.7"
- $stderr.puts "rails_xss requires Rails 2.3.8 or later. Please upgrade to enable automatic HTML safety."
- else
+ major, minor, micro = Rails.version.split(".").map(&:to_i)
+ if major == 2 && minor == 3 && micro >= 8
require 'rails_xss'
+ else
+ $stderr.puts "rails_xss requires Rails 2.3.8 or later. Please upgrade to enable automatic HTML safety."
end
-end
+end

0 comments on commit 53b4018

Please sign in to comment.