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
2 changed files with 8 additions and 0 deletions

View File

@@ -83,6 +83,8 @@ module ActiveRecord
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!

View File

@@ -21,6 +21,12 @@ module ActiveRecord
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!