From 6a26986a8b4d157c740ccaa232b32332361d7bc9 Mon Sep 17 00:00:00 2001 From: Gabe da Silveira Date: Sun, 3 Jul 2011 14:48:41 -0600 Subject: [PATCH] More agnostic requires Shouldn't be requiring rubygems explicitly. Rails 3 needs explicit active_support feature requires. --- lib/acts_as_sanitiled.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/acts_as_sanitiled.rb b/lib/acts_as_sanitiled.rb index 3a45c40..938b625 100644 --- a/lib/acts_as_sanitiled.rb +++ b/lib/acts_as_sanitiled.rb @@ -1,7 +1,12 @@ -require 'rubygems' require 'sanitize' require 'RedCloth' -require 'active_support' +require 'rails' + +if Rails::VERSION::MAJOR <= 2 + require 'active_support' +else + require 'active_support/core_ext/module/attribute_accessors' +end module ActsAsSanitiled #:nodoc: all mattr_accessor :default_redcloth_options