aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2005-07-05 12:38:06 +0000
committerJamis Buck <jamis@37signals.com>2005-07-05 12:38:06 +0000
commit56c3d72aa75dd286e35a220f53297e043e799ab2 (patch)
tree9089e9015dcd7c5a802cf27415811eff2960aa9b /activerecord/test
parent56fa64e995744aedaf13981e8ebddc5b9b488834 (diff)
downloadrails-56c3d72aa75dd286e35a220f53297e043e799ab2.tar.gz
rails-56c3d72aa75dd286e35a220f53297e043e799ab2.tar.bz2
rails-56c3d72aa75dd286e35a220f53297e043e799ab2.zip
Fix regression from [1631] that caused an attribute to be set to nil if it was assigned false
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1709 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rwxr-xr-xactiverecord/test/base_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb
index 0adcb3baa4..8b316df190 100755
--- a/activerecord/test/base_test.rb
+++ b/activerecord/test/base_test.rb
@@ -180,6 +180,12 @@ class BasicsTest < Test::Unit::TestCase
assert_equal "Still another topic: part 2", topic.title
end
+ def test_read_attribute_when_false
+ topic = topics(:first)
+ topic.approved = false
+ assert_equal 0, topic.approved, "approved should be 0"
+ end
+
def test_preserving_date_objects
# SQL Server doesn't have a separate column type just for dates, so all are returned as time
if ActiveRecord::ConnectionAdapters.const_defined? :SQLServerAdapter