Merge pull request #484 from slainer68/master

Puts ActiveRecord::SessionStore attributes in white list, fixes #483
This commit is contained in:
José Valim 2011-05-10 07:23:26 -07:00
commit fa8b0f44bd
2 changed files with 8 additions and 0 deletions

@ -83,6 +83,8 @@ class Session < ActiveRecord::Base
cattr_accessor :data_column_name
self.data_column_name = 'data'
attr_accessible :session_id, :data, :marshaled_data
before_save :marshal_data!
before_save :raise_on_session_data_overflow!

@ -21,6 +21,12 @@ def test_table_name
assert_equal 'sessions', Session.table_name
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!
assert !Session.table_exists?
Session.create_table!