lib/transient.rb in transient-1.1.0 vs lib/transient.rb in transient-2.0.0
- old
+ new
@@ -1,10 +1,14 @@
-$:.unshift(File.dirname(__FILE__)) unless
- $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
require 'date_time_extensions'
-require 'transient/active_record_extensions'
module Transient
- VERSION = '1.0.2'
+
+ autoload :ActiveRecordExtensions, 'transient/active_record_extensions'
+ autoload :Version, 'transient/version'
+
end
-ActiveRecord::Base.send( :include, Transient::ActiveRecordExtensions ) if defined?( ActiveRecord::Base )
\ No newline at end of file
+begin
+ require 'transient/railtie' if /3\.\d+\.\d+/.match( Rails.version )
+rescue
+ ActiveRecord::Base.send( :include, Transient::ActiveRecordExtensions ) if defined?( ActiveRecord::Base )
+end