diff options
author | Xavier Noria <fxn@hashref.com> | 2010-04-19 05:10:55 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-04-19 05:10:55 -0700 |
commit | 792910bb69078ff1d14a6384b50e51aba2aae2dd (patch) | |
tree | 705defb52d5ac6eb903e97334de718defc7ba4e3 /activerecord | |
parent | e00c72c9718e518eb99058781f6ee71fa46b38fe (diff) | |
parent | ad4615e97896428ca140411081442f1b5e7d6089 (diff) | |
download | rails-792910bb69078ff1d14a6384b50e51aba2aae2dd.tar.gz rails-792910bb69078ff1d14a6384b50e51aba2aae2dd.tar.bz2 rails-792910bb69078ff1d14a6384b50e51aba2aae2dd.zip |
Merge commit 'rails/master'
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/rails/generators/active_record.rb | 5 | ||||
-rwxr-xr-x | activerecord/test/cases/base_test.rb | 3 | ||||
-rw-r--r-- | activerecord/test/cases/xml_serialization_test.rb | 3 | ||||
-rw-r--r-- | activerecord/test/fixtures/binaries.yml | 3 |
4 files changed, 9 insertions, 5 deletions
diff --git a/activerecord/lib/rails/generators/active_record.rb b/activerecord/lib/rails/generators/active_record.rb index 1ca838b4f2..d2b1e86857 100644 --- a/activerecord/lib/rails/generators/active_record.rb +++ b/activerecord/lib/rails/generators/active_record.rb @@ -19,10 +19,11 @@ module ActiveRecord # Implement the required interface for Rails::Generators::Migration. # def self.next_migration_number(dirname) #:nodoc: + next_migration_number = current_migration_number(dirname) + 1 if ActiveRecord::Base.timestamped_migrations - Time.now.utc.strftime("%Y%m%d%H%M%S") + [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max else - "%.3d" % (current_migration_number(dirname) + 1) + "%.3d" % next_migration_number end end end diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 591e04a077..2f4243a6aa 100755 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -2095,7 +2095,8 @@ class BasicsTest < ActiveRecord::TestCase assert_equal written_on_in_current_timezone, xml.elements["//written-on"].text assert_equal "datetime" , xml.elements["//written-on"].attributes['type'] - assert_equal "--- Have a nice day\n" , xml.elements["//content"].text + assert_match(/^--- Have a nice day\n/ , xml.elements["//content"].text) + assert_equal 'Have a nice day' , YAML.load(xml.elements["//content"].text) assert_equal "yaml" , xml.elements["//content"].attributes['type'] assert_equal "david@loudthinking.com", xml.elements["//author-email-address"].text diff --git a/activerecord/test/cases/xml_serialization_test.rb b/activerecord/test/cases/xml_serialization_test.rb index 2849ff11b7..b1c75ec8cd 100644 --- a/activerecord/test/cases/xml_serialization_test.rb +++ b/activerecord/test/cases/xml_serialization_test.rb @@ -4,6 +4,7 @@ require 'models/post' require 'models/author' require 'models/tagging' require 'models/comment' +require 'models/company_in_module' class XmlSerializationTest < ActiveRecord::TestCase def test_should_serialize_default_root @@ -79,7 +80,7 @@ class DefaultXmlSerializationTest < ActiveRecord::TestCase end def test_should_serialize_yaml - assert_match %r{<preferences type=\"yaml\">--- \n:gem: ruby\n</preferences>}, @xml + assert_match %r{<preferences type=\"yaml\">---\s?\n:gem: ruby\n</preferences>}, @xml end end diff --git a/activerecord/test/fixtures/binaries.yml b/activerecord/test/fixtures/binaries.yml index d150c5708e..ec8f2facdc 100644 --- a/activerecord/test/fixtures/binaries.yml +++ b/activerecord/test/fixtures/binaries.yml @@ -1,6 +1,7 @@ flowers: id: 1 - data: !binary | /9j/4AAQSkZJRgABAQEASABIAAD/2wBDAA0JCQoKCg4LCw4UDQsNFBcRDg4R + data: !binary |- + /9j/4AAQSkZJRgABAQEASABIAAD/2wBDAA0JCQoKCg4LCw4UDQsNFBcRDg4R FxsVFRUVFRsbFRcXFxcVGxoeICEgHhonJyoqJyc1NTU1NTY2NjY2NjY2Njb/ 2wBDAQ4NDRERERcRERcXExQTFx0ZGhoZHSYdHR4dHSYsJCAgICAkLCgrJiYm KygvLywsLy82NjY2NjY2NjY2NjY2Njb/wAARCACvAIMDAREAAhEBAxEB/8QA |