rails/init.rb in has_global_session-1.0 vs rails/init.rb in has_global_session-1.1.0
- old
+ new
@@ -1,21 +1,13 @@
basedir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
libdir = File.join(basedir, 'lib')
-require File.join(libdir, 'has_global_session')
-
config_file = File.join(RAILS_ROOT, 'config', 'global_session.yml')
if File.exist?(config_file)
- # Tie the Configuration module to Rails' filesystem structure
- # and operating environment.
- HasGlobalSession::Configuration.config_file = config_file
- HasGlobalSession::Configuration.environment = RAILS_ENV
-
+ require File.join(libdir, 'has_global_session')
require File.join(libdir, 'has_global_session', 'rails')
# Enable ActionController integration.
- class ActionController::Base
- def self.has_global_session
- include HasGlobalSession::Rails::ActionControllerInstanceMethods
- end
+ class <<ActionController::Base
+ include HasGlobalSession::Rails::ActionControllerClassMethods
end
end