提交 95b49895 编写于 作者: S slainer68

Puts ActiveRecord::SessionStore attributes in white list, fixes #483

上级 8c05293b
...@@ -83,6 +83,8 @@ class Session < ActiveRecord::Base ...@@ -83,6 +83,8 @@ class Session < ActiveRecord::Base
cattr_accessor :data_column_name cattr_accessor :data_column_name
self.data_column_name = 'data' self.data_column_name = 'data'
attr_accessible :session_id, :data, :marshaled_data
before_save :marshal_data! before_save :marshal_data!
before_save :raise_on_session_data_overflow! before_save :raise_on_session_data_overflow!
......
...@@ -21,6 +21,12 @@ def test_table_name ...@@ -21,6 +21,12 @@ def test_table_name
assert_equal 'sessions', Session.table_name assert_equal 'sessions', Session.table_name
end end
def test_accessible_attributes
assert Session.accessible_attributes.include?(:session_id)
assert Session.accessible_attributes.include?(:data)
assert Session.accessible_attributes.include?(:marshaled_data)
end
def test_create_table! def test_create_table!
assert !Session.table_exists? assert !Session.table_exists?
Session.create_table! Session.create_table!
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册