Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

convert time to string

why is this a Time to start with?
  • Loading branch information...
commit dba022f3a9f1c0e256ae290ffffd332f7a9fd250 1 parent 5a8f25f
@joshsusser authored
View
2  activerecord/test/cases/migration_test.rb
@@ -71,7 +71,7 @@ def test_migrator_versions
assert_equal m0_fingerprint, rows[0]["fingerprint"]
assert_equal "valid_people_have_last_names", rows[0]["name"]
rows.each do |row|
- assert_match(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/, row["migrated_at"], "missing migrated_at")
+ assert_match(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/, row["migrated_at"].to_s, "missing migrated_at") # sometimes a String, sometimes a Time
end
ActiveRecord::Migrator.down(MIGRATIONS_ROOT + "/valid")
View
2  activerecord/test/cases/schema_migration_test.rb
@@ -40,7 +40,7 @@ def test_add_metadata_columns_to_exisiting_schema_migrations
rows = connection.select_all("SELECT * FROM #{connection.quote_table_name(sm_table_name)}")
assert rows[0].has_key?("migrated_at"), "missing column `migrated_at`"
- assert_match(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/, rows[0]["migrated_at"])
+ assert_match(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/, rows[0]["migrated_at"].to_s) # sometimes a String, sometimes a Time
assert rows[0].has_key?("fingerprint"), "missing column `fingerprint`"
assert rows[0].has_key?("name"), "missing column `name`"
end
Please sign in to comment.
Something went wrong with that request. Please try again.