Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Test DateTime native type in migrations. References #7649.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6304 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 70d7b3752f8cc8fe821a1a3873573b6d313ea129 1 parent 5436229
@jeremy jeremy authored
View
2  activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Test DateTime native type in migrations. #7649 [fedot]
+
* SQLServer: correctly schema-dump tables with no indexes or descending indexes. #7333, #7703 [Jakob S, Tom Ward]
* SQLServer: recognize real column type as Ruby float. #7057 [sethladd, Tom Ward]
View
6 activerecord/test/migration_test.rb
@@ -40,7 +40,7 @@ def teardown
Reminder.reset_column_information
%w(last_name key bio age height wealth birthday favorite_day
- male administrator).each do |column|
+ moment_of_truth male administrator).each do |column|
Person.connection.remove_column('people', column) rescue nil
end
Person.connection.remove_column("people", "first_name") rescue nil
@@ -261,8 +261,9 @@ def test_native_types
Person.connection.add_column "people", "wealth", :decimal, :precision => '30', :scale => '10'
Person.connection.add_column "people", "birthday", :datetime
Person.connection.add_column "people", "favorite_day", :date
+ Person.connection.add_column "people", "moment_of_truth", :datetime
Person.connection.add_column "people", "male", :boolean
- assert_nothing_raised { Person.create :first_name => 'bob', :last_name => 'bobsen', :bio => "I was born ....", :age => 18, :height => 1.78, :wealth => BigDecimal.new("12345678901234567890.0123456789"), :birthday => 18.years.ago, :favorite_day => 10.days.ago, :male => true }
+ assert_nothing_raised { Person.create :first_name => 'bob', :last_name => 'bobsen', :bio => "I was born ....", :age => 18, :height => 1.78, :wealth => BigDecimal.new("12345678901234567890.0123456789"), :birthday => 18.years.ago, :favorite_day => 10.days.ago, :moment_of_truth => "1817-10-25 21:40:18", :male => true }
bob = Person.find(:first)
assert_equal 'bob', bob.first_name
@@ -294,6 +295,7 @@ def test_native_types
assert_equal Date, bob.favorite_day.class
end
+ assert_equal DateTime, bob.moment_of_truth.class
assert_equal TrueClass, bob.male?.class
assert_kind_of BigDecimal, bob.wealth
end
View
2  activesupport/CHANGELOG
@@ -2,7 +2,7 @@
* DateTime calculations analogous to the Date and Time extensions. #7693 [Geoff Buesing]
-* Give DateTime correct .to_s implementations, lets it play nice with ActiveRecord quoting. [gbuesing]
+* Give DateTime correct .to_s implementations, lets it play nice with ActiveRecord quoting. #7649 [Geoff Buesing]
* Add File.atomic_write, allows you to write large files in an atomic manner, preventing users from seeing half written files. [Koz]
Please sign in to comment.
Something went wrong with that request. Please try again.