I’m working on a plug-in which has to manipulate some session varibles
Unfortunately I end up with “Symbol as array index” errors.
Probably the error occurs in a point that I never think about but here’s
an abstract plug-in which generates the same error.
It fails in the line of assignment “session[:aaa_uid] = uid” with
“Symbol as array index” error.
module Legacy
module Rails #:nodoc:
module Test #:nodoc:
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def uses_test_plug(options = {})
class_eval do
extend ::Legacy::Rails::Test::InstanceMethods
end
before_filter do |controller|
set_aaa_uid("jdoe")
end
end
end
module InstanceMethods
def set_aaa_uid(uid)
session[:aaa_uid] = uid
end
end
module SingletonMethods
end
end
end
end
ActionController::Base.class_eval do
include ::Legacy::Rails::Test
end