diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-23 17:24:54 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-23 17:24:54 +0000 |
commit | 95454bfb33a9b29703dbbf04d1a71d06a68ae787 (patch) | |
tree | 821bf2e8c9b09228c3b37b017f8340abb297b967 /activerecord/test | |
parent | 97849debf33123387d33ba11fa5cf776873a5e94 (diff) | |
download | rails-95454bfb33a9b29703dbbf04d1a71d06a68ae787.tar.gz rails-95454bfb33a9b29703dbbf04d1a71d06a68ae787.tar.bz2 rails-95454bfb33a9b29703dbbf04d1a71d06a68ae787.zip |
Added mass-assignment protection for the inheritance column -- regardless of a custom column is used or not
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@477 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/base_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index da9daa6398..c5a6b7d656 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -383,6 +383,13 @@ class BasicsTest < Test::Unit::TestCase assert_equal 1, firm.rating end + def test_mass_assignment_protection_on_defaults + firm = Firm.new + firm.attributes = { "id" => 5, "type" => "Client" } + assert_nil firm.id + assert_equal "Firm", firm[:type] + end + def test_mass_assignment_accessible reply = Reply.new("title" => "hello", "content" => "world", "approved" => 0) reply.save |