Do not overwrite manually built records during one-to-one nested attribute assignment

For one-to-one nested associations, if you build the new (in-memory)
child object yourself before assignment, then the NestedAttributes
module will not overwrite it, e.g.:

    class Member < ActiveRecord::Base
      has_one :avatar
      accepts_nested_attributes_for :avatar

      def avatar
        super || build_avatar(width: 200)
      end
    end

    member = Member.new
    member.avatar_attributes = {icon: 'sad'}
    member.avatar.width # => 200
Merge pull request #9426 from exviva/nested_attributes_reuse_existing_new_record

Do not overwrite manually built records during one-to-one nested attribute assignment
Fix generating route from engine to other engine

A regression was introduced in 5b3bb6, generating route from within an
engine to an another engine resulted in prefixing a path with the
SCRIPT_NAME value.

The regression was caused by the fact that SCRIPT_NAME should be
appended only if it's the SCRIPT_NAME for the application, not if it's
SCRIPT_NAME from the current engine.

closes #10409
Add a test case for comparing Rails versions
https://github.com/rails/rails/commit/558d402472b49c4c99bf6753d341d7aef2e25dd4
Squashed commit of the following:

commit 2683de5da85135e8d9fe48593ff6167db9d64b18
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date:   Fri May 3 11:29:20 2013 -0700

    cannot support infinite ranges right now

commit cebb6acef2c3957f975f6db4afd849e535126253
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date:   Fri May 3 11:26:12 2013 -0700

    reverting infinity comparison

commit 385f7e6b4efd1bf9b89e8d607fcb13e5b03737ea
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date:   Fri May 3 11:23:28 2013 -0700

    Revert "Added ability to compare date/time with infinity"

    This reverts commit 38f28dca3aa16efd6cc3af6453f2e6b9e9655ec1.

    Conflicts:
    	activesupport/CHANGELOG.md
    	activesupport/lib/active_support/core_ext/numeric/infinite_comparable.rb
    	activesupport/test/core_ext/date_ext_test.rb
    	activesupport/test/core_ext/date_time_ext_test.rb
    	activesupport/test/core_ext/numeric_ext_test.rb
    	activesupport/test/core_ext/time_ext_test.rb
    	activesupport/test/core_ext/time_with_zone_test.rb

commit 0d799a188dc12b18267fc8421675729917610047
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date:   Fri May 3 11:18:53 2013 -0700

    Revert "Refactor infinite comparable definition a bit"

    This reverts commit dd3360e05e4909f2f0c74a624cccc2def688f828.

commit 42dec90e49745bbfae546f0560b8783f6b48b074
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date:   Fri May 3 11:18:47 2013 -0700

    Revert "Require 'active_support/core_ext/module/aliasing' in the infinite_comparable module"

    This reverts commit 7003e71c13c53ec3d34250560fbf80b8381df693.
Merge pull request #10452 from rubys/rails_version_test

Add a test case for comparing Rails versions
Fixed bad tests to clean up after themselves.
Merge pull request #10457 from zenspider/squishy_test_order_dependencies

Fixed bad tests to clean up after themselves.
Make SchemaDumper emit "id: :uuid" when appropriate. Fixes #10451.
Relaxed jbuilder dependency in Gemfile template
generate 'app/assets/images' directory when creating new rails app
Merge pull request #10461 from rwz/master

Relaxed jbuilder dependency in Gemfile template
Merge pull request #10436 from NARKOZ/keep-images

generate 'app/assets/images' directory when creating new rails app. Fixes #10434
Merge pull request #10458 from bwbuchanan/issue-10451

Make SchemaDumper emit "id: :uuid" when using UUID primary keys
Fixes Scaffold generator with --assets=false

Scaffold generator with --assets=false option 
outputs an error

See #9525
Merge pull request #10448 from arunagw/bug-fix-scaffold-generator-master

Fixes Scaffold generator with --assets=false
Review the CHANGELOG entry [ci skip]
Use Ruby 1.9 syntax