<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>script/dbconsole</filename>
    </added>
    <added>
      <filename>vendor/rails/.gitignore</filename>
    </added>
    <added>
      <filename>vendor/rails/actionpack/test/fixtures/layout_tests/layouts/symlinked</filename>
    </added>
    <added>
      <filename>vendor/rails/actionpack/test/fixtures/test/render_file_from_template.html.erb</filename>
    </added>
    <added>
      <filename>vendor/rails/actionpack/test/template/deprecated_erb_variable_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/CHANGES</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/README</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/Rakefile</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/lib/active_model.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/lib/active_model/base.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/lib/active_model/callbacks.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/lib/active_model/deprecated_error_methods.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/lib/active_model/errors.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/lib/active_model/observing.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/lib/active_model/validations.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/lib/active_model/validations/acceptance.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/lib/active_model/validations/associated.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/lib/active_model/validations/confirmation.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/lib/active_model/validations/exclusion.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/lib/active_model/validations/format.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/lib/active_model/validations/inclusion.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/lib/active_model/validations/length.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/lib/active_model/validations/numericality.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/lib/active_model/validations/presence.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/lib/active_model/validations/uniqueness.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/spec/observing_spec.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activemodel/spec/spec_helper.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activerecord/MIT-LICENSE</filename>
    </added>
    <added>
      <filename>vendor/rails/activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activerecord/test/cases/column_definition_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activerecord/test/cases/database_statements_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activerecord/test/fixtures/.gitignore</filename>
    </added>
    <added>
      <filename>vendor/rails/activeresource/MIT-LICENSE</filename>
    </added>
    <added>
      <filename>vendor/rails/activeresource/test/fixtures/customer.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/MIT-LICENSE</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/Rakefile</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/install.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/core_ext/module/model_naming.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/core_ext/rexml.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/string_inquirer.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/data_timezone.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/data_timezone_info.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Africa/Algiers.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Africa/Cairo.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Africa/Casablanca.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Africa/Harare.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Africa/Johannesburg.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Africa/Monrovia.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Africa/Nairobi.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Argentina/Buenos_Aires.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Argentina/San_Juan.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Bogota.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Caracas.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Chicago.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Chihuahua.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Denver.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Godthab.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Guatemala.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Halifax.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Indiana/Indianapolis.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Juneau.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/La_Paz.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Lima.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Los_Angeles.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Mazatlan.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Mexico_City.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Monterrey.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/New_York.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Phoenix.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Regina.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Santiago.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/St_Johns.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Tijuana.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Almaty.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Baghdad.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Baku.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Bangkok.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Chongqing.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Dhaka.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Hong_Kong.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Irkutsk.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Jakarta.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Jerusalem.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Kabul.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Kamchatka.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Karachi.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Katmandu.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Kolkata.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Krasnoyarsk.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Kuala_Lumpur.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Kuwait.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Magadan.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Muscat.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Novosibirsk.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Rangoon.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Riyadh.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Seoul.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Shanghai.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Singapore.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Taipei.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Tashkent.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Tbilisi.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Tehran.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Tokyo.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Ulaanbaatar.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Urumqi.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Vladivostok.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Yakutsk.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Yekaterinburg.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Yerevan.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Atlantic/Azores.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Atlantic/Cape_Verde.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Atlantic/South_Georgia.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Australia/Adelaide.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Australia/Brisbane.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Australia/Darwin.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Australia/Hobart.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Australia/Melbourne.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Australia/Perth.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Australia/Sydney.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Etc/UTC.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Amsterdam.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Athens.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Belgrade.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Berlin.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Bratislava.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Brussels.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Bucharest.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Budapest.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Copenhagen.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Dublin.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Helsinki.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Istanbul.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Kiev.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Lisbon.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Ljubljana.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/London.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Madrid.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Minsk.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Moscow.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Paris.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Prague.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Riga.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Rome.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Sarajevo.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Skopje.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Sofia.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Stockholm.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Tallinn.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Vienna.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Vilnius.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Warsaw.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Zagreb.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Auckland.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Fiji.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Guam.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Honolulu.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Majuro.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Midway.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Noumea.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Pago_Pago.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Port_Moresby.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Tongatapu.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/info_timezone.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/linked_timezone.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/linked_timezone_info.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/offset_rationals.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/time_or_datetime.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/timezone.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/timezone_definition.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/timezone_info.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/timezone_offset_info.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/timezone_period.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/timezone_transition_info.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/abstract_unit.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/a/b.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/a/c/d.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/a/c/e/f.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/application.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/class_folder.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/class_folder/class_folder_subclass.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/class_folder/inline_class.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/class_folder/nested_class.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/conflict.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/counting_loader.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/cross_site_dependency.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/e.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/module_folder/inline_class.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/module_folder/nested_class.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/module_folder/nested_sibling.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/module_with_custom_const_missing/a/b.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/multiple_constant_file.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/raises_name_error.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/autoloading_fixtures/raises_no_method_error.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/buffered_logger_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/caching_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/callbacks_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/clean_logger_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/array_ext_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/base64_ext_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/bigdecimal.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/blank_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/cgi_ext_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/class/attribute_accessor_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/class/delegating_attributes_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/class_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/date_ext_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/date_time_ext_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/duplicable_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/duration_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/enumerable_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/exception_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/file_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/float_ext_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/hash_ext_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/integer_ext_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/kernel_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/load_error_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/module/attr_accessor_with_default_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/module/attr_internal_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/module/attribute_accessor_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/module/attribute_aliasing_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/module/model_naming_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/module_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/name_error_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/numeric_ext_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/object_and_class_ext_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/pathname_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/proc_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/range_ext_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/string_ext_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/symbol_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/time_ext_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/core_ext/time_with_zone_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/dependencies/check_warnings.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/dependencies/conflict.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/dependencies/cross_site_depender.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/dependencies/mutual_one.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/dependencies/mutual_two.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/dependencies/raises_exception.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/dependencies/requires_nonexistent0.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/dependencies/requires_nonexistent1.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/dependencies/service_one.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/dependencies/service_two.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/dependencies_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/deprecation_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/gzip_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/inflector_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/inflector_test_cases.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/json/decoding_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/json/encoding_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/multibyte_chars_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/multibyte_conformance.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/multibyte_handler_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/option_merger_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/ordered_hash_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/ordered_options_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/string_inquirer_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/test_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/time_zone_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/activesupport/test/whiny_nil_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/doc/template/horo.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/abstract_unit.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/boot_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/console_app_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fcgi_dispatcher_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fixtures/about_yml_plugins/bad_about_yml/about.yml</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fixtures/about_yml_plugins/bad_about_yml/init.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fixtures/about_yml_plugins/plugin_without_about_yml/init.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fixtures/environment_with_constant.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fixtures/lib/generators/missing_class/missing_class_generator.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fixtures/lib/generators/missing_class/templates/.gitignore</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fixtures/lib/generators/missing_generator/templates/.gitignore</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fixtures/lib/generators/missing_templates/.gitignore</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fixtures/lib/generators/working/working_generator.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fixtures/plugins/alternate/a/generators/a_generator/a_generator.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fixtures/plugins/alternate/a/lib/.gitignore</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fixtures/plugins/default/acts/acts_as_chunky_bacon/lib/.gitignore</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fixtures/plugins/default/empty/.gitignore</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fixtures/plugins/default/plugin_with_no_lib_dir/init.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fixtures/plugins/default/stubby/about.yml</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fixtures/plugins/default/stubby/generators/stubby_generator/stubby_generator.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fixtures/plugins/default/stubby/init.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/fixtures/plugins/default/stubby/lib/stubby_mixin.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/gem_dependency_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/generator_lookup_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/generators/generator_test_helper.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/generators/rails_controller_generator_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/generators/rails_mailer_generator_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/generators/rails_model_generator_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/generators/rails_resource_generator_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/generators/rails_scaffold_generator_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/initializer_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/mocks/routes.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/plugin_loader_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/plugin_locator_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/plugin_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/plugin_test_helper.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/rails_generator_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/rails_info_controller_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/rails_info_test.rb</filename>
    </added>
    <added>
      <filename>vendor/rails/railties/test/secret_key_generation_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -24,9 +24,8 @@ module Rails
       File.exist?(&quot;#{RAILS_ROOT}/vendor/rails&quot;)
     end
 
-    # FIXME : Ruby 1.9
     def preinitialize
-      load(preinitializer_path) if File.exists?(preinitializer_path)
+      load(preinitializer_path) if File.exist?(preinitializer_path)
     end
 
     def preinitializer_path
@@ -44,6 +43,7 @@ module Rails
   class VendorBoot &lt; Boot
     def load_initializer
       require &quot;#{RAILS_ROOT}/vendor/rails/railties/lib/initializer&quot;
+      Rails::Initializer.run(:install_gem_spec_stubs)
     end
   end
 
@@ -82,14 +82,14 @@ module Rails
 
       def load_rubygems
         require 'rubygems'
-
-        unless rubygems_version &gt;= '0.9.4'
-          $stderr.puts %(Rails requires RubyGems &gt;= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
+        min_version = '1.1.1'
+        unless rubygems_version &gt;= min_version
+          $stderr.puts %Q(Rails requires RubyGems &gt;= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
           exit 1
         end
 
       rescue LoadError
-        $stderr.puts %(Rails requires RubyGems &gt;= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
+        $stderr.puts %Q(Rails requires RubyGems &gt;= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
         exit 1
       end
 </diff>
      <filename>config/boot.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@
 # ENV['RAILS_ENV'] ||= 'production'
 
 # Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION
+RAILS_GEM_VERSION = '2.1.1' unless defined? RAILS_GEM_VERSION
 
 # Bootstrap the Rails environment, frameworks, and default configuration
 require File.join(File.dirname(__FILE__), 'boot')</diff>
      <filename>config/environment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
 //           (c) 2005-2007 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
 //           (c) 2005-2007 Jon Tirsen (http://www.tirsen.com)
 // Contributors:</diff>
      <filename>public/javascripts/controls.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
 //           (c) 2005-2007 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
 // 
 // script.aculo.us is freely distributable under the terms of an MIT-style license.</diff>
      <filename>public/javascripts/dragdrop.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
 // Contributors:
 //  Justin Palmer (http://encytemedia.com/)
 //  Mark Pilgrim (http://diveintomark.org/)</diff>
      <filename>public/javascripts/effects.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,8 @@
+*2.1.1 (September 4th, 2008)*
+
+* Included in Rails 2.1.1
+
+
 *2.1.0 (May 31st, 2008)*
 
 * Fixed that a return-path header would be ignored #7572 [joost]</diff>
      <filename>vendor/rails/actionmailer/CHANGELOG</filename>
    </modified>
    <modified>
      <filename>vendor/rails/actionmailer/README</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,8 @@ require 'rake/rdoctask'
 require 'rake/packagetask'
 require 'rake/gempackagetask'
 require 'rake/contrib/sshpublisher'
+require 'rake/contrib/rubyforgepublisher'
+
 require File.join(File.dirname(__FILE__), 'lib', 'action_mailer', 'version')
 
 PKG_BUILD     = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
@@ -35,7 +37,7 @@ Rake::RDocTask.new { |rdoc|
   rdoc.title    = &quot;Action Mailer -- Easy email delivery and testing&quot;
   rdoc.options &lt;&lt; '--line-numbers' &lt;&lt; '--inline-source' &lt;&lt; '-A cattr_accessor=object'
   rdoc.options &lt;&lt; '--charset' &lt;&lt; 'utf-8'
-  rdoc.template = &quot;#{ENV['template']}.rb&quot; if ENV['template']
+  rdoc.template = ENV['template'] ? &quot;#{ENV['template']}.rb&quot; : '../doc/template/horo'
   rdoc.rdoc_files.include('README', 'CHANGELOG')
   rdoc.rdoc_files.include('lib/action_mailer.rb')
   rdoc.rdoc_files.include('lib/action_mailer/*.rb')
@@ -55,7 +57,7 @@ spec = Gem::Specification.new do |s|
   s.rubyforge_project = &quot;actionmailer&quot;
   s.homepage = &quot;http://www.rubyonrails.org&quot;
 
-  s.add_dependency('actionpack', '= 2.1.0' + PKG_BUILD)
+  s.add_dependency('actionpack', '= 2.1.1' + PKG_BUILD)
 
   s.has_rdoc = true
   s.requirements &lt;&lt; 'none'
@@ -76,12 +78,13 @@ end
 
 desc &quot;Publish the API documentation&quot;
 task :pgem =&gt; [:package] do 
-  Rake::SshFilePublisher.new(&quot;davidhh@wrath.rubyonrails.org&quot;, &quot;public_html/gems/gems&quot;, &quot;pkg&quot;, &quot;#{PKG_FILE_NAME}.gem&quot;).upload
+  Rake::SshFilePublisher.new(&quot;david@greed.loudthinking.com&quot;, &quot;/u/sites/gems/gems&quot;, &quot;pkg&quot;, &quot;#{PKG_FILE_NAME}.gem&quot;).upload
+  `ssh david@greed.loudthinking.com '/u/sites/gems/gemupdate.sh'`
 end
 
 desc &quot;Publish the API documentation&quot;
 task :pdoc =&gt; [:rdoc] do 
-  Rake::SshDirPublisher.new(&quot;davidhh@wrath.rubyonrails.org&quot;, &quot;public_html/am&quot;, &quot;doc&quot;).upload
+  Rake::SshDirPublisher.new(&quot;wrath.rubyonrails.org&quot;, &quot;public_html/am&quot;, &quot;doc&quot;).upload
 end
 
 desc &quot;Publish the release files to RubyForge.&quot;</diff>
      <filename>vendor/rails/actionmailer/Rakefile</filename>
    </modified>
    <modified>
      <filename>vendor/rails/actionmailer/lib/action_mailer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -530,7 +530,7 @@ module ActionMailer #:nodoc:
       end
 
       def render_message(method_name, body)
-        render :file =&gt; method_name, :body =&gt; body
+        render :file =&gt; method_name, :body =&gt; body, :use_full_path =&gt; true
       end
 
       def render(opts)
@@ -538,6 +538,7 @@ module ActionMailer #:nodoc:
         if opts[:file] &amp;&amp; opts[:file] !~ /\//
           opts[:file] = &quot;#{mailer_name}/#{opts[:file]}&quot;
         end
+        opts[:use_full_path] = true
         initialize_template_class(body).render(opts)
       end
 </diff>
      <filename>vendor/rails/actionmailer/lib/action_mailer/base.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/actionmailer/lib/action_mailer/vendor/text-format-0.6.3/text/format.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ module ActionMailer
   module VERSION #:nodoc:
     MAJOR = 2
     MINOR = 1
-    TINY  = 0
+    TINY  = 1
 
     STRING = [MAJOR, MINOR, TINY].join('.')
   end</diff>
      <filename>vendor/rails/actionmailer/lib/action_mailer/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -30,13 +30,20 @@ class Net::SMTP
   end
 end
 
-# Wrap tests that use Mocha and skip if unavailable.
-def uses_mocha(test_name)
-  gem 'mocha', &quot;&gt;=0.5&quot;
-  require 'stubba'
+def uses_gem(gem_name, test_name, version = '&gt; 0')
+  require 'rubygems'
+  gem gem_name.to_s, version
+  require gem_name.to_s
   yield
-rescue Gem::LoadError
-  $stderr.puts &quot;Skipping #{test_name} tests (Mocha &gt;= 0.5 is required). `gem install mocha` and try again.&quot;
+rescue LoadError
+  $stderr.puts &quot;Skipping #{test_name} tests. `gem install #{gem_name}` and try again.&quot;
+end
+
+# Wrap tests that use Mocha and skip if unavailable.
+unless defined? uses_mocha
+  def uses_mocha(test_name, &amp;block)
+    uses_gem('mocha', test_name, '&gt;= 0.5.5', &amp;block)
+  end
 end
 
 def set_delivery_method(delivery_method)</diff>
      <filename>vendor/rails/actionmailer/test/abstract_unit.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/actionmailer/test/mail_service_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,20 @@
+*2.1.1 (September 4th, 2008)*
+
+* All 2xx requests are considered successful [Josh Peek]
+
+* Deprecate the limited follow_redirect in functional tests.  If you wish to follow redirects, use integration tests. [Michael Koziarski]
+
+* Fixed that AssetTagHelper#compute_public_path shouldn't cache the asset_host along with the source or per-request proc's won't run [DHH]
+
+* Deprecate define_javascript_functions, javascript_include_tag and friends are much better [Michael Koziarski]
+
+* Fix polymorphic_url with singleton resources.  #461 [Tammer Saleh]
+
+* Deprecate ActionView::Base.erb_variable. Use the concat helper method instead of appending to it directly.  [Jeremy Kemper]
+
+* Fixed Request#remote_ip to only raise hell if the HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR doesn't match (not just if they're both present) [Mark Imbriaco, Bradford Folkens]
+
+
 *2.1.0 (May 31st, 2008)*
 
 * InstanceTag#default_time_from_options overflows to DateTime [Geoff Buesing]</diff>
      <filename>vendor/rails/actionpack/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,8 @@ require 'rake/rdoctask'
 require 'rake/packagetask'
 require 'rake/gempackagetask'
 require 'rake/contrib/sshpublisher'
+require 'rake/contrib/rubyforgepublisher'
+
 require File.join(File.dirname(__FILE__), 'lib', 'action_pack', 'version')
 
 PKG_BUILD     = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
@@ -49,12 +51,14 @@ Rake::RDocTask.new { |rdoc|
   rdoc.title    = &quot;Action Pack -- On rails from request to response&quot;
   rdoc.options &lt;&lt; '--line-numbers' &lt;&lt; '--inline-source'
   rdoc.options &lt;&lt; '--charset' &lt;&lt; 'utf-8'
-  rdoc.template = &quot;#{ENV['template']}.rb&quot; if ENV['template']
+  rdoc.template = ENV['template'] ? &quot;#{ENV['template']}.rb&quot; : '../doc/template/horo'
   if ENV['DOC_FILES'] 
     rdoc.rdoc_files.include(ENV['DOC_FILES'].split(/,\s*/))
   else
     rdoc.rdoc_files.include('README', 'RUNNING_UNIT_TESTS', 'CHANGELOG')
-    rdoc.rdoc_files.include('lib/**/*.rb')
+    rdoc.rdoc_files.include(Dir['lib/**/*.rb'] -
+                            Dir['lib/*/vendor/**/*.rb'])
+    rdoc.rdoc_files.exclude('lib/actionpack.rb')
   end
 }
 
@@ -76,7 +80,7 @@ spec = Gem::Specification.new do |s|
   s.has_rdoc = true
   s.requirements &lt;&lt; 'none'
 
-  s.add_dependency('activesupport', '= 2.1.0' + PKG_BUILD)
+  s.add_dependency('activesupport', '= 2.1.1' + PKG_BUILD)
 
   s.require_path = 'lib'
   s.autorequire = 'action_controller'
@@ -132,13 +136,13 @@ task :update_js =&gt; [ :update_scriptaculous ]
 
 desc &quot;Publish the API documentation&quot;
 task :pgem =&gt; [:package] do 
-  Rake::SshFilePublisher.new(&quot;davidhh@wrath.rubyonrails.org&quot;, &quot;public_html/gems/gems&quot;, &quot;pkg&quot;, &quot;#{PKG_FILE_NAME}.gem&quot;).upload
-  `ssh davidhh@wrath.rubyonrails.org './gemupdate.sh'`
+  Rake::SshFilePublisher.new(&quot;david@greed.loudthinking.com&quot;, &quot;/u/sites/gems/gems&quot;, &quot;pkg&quot;, &quot;#{PKG_FILE_NAME}.gem&quot;).upload
+  `ssh david@greed.loudthinking.com '/u/sites/gems/gemupdate.sh'`
 end
 
 desc &quot;Publish the API documentation&quot;
 task :pdoc =&gt; [:rdoc] do 
-  Rake::SshDirPublisher.new(&quot;davidhh@wrath.rubyonrails.org&quot;, &quot;public_html/ap&quot;, &quot;doc&quot;).upload
+  Rake::SshDirPublisher.new(&quot;wrath.rubyonrails.org&quot;, &quot;public_html/ap&quot;, &quot;doc&quot;).upload
 end
 
 desc &quot;Publish the release files to RubyForge.&quot;</diff>
      <filename>vendor/rails/actionpack/Rakefile</filename>
    </modified>
    <modified>
      <filename>vendor/rails/actionpack/lib/action_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -97,7 +97,7 @@ module ActionController
                 value['controller'] = value['controller'].to_s
                 if key == :actual &amp;&amp; value['controller'].first != '/' &amp;&amp; !value['controller'].include?('/')
                   new_controller_path = ActionController::Routing.controller_relative_to(value['controller'], @controller.class.controller_path)
-                  value['controller'] = new_controller_path if value['controller'] != new_controller_path &amp;&amp; ActionController::Routing.possible_controllers.include?(new_controller_path)
+                  value['controller'] = new_controller_path if value['controller'] != new_controller_path &amp;&amp; ActionController::Routing.possible_controllers.include?(new_controller_path) &amp;&amp; @response.redirected_to.is_a?(Hash)
                 end
                 value['controller'] = value['controller'][1..-1] if value['controller'].first == '/' # strip leading hash
               end</diff>
      <filename>vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -398,47 +398,31 @@ module ActionController
       #   # The same, but shorter.
       #   assert_select &quot;ol&gt;li&quot;, 4
       def assert_select_rjs(*args, &amp;block)
-        rjs_type = nil
-        arg      = args.shift
+        rjs_type = args.first.is_a?(Symbol) ? args.shift : nil
+        id       = args.first.is_a?(String) ? args.shift : nil
 
         # If the first argument is a symbol, it's the type of RJS statement we're looking
         # for (update, replace, insertion, etc). Otherwise, we're looking for just about
         # any RJS statement.
-        if arg.is_a?(Symbol)
-          rjs_type = arg
-
+        if rjs_type
           if rjs_type == :insert
-            arg = args.shift
-            insertion = &quot;insert_#{arg}&quot;.to_sym
-            raise ArgumentError, &quot;Unknown RJS insertion type #{arg}&quot; unless RJS_STATEMENTS[insertion]
+            position  = args.shift
+            insertion = &quot;insert_#{position}&quot;.to_sym
+            raise ArgumentError, &quot;Unknown RJS insertion type #{position}&quot; unless RJS_STATEMENTS[insertion]
             statement = &quot;(#{RJS_STATEMENTS[insertion]})&quot;
           else
             raise ArgumentError, &quot;Unknown RJS statement type #{rjs_type}&quot; unless RJS_STATEMENTS[rjs_type]
             statement = &quot;(#{RJS_STATEMENTS[rjs_type]})&quot;
           end
-          arg = args.shift
         else
           statement = &quot;#{RJS_STATEMENTS[:any]}&quot;
         end
 
         # Next argument we're looking for is the element identifier. If missing, we pick
-        # any element.
-        if arg.is_a?(String)
-          id = Regexp.quote(arg)
-          arg = args.shift
-        else
-          id = &quot;[^\&quot;]*&quot;
-        end
-
-        pattern =
-          case rjs_type
-            when :chained_replace, :chained_replace_html
-              Regexp.new(&quot;\\$\\(\&quot;#{id}\&quot;\\)#{statement}\\(#{RJS_PATTERN_HTML}\\)&quot;, Regexp::MULTILINE)
-            when :remove, :show, :hide, :toggle
-              Regexp.new(&quot;#{statement}\\(\&quot;#{id}\&quot;\\)&quot;)
-            else
-              Regexp.new(&quot;#{statement}\\(\&quot;#{id}\&quot;, #{RJS_PATTERN_HTML}\\)&quot;, Regexp::MULTILINE)
-          end
+        # any element, otherwise we replace it in the statement.
+        pattern = Regexp.new(
+          id ? statement.gsub(RJS_ANY_ID, &quot;\&quot;#{id}\&quot;&quot;) : statement
+        )
 
         # Duplicate the body since the next step involves destroying it.
         matches = nil
@@ -447,7 +431,7 @@ module ActionController
             matches = @response.body.match(pattern)
           else
             @response.body.gsub(pattern) do |match|
-              html = unescape_rjs($2)
+              html = unescape_rjs(match)
               matches ||= []
               matches.concat HTML::Document.new(html).root.children.select { |n| n.tag? }
               &quot;&quot;
@@ -577,27 +561,23 @@ module ActionController
 
       protected
         unless const_defined?(:RJS_STATEMENTS)
-          RJS_STATEMENTS = {
-            :replace              =&gt; /Element\.replace/,
-            :replace_html         =&gt; /Element\.update/,
-            :chained_replace      =&gt; /\.replace/,
-            :chained_replace_html =&gt; /\.update/,
-            :remove               =&gt; /Element\.remove/,
-            :show                 =&gt; /Element\.show/,
-            :hide                 =&gt; /Element\.hide/,
-            :toggle                 =&gt; /Element\.toggle/
+          RJS_PATTERN_HTML  = &quot;\&quot;((\\\\\&quot;|[^\&quot;])*)\&quot;&quot;
+          RJS_ANY_ID        = &quot;\&quot;([^\&quot;])*\&quot;&quot;
+          RJS_STATEMENTS    = {
+            :chained_replace      =&gt; &quot;\\$\\(#{RJS_ANY_ID}\\)\\.replace\\(#{RJS_PATTERN_HTML}\\)&quot;,
+            :chained_replace_html =&gt; &quot;\\$\\(#{RJS_ANY_ID}\\)\\.update\\(#{RJS_PATTERN_HTML}\\)&quot;,
+            :replace_html         =&gt; &quot;Element\\.update\\(#{RJS_ANY_ID}, #{RJS_PATTERN_HTML}\\)&quot;,
+            :replace              =&gt; &quot;Element\\.replace\\(#{RJS_ANY_ID}, #{RJS_PATTERN_HTML}\\)&quot;
           }
-          RJS_INSERTIONS = [:top, :bottom, :before, :after]
+          [:remove, :show, :hide, :toggle].each do |action|
+            RJS_STATEMENTS[action] = &quot;Element\\.#{action}\\(#{RJS_ANY_ID}\\)&quot;
+          end
+          RJS_INSERTIONS = [&quot;top&quot;, &quot;bottom&quot;, &quot;before&quot;, &quot;after&quot;]
           RJS_INSERTIONS.each do |insertion|
-            RJS_STATEMENTS[&quot;insert_#{insertion}&quot;.to_sym] = Regexp.new(Regexp.quote(&quot;new Insertion.#{insertion.to_s.camelize}&quot;))
+            RJS_STATEMENTS[&quot;insert_#{insertion}&quot;.to_sym] = &quot;Element.insert\\(#{RJS_ANY_ID}, \\{ #{insertion}: #{RJS_PATTERN_HTML} \\}\\)&quot;
           end
+          RJS_STATEMENTS[:insert_html] = &quot;Element.insert\\(#{RJS_ANY_ID}, \\{ (#{RJS_INSERTIONS.join('|')}): #{RJS_PATTERN_HTML} \\}\\)&quot;
           RJS_STATEMENTS[:any] = Regexp.new(&quot;(#{RJS_STATEMENTS.values.join('|')})&quot;)
-          RJS_STATEMENTS[:insert_html] = Regexp.new(RJS_INSERTIONS.collect do |insertion|
-            Regexp.quote(&quot;new Insertion.#{insertion.to_s.camelize}&quot;)
-          end.join('|'))
-          RJS_PATTERN_HTML = /&quot;((\\&quot;|[^&quot;])*)&quot;/
-          RJS_PATTERN_EVERYTHING = Regexp.new(&quot;#{RJS_STATEMENTS[:any]}\\(\&quot;([^\&quot;]*)\&quot;, #{RJS_PATTERN_HTML}\\)&quot;,
-                                              Regexp::MULTILINE)
           RJS_PATTERN_UNICODE_ESCAPED_CHAR = /\\u([0-9a-zA-Z]{4})/
         end
 
@@ -611,8 +591,8 @@ module ActionController
             root = HTML::Node.new(nil)
 
             while true
-              next if body.sub!(RJS_PATTERN_EVERYTHING) do |match|
-                html = unescape_rjs($3)
+              next if body.sub!(RJS_STATEMENTS[:any]) do |match|
+                html = unescape_rjs(match)
                 matches = HTML::Document.new(html).root.children.select { |n| n.tag? }
                 root.children.concat matches
                 &quot;&quot;</diff>
      <filename>vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -613,8 +613,9 @@ module ActionController #:nodoc:
       #
       # This takes the current URL as is and only exchanges the action. In contrast, &lt;tt&gt;url_for :action =&gt; 'print'&lt;/tt&gt;
       # would have slashed-off the path components after the changed action.
-      def url_for(options = nil) #:doc:
-        case options || {}
+      def url_for(options = {})
+        options ||= {}
+        case options
           when String
             options
           when Hash
@@ -743,6 +744,9 @@ module ActionController #:nodoc:
       #   # Renders the template located in [TEMPLATE_ROOT]/weblog/show.r(html|xml) (in Rails, app/views/weblog/show.erb)
       #   render :template =&gt; &quot;weblog/show&quot;
       #
+      #   # Renders the template with a local variable
+      #   render :template =&gt; &quot;weblog/show&quot;, :locals =&gt; {:customer =&gt; Customer.new}
+      #
       # === Rendering a file
       #
       # File rendering works just like action rendering except that it takes a filesystem path. By default, the path
@@ -865,7 +869,7 @@ module ActionController #:nodoc:
             render_for_file(file, options[:status], options[:use_full_path], options[:locals] || {})
 
           elsif template = options[:template]
-            render_for_file(template, options[:status], true)
+            render_for_file(template, options[:status], true, options[:locals] || {})
 
           elsif inline = options[:inline]
             add_variables_to_assigns
@@ -1147,7 +1151,7 @@ module ActionController #:nodoc:
 
       def log_processing
         if logger &amp;&amp; logger.info?
-          logger.info &quot;\n\nProcessing #{controller_class_name}\##{action_name} (for #{request_origin}) [#{request.method.to_s.upcase}]&quot;
+          logger.info &quot;\n\nProcessing #{self.class.name}\##{action_name} (for #{request_origin}) [#{request.method.to_s.upcase}]&quot;
           logger.info &quot;  Session ID: #{@_session.session_id}&quot; if @_session and @_session.respond_to?(:session_id)
           logger.info &quot;  Parameters: #{respond_to?(:filter_parameters) ? filter_parameters(params).inspect : params.inspect}&quot;
         end</diff>
      <filename>vendor/rails/actionpack/lib/action_controller/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -135,7 +135,7 @@ module ActionController
     # be reloaded on the next request without restarting the server.
     def cleanup_application
       ActiveRecord::Base.reset_subclasses if defined?(ActiveRecord)
-      Dependencies.clear
+      ActiveSupport::Dependencies.clear
       ActiveRecord::Base.clear_reloadable_connections! if defined?(ActiveRecord)
     end
 </diff>
      <filename>vendor/rails/actionpack/lib/action_controller/dispatcher.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,200 @@ module ActionController #:nodoc:
       end
     end
 
+    class FilterChain &lt; ActiveSupport::Callbacks::CallbackChain #:nodoc:
+      def append_filter_to_chain(filters, filter_type, &amp;block)
+        pos = find_filter_append_position(filters, filter_type)
+        update_filter_chain(filters, filter_type, pos, &amp;block)
+      end
+
+      def prepend_filter_to_chain(filters, filter_type, &amp;block)
+        pos = find_filter_prepend_position(filters, filter_type)
+        update_filter_chain(filters, filter_type, pos, &amp;block)
+      end
+
+      def create_filters(filters, filter_type, &amp;block)
+        filters, conditions = extract_options(filters, &amp;block)
+        filters.map! { |filter| find_or_create_filter(filter, filter_type, conditions) }
+        filters
+      end
+
+      def skip_filter_in_chain(*filters, &amp;test)
+        filters, conditions = extract_options(filters)
+        filters.each do |filter|
+          if callback = find(filter) then delete(callback) end
+        end if conditions.empty?
+        update_filter_in_chain(filters, :skip =&gt; conditions, &amp;test)
+      end
+
+      private
+        def update_filter_chain(filters, filter_type, pos, &amp;block)
+          new_filters = create_filters(filters, filter_type, &amp;block)
+          insert(pos, new_filters).flatten!
+        end
+
+        def find_filter_append_position(filters, filter_type)
+          # appending an after filter puts it at the end of the call chain
+          # before and around filters go before the first after filter in the chain
+          unless filter_type == :after
+            each_with_index do |f,i|
+              return i if f.after?
+            end
+          end
+          return -1
+        end
+
+        def find_filter_prepend_position(filters, filter_type)
+          # prepending a before or around filter puts it at the front of the call chain
+          # after filters go before the first after filter in the chain
+          if filter_type == :after
+            each_with_index do |f,i|
+              return i if f.after?
+            end
+            return -1
+          end
+          return 0
+        end
+
+        def find_or_create_filter(filter, filter_type, options = {})
+          update_filter_in_chain([filter], options)
+
+          if found_filter = find(filter) { |f| f.type == filter_type }
+            found_filter
+          else
+            filter_kind = case
+            when filter.respond_to?(:before) &amp;&amp; filter_type == :before
+              :before
+            when filter.respond_to?(:after) &amp;&amp; filter_type == :after
+              :after
+            else
+              :filter
+            end
+
+            case filter_type
+            when :before
+              BeforeFilter.new(filter_kind, filter, options)
+            when :after
+              AfterFilter.new(filter_kind, filter, options)
+            else
+              AroundFilter.new(filter_kind, filter, options)
+            end
+          end
+        end
+
+        def update_filter_in_chain(filters, options, &amp;test)
+          filters.map! { |f| block_given? ? find(f, &amp;test) : find(f) }
+          filters.compact!
+
+          map! do |filter|
+            if filters.include?(filter)
+              new_filter = filter.dup
+              new_filter.options.merge!(options)
+              new_filter
+            else
+              filter
+            end
+          end
+        end
+    end
+
+    class Filter &lt; ActiveSupport::Callbacks::Callback #:nodoc:
+      def before?
+        self.class == BeforeFilter
+      end
+
+      def after?
+        self.class == AfterFilter
+      end
+
+      def around?
+        self.class == AroundFilter
+      end
+
+      private
+        def should_not_skip?(controller)
+          if options[:skip]
+            !included_in_action?(controller, options[:skip])
+          else
+            true
+          end
+        end
+
+        def included_in_action?(controller, options)
+          if options[:only]
+            Array(options[:only]).map(&amp;:to_s).include?(controller.action_name)
+          elsif options[:except]
+            !Array(options[:except]).map(&amp;:to_s).include?(controller.action_name)
+          else
+            true
+          end
+        end
+
+        def should_run_callback?(controller)
+          should_not_skip?(controller) &amp;&amp; included_in_action?(controller, options) &amp;&amp; super
+        end
+    end
+
+    class AroundFilter &lt; Filter #:nodoc:
+      def type
+        :around
+      end
+
+      def call(controller, &amp;block)
+        if should_run_callback?(controller)
+          method = filter_responds_to_before_and_after? ? around_proc : self.method
+
+          # For around_filter do |controller, action|
+          if method.is_a?(Proc) &amp;&amp; method.arity == 2
+            evaluate_method(method, controller, block)
+          else
+            evaluate_method(method, controller, &amp;block)
+          end
+        else
+          block.call
+        end
+      end
+
+      private
+        def filter_responds_to_before_and_after?
+          method.respond_to?(:before) &amp;&amp; method.respond_to?(:after)
+        end
+
+        def around_proc
+          Proc.new do |controller, action|
+            method.before(controller)
+
+            if controller.send!(:performed?)
+              controller.send!(:halt_filter_chain, method, :rendered_or_redirected)
+            else
+              begin
+                action.call
+              ensure
+                method.after(controller)
+              end
+            end
+          end
+        end
+    end
+
+    class BeforeFilter &lt; Filter #:nodoc:
+      def type
+        :before
+      end
+
+      def call(controller, &amp;block)
+        super
+        if controller.send!(:performed?)
+          controller.send!(:halt_filter_chain, method, :rendered_or_redirected)
+        end
+      end
+    end
+
+    class AfterFilter &lt; Filter #:nodoc:
+      def type
+        :after
+      end
+    end
+
     # Filters enable controllers to run shared pre- and post-processing code for its actions. These filters can be used to do
     # authentication, caching, or auditing before the intended action is performed. Or to do localization or output
     # compression after the action has been performed. Filters have access to the request, response, and all the instance
@@ -245,201 +439,6 @@ module ActionController #:nodoc:
     # filter and controller action will not be run. If +before+ renders or redirects,
     # the second half of +around+ and will still run but +after+ and the
     # action will not. If +around+ fails to yield, +after+ will not be run.
-
-    class FilterChain &lt; ActiveSupport::Callbacks::CallbackChain #:nodoc:
-      def append_filter_to_chain(filters, filter_type, &amp;block)
-        pos = find_filter_append_position(filters, filter_type)
-        update_filter_chain(filters, filter_type, pos, &amp;block)
-      end
-
-      def prepend_filter_to_chain(filters, filter_type, &amp;block)
-        pos = find_filter_prepend_position(filters, filter_type)
-        update_filter_chain(filters, filter_type, pos, &amp;block)
-      end
-
-      def create_filters(filters, filter_type, &amp;block)
-        filters, conditions = extract_options(filters, &amp;block)
-        filters.map! { |filter| find_or_create_filter(filter, filter_type, conditions) }
-        filters
-      end
-
-      def skip_filter_in_chain(*filters, &amp;test)
-        filters, conditions = extract_options(filters)
-        filters.each do |filter|
-          if callback = find(filter) then delete(callback) end
-        end if conditions.empty?
-        update_filter_in_chain(filters, :skip =&gt; conditions, &amp;test)
-      end
-
-      private
-        def update_filter_chain(filters, filter_type, pos, &amp;block)
-          new_filters = create_filters(filters, filter_type, &amp;block)
-          insert(pos, new_filters).flatten!
-        end
-
-        def find_filter_append_position(filters, filter_type)
-          # appending an after filter puts it at the end of the call chain
-          # before and around filters go before the first after filter in the chain
-          unless filter_type == :after
-            each_with_index do |f,i|
-              return i if f.after?
-            end
-          end
-          return -1
-        end
-
-        def find_filter_prepend_position(filters, filter_type)
-          # prepending a before or around filter puts it at the front of the call chain
-          # after filters go before the first after filter in the chain
-          if filter_type == :after
-            each_with_index do |f,i|
-              return i if f.after?
-            end
-            return -1
-          end
-          return 0
-        end
-
-        def find_or_create_filter(filter, filter_type, options = {})
-          update_filter_in_chain([filter], options)
-
-          if found_filter = find(filter) { |f| f.type == filter_type }
-            found_filter
-          else
-            filter_kind = case
-            when filter.respond_to?(:before) &amp;&amp; filter_type == :before
-              :before
-            when filter.respond_to?(:after) &amp;&amp; filter_type == :after
-              :after
-            else
-              :filter
-            end
-
-            case filter_type
-            when :before
-              BeforeFilter.new(filter_kind, filter, options)
-            when :after
-              AfterFilter.new(filter_kind, filter, options)
-            else
-              AroundFilter.new(filter_kind, filter, options)
-            end
-          end
-        end
-
-        def update_filter_in_chain(filters, options, &amp;test)
-          filters.map! { |f| block_given? ? find(f, &amp;test) : find(f) }
-          filters.compact!
-
-          map! do |filter|
-            if filters.include?(filter)
-              new_filter = filter.dup
-              new_filter.options.merge!(options)
-              new_filter
-            else
-              filter
-            end
-          end
-        end
-    end
-
-    class Filter &lt; ActiveSupport::Callbacks::Callback #:nodoc:
-      def before?
-        self.class == BeforeFilter
-      end
-
-      def after?
-        self.class == AfterFilter
-      end
-
-      def around?
-        self.class == AroundFilter
-      end
-
-      private
-        def should_not_skip?(controller)
-          if options[:skip]
-            !included_in_action?(controller, options[:skip])
-          else
-            true
-          end
-        end
-
-        def included_in_action?(controller, options)
-          if options[:only]
-            Array(options[:only]).map(&amp;:to_s).include?(controller.action_name)
-          elsif options[:except]
-            !Array(options[:except]).map(&amp;:to_s).include?(controller.action_name)
-          else
-            true
-          end
-        end
-
-        def should_run_callback?(controller)
-          should_not_skip?(controller) &amp;&amp; included_in_action?(controller, options) &amp;&amp; super
-        end
-    end
-
-    class AroundFilter &lt; Filter #:nodoc:
-      def type
-        :around
-      end
-
-      def call(controller, &amp;block)
-        if should_run_callback?(controller)
-          method = filter_responds_to_before_and_after? ? around_proc : self.method
-
-          # For around_filter do |controller, action|
-          if method.is_a?(Proc) &amp;&amp; method.arity == 2
-            evaluate_method(method, controller, block)
-          else
-            evaluate_method(method, controller, &amp;block)
-          end
-        else
-          block.call
-        end
-      end
-
-      private
-        def filter_responds_to_before_and_after?
-          method.respond_to?(:before) &amp;&amp; method.respond_to?(:after)
-        end
-
-        def around_proc
-          Proc.new do |controller, action|
-            method.before(controller)
-
-            if controller.send!(:performed?)
-              controller.send!(:halt_filter_chain, method, :rendered_or_redirected)
-            else
-              begin
-                action.call
-              ensure
-                method.after(controller)
-              end
-            end
-          end
-        end
-    end
-
-    class BeforeFilter &lt; Filter #:nodoc:
-      def type
-        :before
-      end
-
-      def call(controller, &amp;block)
-        super
-        if controller.send!(:performed?)
-          controller.send!(:halt_filter_chain, method, :rendered_or_redirected)
-        end
-      end
-    end
-
-    class AfterFilter &lt; Filter #:nodoc:
-      def type
-        :after
-      end
-    end
-
     module ClassMethods
       # The passed &lt;tt&gt;filters&lt;/tt&gt; will be appended to the filter_chain and
       # will execute before the action on this controller is performed.</diff>
      <filename>vendor/rails/actionpack/lib/action_controller/filters.rb</filename>
    </modified>
    <modified>
      <diff>@@ -48,6 +48,9 @@ module ActionController
     #
     #   # calls post_url(post)
     #   polymorphic_url(post) # =&gt; &quot;http://example.com/posts/1&quot;
+    #   polymorphic_url([blog, post]) # =&gt; &quot;http://example.com/blogs/1/posts/1&quot;
+    #   polymorphic_url([:admin, blog, post]) # =&gt; &quot;http://example.com/admin/blogs/1/posts/1&quot;
+    #   polymorphic_url([user, :blog, post]) # =&gt; &quot;http://example.com/users/1/blog/posts/1&quot;
     #
     # ==== Options
     #
@@ -83,8 +86,6 @@ module ActionController
         else        [ record_or_hash_or_array ]
       end
 
-      args &lt;&lt; format if format
-
       inflection =
         case
         when options[:action].to_s == &quot;new&quot;
@@ -96,6 +97,9 @@ module ActionController
         else
           :singular
         end
+
+      args.delete_if {|arg| arg.is_a?(Symbol) || arg.is_a?(String)}
+      args &lt;&lt; format if format
       
       named_route = build_named_route_call(record_or_hash_or_array, namespace, inflection, options)
       send!(named_route, *args)
@@ -136,11 +140,19 @@ module ActionController
         else
           record = records.pop
           route = records.inject(&quot;&quot;) do |string, parent|
-            string &lt;&lt; &quot;#{RecordIdentifier.send!(&quot;singular_class_name&quot;, parent)}_&quot;
+            if parent.is_a?(Symbol) || parent.is_a?(String)
+              string &lt;&lt; &quot;#{parent}_&quot;
+            else
+              string &lt;&lt; &quot;#{RecordIdentifier.send!(&quot;singular_class_name&quot;, parent)}_&quot;
+            end
           end
         end
 
-        route &lt;&lt; &quot;#{RecordIdentifier.send!(&quot;#{inflection}_class_name&quot;, record)}_&quot;
+        if record.is_a?(Symbol) || record.is_a?(String)
+          route &lt;&lt; &quot;#{record}_&quot;
+        else
+          route &lt;&lt; &quot;#{RecordIdentifier.send!(&quot;#{inflection}_class_name&quot;, record)}_&quot;
+        end
 
         action_prefix(options) + namespace + route + routing_type(options).to_s
       end
@@ -163,16 +175,17 @@ module ActionController
         end
       end
       
+      # Remove the first symbols from the array and return the url prefix
+      # implied by those symbols.
       def extract_namespace(record_or_hash_or_array)
-        returning &quot;&quot; do |namespace|
-          if record_or_hash_or_array.is_a?(Array)
-            record_or_hash_or_array.delete_if do |record_or_namespace|
-              if record_or_namespace.is_a?(String) || record_or_namespace.is_a?(Symbol)
-                namespace &lt;&lt; &quot;#{record_or_namespace}_&quot;
-              end
-            end
-          end  
+        return &quot;&quot; unless record_or_hash_or_array.is_a?(Array)
+
+        namespace_keys = []
+        while (key = record_or_hash_or_array.first) &amp;&amp; key.is_a?(String) || key.is_a?(Symbol)
+          namespace_keys &lt;&lt; record_or_hash_or_array.shift
         end
+
+        namespace_keys.map {|k| &quot;#{k}_&quot;}.join
       end
   end
 end</diff>
      <filename>vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -31,18 +31,21 @@ module ActionController
   module RecordIdentifier
     extend self
 
+    JOIN = '_'.freeze
+    NEW = 'new'.freeze
+
     # Returns plural/singular for a record or class. Example:
     #
     #   partial_path(post)                   # =&gt; &quot;posts/post&quot;
     #   partial_path(Person)                 # =&gt; &quot;people/person&quot;
     #   partial_path(Person, &quot;admin/games&quot;)  # =&gt; &quot;admin/people/person&quot;
     def partial_path(record_or_class, controller_path = nil)
-      klass = class_from_record_or_class(record_or_class)
+      name = model_name_from_record_or_class(record_or_class)
 
       if controller_path &amp;&amp; controller_path.include?(&quot;/&quot;)
-        &quot;#{File.dirname(controller_path)}/#{klass.name.tableize}/#{klass.name.demodulize.underscore}&quot;
+        &quot;#{File.dirname(controller_path)}/#{name.partial_path}&quot;
       else
-        &quot;#{klass.name.tableize}/#{klass.name.demodulize.underscore}&quot;
+        name.partial_path
       end
     end
 
@@ -56,21 +59,25 @@ module ActionController
     #   dom_class(post, :edit)   # =&gt; &quot;edit_post&quot;
     #   dom_class(Person, :edit) # =&gt; &quot;edit_person&quot;
     def dom_class(record_or_class, prefix = nil)
-      [ prefix, singular_class_name(record_or_class) ].compact * '_'
+      singular = singular_class_name(record_or_class)
+      prefix ? &quot;#{prefix}#{JOIN}#{singular}&quot; : singular
     end
 
     # The DOM id convention is to use the singular form of an object or class with the id following an underscore.
     # If no id is found, prefix with &quot;new_&quot; instead. Examples:
     #
-    #   dom_id(Post.new(:id =&gt; 45)) # =&gt; &quot;post_45&quot;
+    #   dom_id(Post.find(45))       # =&gt; &quot;post_45&quot;
     #   dom_id(Post.new)            # =&gt; &quot;new_post&quot;
     #
     # If you need to address multiple instances of the same class in the same view, you can prefix the dom_id:
     #
-    #   dom_id(Post.new(:id =&gt; 45), :edit) # =&gt; &quot;edit_post_45&quot;
+    #   dom_id(Post.find(45), :edit) # =&gt; &quot;edit_post_45&quot;
     def dom_id(record, prefix = nil) 
-      prefix ||= 'new' unless record.id
-      [ prefix, singular_class_name(record), record.id ].compact * '_'
+      if record_id = record.id
+        &quot;#{dom_class(record, prefix)}#{JOIN}#{record_id}&quot;
+      else
+        dom_class(record, prefix || NEW)
+      end
     end
 
     # Returns the plural class name of a record or class. Examples:
@@ -78,7 +85,7 @@ module ActionController
     #   plural_class_name(post)             # =&gt; &quot;posts&quot;
     #   plural_class_name(Highrise::Person) # =&gt; &quot;highrise_people&quot;
     def plural_class_name(record_or_class)
-      singular_class_name(record_or_class).pluralize
+      model_name_from_record_or_class(record_or_class).plural
     end
 
     # Returns the singular class name of a record or class. Examples:
@@ -86,12 +93,12 @@ module ActionController
     #   singular_class_name(post)             # =&gt; &quot;post&quot;
     #   singular_class_name(Highrise::Person) # =&gt; &quot;highrise_person&quot;
     def singular_class_name(record_or_class)
-      class_from_record_or_class(record_or_class).name.underscore.tr('/', '_')
+      model_name_from_record_or_class(record_or_class).singular
     end
 
     private
-      def class_from_record_or_class(record_or_class)
-        record_or_class.is_a?(Class) ? record_or_class : record_or_class.class
+      def model_name_from_record_or_class(record_or_class)
+        (record_or_class.is_a?(Class) ? record_or_class : record_or_class.class).model_name
       end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>vendor/rails/actionpack/lib/action_controller/record_identifier.rb</filename>
    </modified>
    <modified>
      <diff>@@ -134,14 +134,17 @@ module ActionController
     # REMOTE_ADDR is a proxy.  HTTP_X_FORWARDED_FOR may be a comma-
     # delimited list in the case of multiple chained proxies; the last
     # address which is not trusted is the originating IP.
-
     def remote_ip
-      if TRUSTED_PROXIES !~ @env['REMOTE_ADDR']
-        return @env['REMOTE_ADDR']
+      remote_addr_list = @env['REMOTE_ADDR'] &amp;&amp; @env['REMOTE_ADDR'].split(',').collect(&amp;:strip)
+
+      unless remote_addr_list.blank?
+        not_trusted_addrs = remote_addr_list.reject {|addr| addr =~ TRUSTED_PROXIES}
+        return not_trusted_addrs.first unless not_trusted_addrs.empty?
       end
+      remote_ips = @env['HTTP_X_FORWARDED_FOR'] &amp;&amp; @env['HTTP_X_FORWARDED_FOR'].split(',')
 
       if @env.include? 'HTTP_CLIENT_IP'
-        if @env.include? 'HTTP_X_FORWARDED_FOR'
+        if remote_ips &amp;&amp; !remote_ips.include?(@env['HTTP_CLIENT_IP'])
           # We don't know which came from the proxy, and which from the user
           raise ActionControllerError.new(&lt;&lt;EOM)
 IP spoofing attack?!
@@ -149,11 +152,11 @@ HTTP_CLIENT_IP=#{@env['HTTP_CLIENT_IP'].inspect}
 HTTP_X_FORWARDED_FOR=#{@env['HTTP_X_FORWARDED_FOR'].inspect}
 EOM
         end
+
         return @env['HTTP_CLIENT_IP']
       end
 
-      if @env.include? 'HTTP_X_FORWARDED_FOR' then
-        remote_ips = @env['HTTP_X_FORWARDED_FOR'].split(',')
+      if remote_ips
         while remote_ips.size &gt; 1 &amp;&amp; TRUSTED_PROXIES =~ remote_ips.last.strip
           remote_ips.pop
         end</diff>
      <filename>vendor/rails/actionpack/lib/action_controller/request.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/actionpack/lib/action_controller/request_profiler.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/actionpack/lib/action_controller/response.rb</filename>
    </modified>
    <modified>
      <diff>@@ -88,6 +88,10 @@ module ActionController
   #
   #   map.connect ':controller/:action/:id', :action =&gt; 'show', :defaults =&gt; { :page =&gt; 'Dashboard' }
   #
+  # Note: The default routes, as provided by the Rails generator, make all actions in every
+  # controller accessible via GET requests. You should consider removing them or commenting
+  # them out if you're using named routes and resources.
+  #
   # == Named routes
   #
   # Routes can be named with the syntax &lt;tt&gt;map.name_of_route options&lt;/tt&gt;,
@@ -369,7 +373,7 @@ module ActionController
 
     Routes = RouteSet.new
 
-    ::Inflector.module_eval do
+    ActiveSupport::Inflector.module_eval do
 	  # Ensures that routes are reloaded when Rails inflections are updated.
       def inflections_with_route_reloading(&amp;block)
         returning(inflections_without_route_reloading(&amp;block)) {</diff>
      <filename>vendor/rails/actionpack/lib/action_controller/routing.rb</filename>
    </modified>
    <modified>
      <diff>@@ -67,10 +67,9 @@ module ActionController
         options = options.dup
 
         if options[:namespace]
-          options[:controller] = &quot;#{options[:path_prefix]}/#{options[:controller]}&quot;
+          options[:controller] = &quot;#{options.delete(:namespace).sub(/\/$/, '')}/#{options[:controller]}&quot;
           options.delete(:path_prefix)
           options.delete(:name_prefix)
-          options.delete(:namespace)
         end
 
         requirements = (options.delete(:requirements) || {}).dup</diff>
      <filename>vendor/rails/actionpack/lib/action_controller/routing/builder.rb</filename>
    </modified>
    <modified>
      <diff>@@ -249,7 +249,7 @@ module ActionController
       end
 
       def extract_value
-        &quot;#{local_name} = hash[:#{key}] &amp;&amp; hash[:#{key}].collect { |path_component| URI.escape(path_component.to_param, ActionController::Routing::Segment::UNSAFE_PCHAR) }.to_param #{&quot;|| #{default.inspect}&quot; if default}&quot;
+        &quot;#{local_name} = hash[:#{key}] &amp;&amp; Array(hash[:#{key}]).collect { |path_component| URI.escape(path_component.to_param, ActionController::Routing::Segment::UNSAFE_PCHAR) }.to_param #{&quot;|| #{default.inspect}&quot; if default}&quot;
       end
 
       def default</diff>
      <filename>vendor/rails/actionpack/lib/action_controller/routing/segments.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-&lt;html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
 &lt;head&gt;
   &lt;title&gt;Action Controller: Exception caught&lt;/title&gt;
   &lt;style&gt;</diff>
      <filename>vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.erb</filename>
    </modified>
    <modified>
      <diff>@@ -171,7 +171,7 @@ module ActionController #:nodoc:
 
     # Was the response successful?
     def success?
-      response_code == 200
+      (200..299).include?(response_code)
     end
 
     # Was the URL not found?
@@ -333,7 +333,7 @@ module ActionController #:nodoc:
     attr_reader :original_filename
 
     # The content type of the &quot;uploaded&quot; file
-    attr_reader :content_type
+    attr_accessor :content_type
 
     def initialize(path, content_type = Mime::TEXT, binary = false)
       raise &quot;#{path} file does not exist&quot; unless File.exist?(path)
@@ -413,6 +413,8 @@ module ActionController #:nodoc:
       get(@response.redirected_to.delete(:action), @response.redirected_to.stringify_keys)
     end
 
+    deprecate :follow_redirect =&gt; &quot;If you wish to follow redirects, you should use integration tests&quot;
+
     def assigns(key = nil) 
       if key.nil? 
         @response.template.assigns </diff>
      <filename>vendor/rails/actionpack/lib/action_controller/test_process.rb</filename>
    </modified>
    <modified>
      <diff>@@ -17,7 +17,7 @@ module HTML #:nodoc:
       @root = Node.new(nil)
       node_stack = [ @root ]
       while token = tokenizer.next
-        node = Node.parse(node_stack.last, tokenizer.line, tokenizer.position, token)
+        node = Node.parse(node_stack.last, tokenizer.line, tokenizer.position, token, strict)
 
         node_stack.last.children &lt;&lt; node unless node.tag? &amp;&amp; node.closing == :close
         if node.tag?</diff>
      <filename>vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/document.rb</filename>
    </modified>
    <modified>
      <diff>@@ -116,7 +116,7 @@ module ActionController #:nodoc:
     end
     
     def apply_redirect_to(redirect_to_option) # :nodoc:
-      redirect_to_option.is_a?(Symbol) ? self.send!(redirect_to_option) : redirect_to_option
+      (redirect_to_option.is_a?(Symbol) &amp;&amp; redirect_to_option != :back) ? self.send!(redirect_to_option) : redirect_to_option
     end
     
     def apply_remaining_actions(options) # :nodoc:</diff>
      <filename>vendor/rails/actionpack/lib/action_controller/verification.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ module ActionPack #:nodoc:
   module VERSION #:nodoc:
     MAJOR = 2
     MINOR = 1
-    TINY  = 0
+    TINY  = 1
 
     STRING = [MAJOR, MINOR, TINY].join('.')
   end</diff>
      <filename>vendor/rails/actionpack/lib/action_pack/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -178,10 +178,13 @@ module ActionView #:nodoc:
     # that alert()s the caught exception (and then re-raises it). 
     @@debug_rjs = false
     cattr_accessor :debug_rjs
-    
+
     @@erb_variable = '_erbout'
     cattr_accessor :erb_variable
-    
+    class &lt;&lt; self
+      deprecate :erb_variable= =&gt; 'The erb variable will no longer be configurable. Use the concat helper method instead of appending to it directly.'
+    end
+
     attr_internal :request
 
     delegate :request_forgery_protection_token, :template, :params, :session, :cookies, :response, :headers,
@@ -253,6 +256,7 @@ If you are rendering a subtemplate, you must now use controller-like partial syn
       elsif options == :update
         update_page(&amp;block)
       elsif options.is_a?(Hash)
+        use_full_path = options[:use_full_path]
         options = options.reverse_merge(:locals =&gt; {}, :use_full_path =&gt; true)
 
         if partial_layout = options.delete(:layout)
@@ -266,7 +270,7 @@ If you are rendering a subtemplate, you must now use controller-like partial syn
             end
           end
         elsif options[:file]
-          render_file(options[:file], options[:use_full_path], options[:locals])
+          render_file(options[:file], use_full_path || false, options[:locals])
         elsif options[:partial] &amp;&amp; options[:collection]
           render_partial_collection(options[:partial], options[:collection], options[:spacer_template], options[:locals])
         elsif options[:partial]</diff>
      <filename>vendor/rails/actionpack/lib/action_view/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -485,21 +485,24 @@ module ActionView
                     source = &quot;#{@controller.request.relative_url_root}#{source}&quot;
                   end
                 end
-                source = rewrite_asset_path(source)
 
-                if include_host
-                  host = compute_asset_host(source)
+                rewrite_asset_path(source)
+              end
+            end
 
-                  if has_request &amp;&amp; !host.blank? &amp;&amp; host !~ %r{^[-a-z]+://}
-                    host = &quot;#{@controller.request.protocol}#{host}&quot;
-                  end
+          source = ActionView::Base.computed_public_paths[cache_key]
 
-                  &quot;#{host}#{source}&quot;
-                else
-                  source
-                end
-              end
+          if include_host &amp;&amp; source !~ %r{^[-a-z]+://}
+            host = compute_asset_host(source)
+
+            if has_request &amp;&amp; !host.blank? &amp;&amp; host !~ %r{^[-a-z]+://}
+              host = &quot;#{@controller.request.protocol}#{host}&quot;
             end
+
+            &quot;#{host}#{source}&quot;
+          else
+            source
+          end
         end
 
         # Pick an asset host for this source. Returns +nil+ if no host is set,</diff>
      <filename>vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -696,15 +696,15 @@ module ActionView
 
     class FormBuilder
       def date_select(method, options = {}, html_options = {})
-        @template.date_select(@object_name, method, options.merge(:object =&gt; @object))
+        @template.date_select(@object_name, method, options.merge(:object =&gt; @object), html_options)
       end
 
       def time_select(method, options = {}, html_options = {})
-        @template.time_select(@object_name, method, options.merge(:object =&gt; @object))
+        @template.time_select(@object_name, method, options.merge(:object =&gt; @object), html_options)
       end
 
       def datetime_select(method, options = {}, html_options = {})
-        @template.datetime_select(@object_name, method, options.merge(:object =&gt; @object))
+        @template.datetime_select(@object_name, method, options.merge(:object =&gt; @object), html_options)
       end
     end
   end</diff>
      <filename>vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -601,7 +601,11 @@ module ActionView
       end
 
       def object
-        @object || (@template_object.instance_variable_get(&quot;@#{@object_name}&quot;) rescue nil)
+        @object || @template_object.instance_variable_get(&quot;@#{@object_name}&quot;)
+      rescue NameError
+        # As @object_name may contain the nested syntax (item[subobject]) we
+        # need to fallback to nil.
+        nil
       end
 
       def value(object)</diff>
      <filename>vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -304,7 +304,7 @@ module ActionView
       #
       # NOTE: Only the option tags are returned, you have to wrap this call in
       # a regular HTML select tag.
-      def time_zone_options_for_select(selected = nil, priority_zones = nil, model = TimeZone)
+      def time_zone_options_for_select(selected = nil, priority_zones = nil, model = ::ActiveSupport::TimeZone)
         zone_options = &quot;&quot;
 
         zones = model.all
@@ -417,7 +417,7 @@ module ActionView
         value = value(object)
         content_tag(&quot;select&quot;,
           add_options(
-            time_zone_options_for_select(value || options[:default], priority_zones, options[:model] || TimeZone),
+            time_zone_options_for_select(value || options[:default], priority_zones, options[:model] || ActiveSupport::TimeZone),
             options, value
           ), html_options
         )</diff>
      <filename>vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -129,7 +129,7 @@ module ActionView
       #   label_tag 'name', nil, :class =&gt; 'small_label'
       #   # =&gt; &lt;label for=&quot;name&quot; class=&quot;small_label&quot;&gt;Name&lt;/label&gt;
       def label_tag(name, text = nil, options = {})
-        content_tag :label, text || name.humanize, { &quot;for&quot; =&gt; name }.update(options.stringify_keys)
+        content_tag :label, text || name.to_s.humanize, { &quot;for&quot; =&gt; name }.update(options.stringify_keys)
       end
 
       # Creates a hidden form input field used to transmit data that would be lost due to HTTP's statelessness or
@@ -348,11 +348,13 @@ module ActionView
         options.stringify_keys!
         
         if disable_with = options.delete(&quot;disable_with&quot;)
+          disable_with = &quot;this.value='#{disable_with}'&quot;
+          disable_with &lt;&lt; &quot;;#{options.delete('onclick')}&quot; if options['onclick']
+          
           options[&quot;onclick&quot;] = [
             &quot;this.setAttribute('originalValue', this.value)&quot;,
             &quot;this.disabled=true&quot;,
-            &quot;this.value='#{disable_with}'&quot;,
-            &quot;#{options[&quot;onclick&quot;]}&quot;,
+            disable_with,
             &quot;result = (this.form.onsubmit ? (this.form.onsubmit() ? this.form.submit() : false) : this.form.submit())&quot;,
             &quot;if (result == false) { this.value = this.getAttribute('originalValue'); this.disabled = false }&quot;,
             &quot;return result;&quot;,</diff>
      <filename>vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -80,10 +80,9 @@ module ActionView
       #       return false;&quot;&gt;Show me more&lt;/a&gt;
       #
       def link_to_function(name, *args, &amp;block)
-        html_options = args.extract_options!
+        html_options = args.extract_options!.symbolize_keys
         function = args[0] || ''
 
-        html_options.symbolize_keys!
         function = update_page(&amp;block) if block_given?
         content_tag(
           &quot;a&quot;, name, 
@@ -111,10 +110,9 @@ module ActionView
       #     page[:details].visual_effect :toggle_slide
       #   end
       def button_to_function(name, *args, &amp;block)
-        html_options = args.extract_options!
+        html_options = args.extract_options!.symbolize_keys
         function = args[0] || ''
 
-        html_options.symbolize_keys!
         function = update_page(&amp;block) if block_given?
         tag(:input, html_options.merge({ 
           :type =&gt; &quot;button&quot;, :value =&gt; name, 
@@ -147,6 +145,8 @@ module ActionView
         javascript &lt;&lt; '&lt;/script&gt;'
       end
 
+      deprecate :define_javascript_functions=&gt;&quot;use javascript_include_tag instead&quot;
+
       # Escape carrier returns and single and double quotes for JavaScript segments.
       def escape_javascript(javascript)
         (javascript || '').gsub('\\','\0\0').gsub('&lt;/','&lt;\/').gsub(/\r\n|\n|\r/, &quot;\\n&quot;).gsub(/[&quot;']/) { |m| &quot;\\#{m}&quot; }</diff>
      <filename>vendor/rails/actionpack/lib/action_view/helpers/javascript_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -111,7 +111,7 @@ module ActionView
                          (100..599).to_a)
         AJAX_OPTIONS = Set.new([ :before, :after, :condition, :url,
                          :asynchronous, :method, :insertion, :position,
-                         :form, :with, :update, :script ]).merge(CALLBACKS)
+                         :form, :with, :update, :script, :type ]).merge(CALLBACKS)
       end
 
       # Returns a link to a remote action defined by &lt;tt&gt;options[:url]&lt;/tt&gt; 
@@ -603,7 +603,7 @@ module ActionView
         # Example:
         #
         #   # Generates:
-        #   #     new Insertion.Bottom(&quot;list&quot;, &quot;&lt;li&gt;Some item&lt;/li&gt;&quot;);
+        #   #     new Element.insert(&quot;list&quot;, { bottom: &lt;li&gt;Some item&lt;/li&gt;&quot; });
         #   #     new Effect.Highlight(&quot;list&quot;);
         #   #     [&quot;status-indicator&quot;, &quot;cancel-link&quot;].each(Element.hide);
         #   update_page do |page|
@@ -736,16 +736,16 @@ module ActionView
           #
           #   # Insert the rendered 'navigation' partial just before the DOM
           #   # element with ID 'content'.
-          #   # Generates: new Insertion.Before(&quot;content&quot;, &quot;-- Contents of 'navigation' partial --&quot;);
+          #   # Generates: Element.insert(&quot;content&quot;, { before: &quot;-- Contents of 'navigation' partial --&quot; });
           #   page.insert_html :before, 'content', :partial =&gt; 'navigation'
           #
           #   # Add a list item to the bottom of the &lt;ul&gt; with ID 'list'.
-          #   # Generates: new Insertion.Bottom(&quot;list&quot;, &quot;&lt;li&gt;Last item&lt;/li&gt;&quot;);
+          #   # Generates: Element.insert(&quot;list&quot;, { bottom: &quot;&lt;li&gt;Last item&lt;/li&gt;&quot; });
           #   page.insert_html :bottom, 'list', '&lt;li&gt;Last item&lt;/li&gt;'
           #
           def insert_html(position, id, *options_for_render)
-            insertion = position.to_s.camelize
-            call &quot;new Insertion.#{insertion}&quot;, id, render(*options_for_render)
+            content = javascript_object_for(render(*options_for_render))
+            record &quot;Element.insert(\&quot;#{id}\&quot;, { #{position.to_s.downcase}: #{content} });&quot;
           end
           
           # Replaces the inner HTML of the DOM element with the given +id+.
@@ -1039,7 +1039,7 @@ module ActionView
       
         js_options['asynchronous'] = options[:type] != :synchronous
         js_options['method']       = method_option_to_s(options[:method]) if options[:method]
-        js_options['insertion']    = &quot;Insertion.#{options[:position].to_s.camelize}&quot; if options[:position]
+        js_options['insertion']    = &quot;'#{options[:position].to_s.downcase}'&quot; if options[:position]
         js_options['evalScripts']  = options[:script].nil? || options[:script]
 
         if options[:form]</diff>
      <filename>vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 require 'cgi'
 require 'erb'
+require 'set'
 
 module ActionView
   module Helpers #:nodoc:
@@ -8,7 +9,8 @@ module ActionView
     module TagHelper
       include ERB::Util
 
-      BOOLEAN_ATTRIBUTES = Set.new(%w(disabled readonly multiple))
+      BOOLEAN_ATTRIBUTES = %w(disabled readonly multiple).to_set
+      BOOLEAN_ATTRIBUTES.merge(BOOLEAN_ATTRIBUTES.map(&amp;:to_sym))
 
       # Returns an empty HTML tag of type +name+ which by default is XHTML 
       # compliant. Set +open+ to true to create an open tag compatible 
@@ -37,7 +39,7 @@ module ActionView
       #   tag(&quot;img&quot;, { :src =&gt; &quot;open &amp;amp; shut.png&quot; }, false, false)
       #   # =&gt; &lt;img src=&quot;open &amp;amp; shut.png&quot; /&gt;
       def tag(name, options = nil, open = false, escape = true)
-        &quot;&lt;#{name}#{tag_options(options, escape) if options}&quot; + (open ? &quot;&gt;&quot; : &quot; /&gt;&quot;)
+        &quot;&lt;#{name}#{tag_options(options, escape) if options}#{open ? &quot;&gt;&quot; : &quot; /&gt;&quot;}&quot;
       end
 
       # Returns an HTML block tag of type +name+ surrounding the +content+. Add
@@ -114,7 +116,6 @@ module ActionView
             if escape
               options.each do |key, value|
                 next unless value
-                key = key.to_s
                 value = BOOLEAN_ATTRIBUTES.include?(key) ? key : escape_once(value)
                 attrs &lt;&lt; %(#{key}=&quot;#{value}&quot;)
               end</diff>
      <filename>vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -464,7 +464,7 @@ module ActionView
                           [-\w]+                   # subdomain or domain
                           (?:\.[-\w]+)*            # remaining subdomains or domain
                           (?::\d+)?                # port
-                          (?:/(?:(?:[~\w\+@%=\(\)-]|(?:[,.;:][^\s$]))+)?)* # path
+                          (?:/(?:(?:[~\w\+@%=\(\)-]|(?:[,.;:'][^\s$]))+)?)* # path
                           (?:\?[\w\+@%&amp;=.;-]+)?     # query string
                           (?:\#[\w\-]*)?           # trailing anchor
                         )</diff>
      <filename>vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -63,17 +63,15 @@ module ActionView
       #   # calls @workshop.to_s
       #   # =&gt; /workshops/5
       def url_for(options = {})
+        options ||= {}
         case options
         when Hash
-          show_path =  options[:host].nil? ? true : false
-          options = { :only_path =&gt; show_path }.update(options.symbolize_keys)
+          options = { :only_path =&gt; options[:host].nil? }.update(options.symbolize_keys)
           escape  = options.key?(:escape) ? options.delete(:escape) : true
           url     = @controller.send(:url_for, options)
         when String
           escape = true
           url    = options
-        when NilClass
-          url = @controller.send(:url_for, nil)
         else
           escape = false
           url    = polymorphic_path(options)
@@ -444,7 +442,7 @@ module ActionView
         email_address_obfuscated.gsub!(/\./, html_options.delete(&quot;replace_dot&quot;)) if html_options.has_key?(&quot;replace_dot&quot;)
 
         if encode == &quot;javascript&quot;
-          &quot;document.write('#{content_tag(&quot;a&quot;, name || email_address, html_options.merge({ &quot;href&quot; =&gt; &quot;mailto:&quot;+email_address+extras }))}');&quot;.each_byte do |c|
+          &quot;document.write('#{content_tag(&quot;a&quot;, name || email_address_obfuscated, html_options.merge({ &quot;href&quot; =&gt; &quot;mailto:&quot;+email_address+extras }))}');&quot;.each_byte do |c|
             string &lt;&lt; sprintf(&quot;%%%x&quot;, c)
           end
           &quot;&lt;script type=\&quot;#{Mime::JS}\&quot;&gt;eval(unescape('#{string}'))&lt;/script&gt;&quot;</diff>
      <filename>vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,10 +22,10 @@ module ActionView #:nodoc:
     end
     
     def render_member(object)
-      @locals[@counter_name] += 1
       @locals[:object] = @locals[@variable_name] = object
       
       template = render_template
+      @locals[@counter_name] += 1
       @locals.delete(@variable_name)
       @locals.delete(:object)
       </diff>
      <filename>vendor/rails/actionpack/lib/action_view/partial_template.rb</filename>
    </modified>
    <modified>
      <diff>@@ -137,6 +137,9 @@ class AssertResponseWithUnexpectedErrorController &lt; ActionController::Base
   end
 end
 
+class UserController &lt; ActionController::Base
+end
+
 module Admin
   class InnerModuleController &lt; ActionController::Base
     def index
@@ -174,7 +177,7 @@ class ActionPackAssertionsControllerTest &lt; Test::Unit::TestCase
   # let's get this party started
   def setup
     ActionController::Routing::Routes.reload
-    ActionController::Routing.use_controllers!(%w(action_pack_assertions admin/inner_module content admin/user))
+    ActionController::Routing.use_controllers!(%w(action_pack_assertions admin/inner_module user content admin/user))
     @controller = ActionPackAssertionsController.new
     @request, @response = ActionController::TestRequest.new, ActionController::TestResponse.new
   end
@@ -268,7 +271,7 @@ class ActionPackAssertionsControllerTest &lt; Test::Unit::TestCase
       assert_redirected_to admin_inner_module_path
     end
   end
-  
+
   def test_assert_redirected_to_top_level_named_route_from_nested_controller
     with_routing do |set|
       set.draw do |map|
@@ -277,11 +280,25 @@ class ActionPackAssertionsControllerTest &lt; Test::Unit::TestCase
       end
       @controller = Admin::InnerModuleController.new
       process :redirect_to_top_level_named_route
-      # passes -&gt; assert_redirected_to &quot;http://test.host/action_pack_assertions/foo&quot;
+      # assert_redirected_to &quot;http://test.host/action_pack_assertions/foo&quot; would pass because of exact match early return
       assert_redirected_to &quot;/action_pack_assertions/foo&quot;
     end
   end
 
+  def test_assert_redirected_to_top_level_named_route_with_same_controller_name_in_both_namespaces
+    with_routing do |set|
+      set.draw do |map|
+        # this controller exists in the admin namespace as well which is the only difference from previous test
+        map.top_level '/user/:id', :controller =&gt; 'user', :action =&gt; 'index'
+        map.connect   ':controller/:action/:id'
+      end
+      @controller = Admin::InnerModuleController.new
+      process :redirect_to_top_level_named_route
+      # assert_redirected_to top_level_url('foo') would pass because of exact match early return
+      assert_redirected_to top_level_path('foo')
+    end
+  end
+
   # -- standard request/response object testing --------------------------------
 
   # make sure that the template objects exist
@@ -406,7 +423,7 @@ class ActionPackAssertionsControllerTest &lt; Test::Unit::TestCase
     process :redirect_to_action
     assert_redirected_to :action =&gt; &quot;flash_me&quot;
 
-    follow_redirect
+    assert_deprecated { follow_redirect }
     assert_equal 1, @request.parameters[&quot;id&quot;].to_i
 
     assert &quot;Inconceivable!&quot;, @response.body
@@ -416,7 +433,9 @@ class ActionPackAssertionsControllerTest &lt; Test::Unit::TestCase
     process :redirect_to_controller
     assert_redirected_to :controller =&gt; &quot;elsewhere&quot;, :action =&gt; &quot;flash_me&quot;
 
-    assert_raises(RuntimeError, &quot;Can't follow redirects outside of current controller (elsewhere)&quot;) { follow_redirect }
+    assert_raises(RuntimeError, &quot;Can't follow redirects outside of current controller (elsewhere)&quot;) do
+      assert_deprecated { follow_redirect }
+    end
   end
 
   def test_assert_redirection_fails_with_incorrect_controller</diff>
      <filename>vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -568,7 +568,12 @@ class AssertSelectTest &lt; Test::Unit::TestCase
       assert_select &quot;div&quot;, 4
     end
   end
-  
+
+  def test_assert_select_rjs_raise_errors
+    assert_raises(ArgumentError) { assert_select_rjs(:destroy) }
+    assert_raises(ArgumentError) { assert_select_rjs(:insert, :left) }
+  end
+
   # Simple selection from a single result.
   def test_nested_assert_select_rjs_with_single_result
     render_rjs do |page|</diff>
      <filename>vendor/rails/actionpack/test/controller/assert_select_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,7 @@ module Submodule
   end
   class ContainedNonEmptyController &lt; ActionController::Base
     def public_action
+      render :nothing =&gt; true
     end
     
     hide_action :hidden_action
@@ -105,6 +106,18 @@ end
 
 
 class PerformActionTest &lt; Test::Unit::TestCase
+  class MockLogger
+    attr_reader :logged
+
+    def initialize
+      @logged = []
+    end
+
+    def method_missing(method, *args)
+      @logged &lt;&lt; args.first
+    end
+  end
+
   def use_controller(controller_class)
     @controller = controller_class.new
 
@@ -142,6 +155,13 @@ class PerformActionTest &lt; Test::Unit::TestCase
     get :another_hidden_action
     assert_response 404
   end
+
+  def test_namespaced_action_should_log_module_name
+    use_controller Submodule::ContainedNonEmptyController
+    @controller.logger = MockLogger.new
+    get :public_action
+    assert_match /Processing\sSubmodule::ContainedNonEmptyController#public_action/, @controller.logger.logged[1]
+  end
 end
 
 class DefaultUrlOptionsTest &lt; Test::Unit::TestCase
@@ -169,6 +189,22 @@ class DefaultUrlOptionsTest &lt; Test::Unit::TestCase
   end
 end
 
+class EmptyUrlOptionsTest &lt; Test::Unit::TestCase
+  def setup
+    @controller = NonEmptyController.new
+
+    @request    = ActionController::TestRequest.new
+    @response   = ActionController::TestResponse.new
+
+    @request.host = 'www.example.com'
+  end
+
+  def test_ensure_url_for_works_as_expected_when_called_with_no_options_if_default_url_options_is_not_set
+    get :public_action
+    assert_equal &quot;http://www.example.com/non_empty/public_action&quot;, @controller.url_for
+  end
+end
+
 class EnsureNamedRoutesWorksTicket22BugTest &lt; Test::Unit::TestCase
   def test_named_routes_still_work
     ActionController::Routing::Routes.draw do |map|
@@ -180,4 +216,4 @@ class EnsureNamedRoutesWorksTicket22BugTest &lt; Test::Unit::TestCase
   ensure
     ActionController::Routing::Routes.load!
   end
-end
\ No newline at end of file
+end</diff>
      <filename>vendor/rails/actionpack/test/controller/base_test.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/actionpack/test/controller/cgi_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,14 +27,14 @@ class DispatcherTest &lt; Test::Unit::TestCase
 
   def test_clears_dependencies_after_dispatch_if_in_loading_mode
     ActionController::Routing::Routes.expects(:reload).once
-    Dependencies.expects(:clear).once
+    ActiveSupport::Dependencies.expects(:clear).once
 
     dispatch(@output, false)
   end
 
   def test_leaves_dependencies_after_dispatch_if_not_in_loading_mode
     ActionController::Routing::Routes.expects(:reload).never
-    Dependencies.expects(:clear).never
+    ActiveSupport::Dependencies.expects(:clear).never
 
     dispatch
   end</diff>
      <filename>vendor/rails/actionpack/test/controller/dispatcher_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -120,4 +120,29 @@ HTML
     assert doc.find(:tag =&gt; &quot;div&quot;, :attributes =&gt; { :id =&gt; &quot;map&quot; }, :content =&gt; &quot;&quot;)
     assert doc.find(:tag =&gt; &quot;div&quot;, :attributes =&gt; { :id =&gt; &quot;map&quot; }, :content =&gt; nil)
   end
+
+  def test_parse_invalid_document
+    assert_nothing_raised do
+      doc = HTML::Document.new(&quot;&lt;html&gt;
+        &lt;table&gt;
+          &lt;tr&gt;
+            &lt;td style=\&quot;color: #FFFFFF; height: 17px; onclick=\&quot;window.location.href='http://www.rmeinc.com/about_rme.aspx'\&quot; style=\&quot;cursor:pointer; height: 17px;\&quot;; nowrap onclick=\&quot;window.location.href='http://www.rmeinc.com/about_rme.aspx'\&quot; onmouseout=\&quot;this.bgColor='#0066cc'; this.style.color='#FFFFFF'\&quot; onmouseover=\&quot;this.bgColor='#ffffff'; this.style.color='#0033cc'\&quot;&gt;About Us&lt;/td&gt;
+          &lt;/tr&gt;
+        &lt;/table&gt;
+      &lt;/html&gt;&quot;)
+    end
+  end
+
+  def test_invalid_document_raises_exception_when_strict
+    assert_raises RuntimeError do
+      doc = HTML::Document.new(&quot;&lt;html&gt;
+        &lt;table&gt;
+          &lt;tr&gt;
+            &lt;td style=\&quot;color: #FFFFFF; height: 17px; onclick=\&quot;window.location.href='http://www.rmeinc.com/about_rme.aspx'\&quot; style=\&quot;cursor:pointer; height: 17px;\&quot;; nowrap onclick=\&quot;window.location.href='http://www.rmeinc.com/about_rme.aspx'\&quot; onmouseout=\&quot;this.bgColor='#0066cc'; this.style.color='#FFFFFF'\&quot; onmouseover=\&quot;this.bgColor='#ffffff'; this.style.color='#0033cc'\&quot;&gt;About Us&lt;/td&gt;
+          &lt;/tr&gt;
+        &lt;/table&gt;
+      &lt;/html&gt;&quot;, true)
+    end
+  end
+
 end</diff>
      <filename>vendor/rails/actionpack/test/controller/html-scanner/document_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -28,7 +28,7 @@ class SessionUploadTest &lt; ActionController::IntegrationTest
   # end
   def test_post_with_upload
     uses_mocha &quot;test_post_with_upload&quot; do
-      Dependencies.stubs(:load?).returns(false)
+      ActiveSupport::Dependencies.stubs(:load?).returns(false)
       with_routing do |set|
         set.draw do |map|
           map.update 'update', :controller =&gt; &quot;upload_test&quot;, :action =&gt; &quot;update&quot;, :method =&gt; :post</diff>
      <filename>vendor/rails/actionpack/test/controller/integration_upload_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -68,6 +68,11 @@ class NewRenderTestController &lt; ActionController::Base
     path = File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_ivar.erb')
     render :file =&gt; path
   end
+  
+  def render_file_from_template
+    @secret = 'in the sauce'
+    @path = File.expand_path(File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_ivar.erb'))
+  end
 
   def render_file_with_locals
     path = File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_locals.erb')
@@ -259,6 +264,10 @@ class NewRenderTestController &lt; ActionController::Base
     render :template =&gt; &quot;test/hello_world&quot;
   end
 
+  def render_with_explicit_template_with_locals
+    render :template =&gt; &quot;test/render_file_with_locals&quot;, :locals =&gt; { :secret =&gt; 'area51' }
+  end
+
   def double_render
     render :text =&gt; &quot;hello&quot;
     render :text =&gt; &quot;world&quot;
@@ -531,6 +540,11 @@ class NewRenderTest &lt; Test::Unit::TestCase
     get :render_file_with_locals
     assert_equal &quot;The secret is in the sauce\n&quot;, @response.body
   end
+  
+  def test_render_file_from_template
+    get :render_file_from_template
+    assert_equal &quot;The secret is in the sauce\n&quot;, @response.body
+  end
 
   def test_attempt_to_access_object_method
     assert_raises(ActionController::UnknownAction, &quot;No action responded to [clone]&quot;) { get :clone }
@@ -742,7 +756,7 @@ EOS
   
   def test_partial_collection_with_counter
     get :partial_collection_with_counter
-    assert_equal &quot;david1mary2&quot;, @response.body
+    assert_equal &quot;david0mary1&quot;, @response.body
   end
   
   def test_partial_collection_with_locals
@@ -762,7 +776,7 @@ EOS
 
   def test_partial_collection_shorthand_with_different_types_of_records
     get :partial_collection_shorthand_with_different_types_of_records
-    assert_equal &quot;Bonjour bad customer: mark1Bonjour good customer: craig2Bonjour bad customer: john3Bonjour good customer: zach4Bonjour good customer: brandon5Bonjour bad customer: dan6&quot;, @response.body
+    assert_equal &quot;Bonjour bad customer: mark0Bonjour good customer: craig1Bonjour bad customer: john2Bonjour good customer: zach3Bonjour good customer: brandon4Bonjour bad customer: dan5&quot;, @response.body
   end
 
   def test_empty_partial_collection
@@ -800,7 +814,12 @@ EOS
     get :render_text_with_assigns
     assert_equal &quot;world&quot;, assigns[&quot;hello&quot;]
   end
-  
+
+  def test_template_with_locals
+    get :render_with_explicit_template_with_locals
+    assert_equal &quot;The secret is area51\n&quot;, @response.body
+  end
+
   def test_update_page
     get :update_page
     assert_template nil</diff>
      <filename>vendor/rails/actionpack/test/controller/new_render_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -118,6 +118,39 @@ uses_mocha 'polymorphic URL helpers' do
       polymorphic_url([:site, :admin, @article, @response, @tag])
     end
 
+    def test_nesting_with_array_ending_in_singleton_resource
+      expects(:article_response_url).with(@article)
+      polymorphic_url([@article, :response])
+    end
+
+    def test_nesting_with_array_containing_singleton_resource
+      @tag = Tag.new
+      @tag.save
+      expects(:article_response_tag_url).with(@article, @tag)
+      polymorphic_url([@article, :response, @tag])
+    end
+
+    def test_nesting_with_array_containing_namespace_and_singleton_resource
+      @tag = Tag.new
+      @tag.save
+      expects(:admin_article_response_tag_url).with(@article, @tag)
+      polymorphic_url([:admin, @article, :response, @tag])
+    end
+
+    def test_nesting_with_array_containing_singleton_resource_and_format
+      @tag = Tag.new
+      @tag.save
+      expects(:formatted_article_response_tag_url).with(@article, @tag, :pdf)
+      formatted_polymorphic_url([@article, :response, @tag, :pdf])
+    end
+
+    def test_nesting_with_array_containing_singleton_resource_and_format_option
+      @tag = Tag.new
+      @tag.save
+      expects(:article_response_tag_url).with(@article, @tag, :pdf)
+      polymorphic_url([@article, :response, @tag], :format =&gt; :pdf)
+    end
+
     # TODO: Needs to be updated to correctly know about whether the object is in a hash or not
     def xtest_with_hash
       expects(:article_url).with(@article)</diff>
      <filename>vendor/rails/actionpack/test/controller/polymorphic_routes_test.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/actionpack/test/controller/redirect_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -103,7 +103,7 @@ class TestController &lt; ActionController::Base
   def render_line_offset
     begin
       render :inline =&gt; '&lt;% raise %&gt;', :locals =&gt; {:foo =&gt; 'bar'}
-    rescue =&gt; exc
+    rescue RuntimeError =&gt; exc
     end
     line = exc.backtrace.first
     render :text =&gt; line</diff>
      <filename>vendor/rails/actionpack/test/controller/render_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,6 +12,9 @@ class RequestTest &lt; Test::Unit::TestCase
     @request.remote_addr = '1.2.3.4'
     assert_equal '1.2.3.4', @request.remote_ip
 
+    @request.remote_addr = '1.2.3.4,3.4.5.6'
+    assert_equal '1.2.3.4', @request.remote_ip
+
     @request.env['HTTP_CLIENT_IP'] = '2.3.4.5'
     assert_equal '1.2.3.4', @request.remote_ip
 
@@ -59,6 +62,9 @@ class RequestTest &lt; Test::Unit::TestCase
     assert_match /HTTP_X_FORWARDED_FOR=&quot;9.9.9.9, 3.4.5.6, 10.0.0.1, 172.31.4.4&quot;/, e.message
     assert_match /HTTP_CLIENT_IP=&quot;8.8.8.8&quot;/, e.message
 
+    @request.env['HTTP_X_FORWARDED_FOR'] = '8.8.8.8, 9.9.9.9'
+    assert_equal '8.8.8.8', @request.remote_ip
+
     @request.env.delete 'HTTP_CLIENT_IP'
     @request.env.delete 'HTTP_X_FORWARDED_FOR'
   end</diff>
      <filename>vendor/rails/actionpack/test/controller/request_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -28,18 +28,16 @@ module Backoffice
 end
 
 class ResourcesTest &lt; Test::Unit::TestCase
-  
-  
   # The assertions in these tests are incompatible with the hash method
   # optimisation.  This could indicate user level problems
   def setup
     ActionController::Base.optimise_named_routes = false
   end
-  
-  def tear_down
+
+  def teardown
     ActionController::Base.optimise_named_routes = true
   end
-  
+
   def test_should_arrange_actions
     resource = ActionController::Resources::Resource.new(:messages,
       :collection =&gt; { :rss =&gt; :get, :reorder =&gt; :post, :csv =&gt; :post },
@@ -159,14 +157,14 @@ class ResourcesTest &lt; Test::Unit::TestCase
 
   def test_with_collection_actions_and_name_prefix
     actions = { 'a' =&gt; :get, 'b' =&gt; :put, 'c' =&gt; :post, 'd' =&gt; :delete }
-  
+
     with_restful_routing :messages, :path_prefix =&gt; '/threads/:thread_id', :name_prefix =&gt; &quot;thread_&quot;, :collection =&gt; actions do
       assert_restful_routes_for :messages, :path_prefix =&gt; 'threads/1/', :name_prefix =&gt; 'thread_', :options =&gt; { :thread_id =&gt; '1' } do |options|
         actions.each do |action, method|
           assert_recognizes(options.merge(:action =&gt; action), :path =&gt; &quot;/threads/1/messages/#{action}&quot;, :method =&gt; method)
         end
       end
-  
+
       assert_restful_named_routes_for :messages, :path_prefix =&gt; 'threads/1/', :name_prefix =&gt; 'thread_', :options =&gt; { :thread_id =&gt; '1' } do |options|
         actions.keys.each do |action|
           assert_named_route &quot;/threads/1/messages/#{action}&quot;, &quot;#{action}_thread_messages_path&quot;, :action =&gt; action
@@ -177,14 +175,14 @@ class ResourcesTest &lt; Test::Unit::TestCase
 
   def test_with_collection_action_and_name_prefix_and_formatted
     actions = { 'a' =&gt; :get, 'b' =&gt; :put, 'c' =&gt; :post, 'd' =&gt; :delete }
-  
+
     with_restful_routing :messages, :path_prefix =&gt; '/threads/:thread_id', :name_prefix =&gt; &quot;thread_&quot;, :collection =&gt; actions do
       assert_restful_routes_for :messages, :path_prefix =&gt; 'threads/1/', :name_prefix =&gt; 'thread_', :options =&gt; { :thread_id =&gt; '1' } do |options|
         actions.each do |action, method|
           assert_recognizes(options.merge(:action =&gt; action, :format =&gt; 'xml'), :path =&gt; &quot;/threads/1/messages/#{action}.xml&quot;, :method =&gt; method)
         end
       end
-  
+
       assert_restful_named_routes_for :messages, :path_prefix =&gt; 'threads/1/', :name_prefix =&gt; 'thread_', :options =&gt; { :thread_id =&gt; '1' } do |options|
         actions.keys.each do |action|
           assert_named_route &quot;/threads/1/messages/#{action}.xml&quot;, &quot;formatted_#{action}_thread_messages_path&quot;, :action =&gt; action, :format =&gt; 'xml'
@@ -279,7 +277,7 @@ class ResourcesTest &lt; Test::Unit::TestCase
       end
     end
   end
-  
+
   def test_with_new_action_with_name_prefix
     with_restful_routing :messages, :new =&gt; { :preview =&gt; :post }, :path_prefix =&gt; '/threads/:thread_id', :name_prefix =&gt; 'thread_' do
       preview_options = {:action =&gt; 'preview', :thread_id =&gt; '1'}
@@ -293,7 +291,7 @@ class ResourcesTest &lt; Test::Unit::TestCase
       end
     end
   end
-  
+
   def test_with_formatted_new_action_with_name_prefix
     with_restful_routing :messages, :new =&gt; { :preview =&gt; :post }, :path_prefix =&gt; '/threads/:thread_id', :name_prefix =&gt; 'thread_' do
       preview_options = {:action =&gt; 'preview', :thread_id =&gt; '1', :format =&gt; 'xml'}
@@ -307,7 +305,7 @@ class ResourcesTest &lt; Test::Unit::TestCase
       end
     end
   end
-  
+
   def test_override_new_method
     with_restful_routing :messages do
       assert_restful_routes_for :messages do |options|
@@ -524,9 +522,9 @@ class ResourcesTest &lt; Test::Unit::TestCase
         map.resources :messages, :collection =&gt; {:search =&gt; :get}, :new =&gt; {:preview =&gt; :any}, :name_prefix =&gt; 'thread_', :path_prefix =&gt; '/threads/:thread_id'
         map.resource :account, :member =&gt; {:login =&gt; :get}, :new =&gt; {:preview =&gt; :any}, :name_prefix =&gt; 'admin_', :path_prefix =&gt; '/admin'
       end
-      
+
       action_separator = ActionController::Base.resource_action_separator
-      
+
       assert_simply_restful_for :messages, :name_prefix =&gt; 'thread_', :path_prefix =&gt; 'threads/1/', :options =&gt; { :thread_id =&gt; '1' }
       assert_named_route &quot;/threads/1/messages#{action_separator}search&quot;, &quot;search_thread_messages_path&quot;, {}
       assert_named_route &quot;/threads/1/messages/new&quot;, &quot;new_thread_message_path&quot;, {}
@@ -623,7 +621,7 @@ class ResourcesTest &lt; Test::Unit::TestCase
       assert_simply_restful_for :products, :controller =&gt; &quot;backoffice/products&quot;
     end
   end
-  
+
   def test_nested_resources_using_namespace
     with_routing do |set|
       set.draw do |map|
@@ -795,7 +793,7 @@ class ResourcesTest &lt; Test::Unit::TestCase
 
       yield options[:options] if block_given?
     end
-    
+
     def assert_singleton_routes_for(singleton_name, options = {})
       options[:options] ||= {}
       options[:options][:controller] = options[:controller] || singleton_name.to_s.pluralize
@@ -855,7 +853,7 @@ class ResourcesTest &lt; Test::Unit::TestCase
       actual =  @controller.send(route, options) rescue $!.class.name
       assert_equal expected, actual, &quot;Error on route: #{route}(#{options.inspect})&quot;
     end
-    
+
     def assert_resource_methods(expected, resource, action_method, method)
       assert_equal expected.length, resource.send(&quot;#{action_method}_methods&quot;)[method].size, &quot;#{resource.send(&quot;#{action_method}_methods&quot;)[method].inspect}&quot;
       expected.each do |action|</diff>
      <filename>vendor/rails/actionpack/test/controller/resources_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1983,6 +1983,26 @@ class RouteSetTest &lt; Test::Unit::TestCase
     Object.send(:remove_const, :Api)
   end
 
+  def test_namespace_with_path_prefix
+    Object.const_set(:Api, Module.new { |m| m.const_set(:ProductsController, Class.new) })
+
+    set.draw do |map|
+
+      map.namespace 'api', :path_prefix =&gt; 'prefix' do |api|
+        api.route 'inventory', :controller =&gt; &quot;products&quot;, :action =&gt; 'inventory'
+      end
+
+    end
+
+    request.path = &quot;/prefix/inventory&quot;
+    request.method = :get
+    assert_nothing_raised { set.recognize(request) }
+    assert_equal(&quot;api/products&quot;, request.path_parameters[:controller])
+    assert_equal(&quot;inventory&quot;, request.path_parameters[:action])
+  ensure
+    Object.send(:remove_const, :Api)
+  end
+
   def test_generate_finds_best_fit
     set.draw do |map|
       map.connect &quot;/people&quot;, :controller =&gt; &quot;people&quot;, :action =&gt; &quot;index&quot;
@@ -2392,10 +2412,10 @@ uses_mocha 'route loading' do
     end
 
     def test_adding_inflections_forces_reload
-      Inflector::Inflections.instance.expects(:uncountable).with('equipment')
+      ActiveSupport::Inflector::Inflections.instance.expects(:uncountable).with('equipment')
       routes.expects(:reload!)
 
-      Inflector.inflections { |inflect| inflect.uncountable('equipment') }
+      ActiveSupport::Inflector.inflections { |inflect| inflect.uncountable('equipment') }
     end
     
     def test_load_with_configuration</diff>
      <filename>vendor/rails/actionpack/test/controller/routing_test.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/actionpack/test/controller/session/cookie_store_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -531,6 +531,11 @@ XML
     assert_equal content_type, file.content_type
     assert_equal file.path, file.local_path
     assert_equal expected, file.read
+
+    new_content_type = &quot;new content_type&quot;
+    file.content_type = new_content_type
+    assert_equal new_content_type, file.content_type
+
   end
   
   def test_test_uploaded_file_with_binary
@@ -571,7 +576,9 @@ XML
       get :redirect_to_same_controller
       assert_response :redirect
       assert_redirected_to :controller =&gt; 'test_test/test', :action =&gt; 'test_uri', :id =&gt; 5
-      assert_nothing_raised { follow_redirect }
+      assert_deprecated 'follow_redirect' do
+        assert_nothing_raised { follow_redirect }
+      end
     end
   end
 
@@ -580,7 +587,9 @@ XML
       get :redirect_to_different_controller
       assert_response :redirect
       assert_redirected_to :controller =&gt; 'fail', :id =&gt; 5
-      assert_raise(RuntimeError) { follow_redirect }
+      assert_raise(RuntimeError) do
+        assert_deprecated { follow_redirect }
+      end
     end
   end
 </diff>
      <filename>vendor/rails/actionpack/test/controller/test_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,10 +21,10 @@ class VerificationTest &lt; Test::Unit::TestCase
 
     verify :only =&gt; :guarded_by_method, :method =&gt; :post,
            :redirect_to =&gt; { :action =&gt; &quot;unguarded&quot; }
-           
+
     verify :only =&gt; :guarded_by_xhr, :xhr =&gt; true,
            :redirect_to =&gt; { :action =&gt; &quot;unguarded&quot; }
-           
+
     verify :only =&gt; :guarded_by_not_xhr, :xhr =&gt; false,
            :redirect_to =&gt; { :action =&gt; &quot;unguarded&quot; }
 
@@ -39,10 +39,13 @@ class VerificationTest &lt; Test::Unit::TestCase
 
     verify :only =&gt; :no_default_action, :params =&gt; &quot;santa&quot;
 
+    verify :only =&gt; :guarded_with_back, :method =&gt; :post,
+           :redirect_to =&gt; :back
+
     def guarded_one
       render :text =&gt; &quot;#{params[:one]}&quot;
     end
-    
+
     def guarded_one_for_named_route_test
       render :text =&gt; &quot;#{params[:one]}&quot;
     end
@@ -70,11 +73,11 @@ class VerificationTest &lt; Test::Unit::TestCase
     def guarded_by_method
       render :text =&gt; &quot;#{request.method}&quot;
     end
-    
+
     def guarded_by_xhr
       render :text =&gt; &quot;#{request.xhr?}&quot;
     end
-    
+
     def guarded_by_not_xhr
       render :text =&gt; &quot;#{request.xhr?}&quot;
     end
@@ -86,15 +89,19 @@ class VerificationTest &lt; Test::Unit::TestCase
     def two_redirects
       render :nothing =&gt; true
     end
-    
+
     def must_be_post
       render :text =&gt; &quot;Was a post!&quot;
     end
-    
+
+    def guarded_with_back
+      render :text =&gt; &quot;#{params[:one]}&quot;
+    end
+
     def no_default_action
       # Will never run
     end
-    
+
     protected
       def rescue_action(e) raise end
 
@@ -109,7 +116,17 @@ class VerificationTest &lt; Test::Unit::TestCase
     @response   = ActionController::TestResponse.new
     ActionController::Routing::Routes.add_named_route :foo, '/foo', :controller =&gt; 'test', :action =&gt; 'foo'
   end
-  
+
+  def test_using_symbol_back_with_no_referrer
+    assert_raise(ActionController::RedirectBackError) { get :guarded_with_back }
+  end
+
+  def test_using_symbol_back_redirects_to_referrer
+    @request.env[&quot;HTTP_REFERER&quot;] = &quot;/foo&quot;
+    get :guarded_with_back
+    assert_redirected_to '/foo'
+  end
+
   def test_no_deprecation_warning_for_named_route
     assert_not_deprecated do
       get :guarded_one_for_named_route_test, :two =&gt; &quot;not one&quot;
@@ -209,44 +226,44 @@ class VerificationTest &lt; Test::Unit::TestCase
     get :guarded_by_method
     assert_redirected_to :action =&gt; &quot;unguarded&quot;
   end
-  
+
   def test_guarded_by_xhr_with_prereqs
     xhr :post, :guarded_by_xhr
     assert_equal &quot;true&quot;, @response.body
   end
-    
+
   def test_guarded_by_xhr_without_prereqs
     get :guarded_by_xhr
     assert_redirected_to :action =&gt; &quot;unguarded&quot;
   end
-  
+
   def test_guarded_by_not_xhr_with_prereqs
     get :guarded_by_not_xhr
     assert_equal &quot;false&quot;, @response.body
   end
-    
+
   def test_guarded_by_not_xhr_without_prereqs
     xhr :post, :guarded_by_not_xhr
     assert_redirected_to :action =&gt; &quot;unguarded&quot;
   end
-  
+
   def test_guarded_post_and_calls_render_succeeds
     post :must_be_post
     assert_equal &quot;Was a post!&quot;, @response.body
   end
-    
+
   def test_default_failure_should_be_a_bad_request
     post :no_default_action
     assert_response :bad_request
   end
-    
+
   def test_guarded_post_and_calls_render_fails_and_sets_allow_header
     get :must_be_post
     assert_response 405
     assert_equal &quot;Must be post&quot;, @response.body
     assert_equal &quot;POST&quot;, @response.headers[&quot;Allow&quot;]
   end
-  
+
   def test_second_redirect
     assert_nothing_raised { get :two_redirects }
   end</diff>
      <filename>vendor/rails/actionpack/test/controller/verification_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1157,6 +1157,32 @@ class DateHelperTest &lt; ActionView::TestCase
     assert_dom_equal expected, date_select(&quot;post&quot;, &quot;written_on&quot;, {}, :class =&gt; 'selector')
   end
 
+  def test_date_select_with_html_options_within_fields_for
+    @post = Post.new
+    @post.written_on = Date.new(2004, 6, 15)
+
+    _erbout = ''
+
+    fields_for :post, @post do |f|
+      _erbout.concat f.date_select(:written_on, {}, :class =&gt; 'selector')
+    end
+
+    expected = %{&lt;select id=&quot;post_written_on_1i&quot; name=&quot;post[written_on(1i)]&quot; class=&quot;selector&quot;&gt;\n}
+    expected &lt;&lt; %{&lt;option value=&quot;1999&quot;&gt;1999&lt;/option&gt;\n&lt;option value=&quot;2000&quot;&gt;2000&lt;/option&gt;\n&lt;option value=&quot;2001&quot;&gt;2001&lt;/option&gt;\n&lt;option value=&quot;2002&quot;&gt;2002&lt;/option&gt;\n&lt;option value=&quot;2003&quot;&gt;2003&lt;/option&gt;\n&lt;option value=&quot;2004&quot; selected=&quot;selected&quot;&gt;2004&lt;/option&gt;\n&lt;option value=&quot;2005&quot;&gt;2005&lt;/option&gt;\n&lt;option value=&quot;2006&quot;&gt;2006&lt;/option&gt;\n&lt;option value=&quot;2007&quot;&gt;2007&lt;/option&gt;\n&lt;option value=&quot;2008&quot;&gt;2008&lt;/option&gt;\n&lt;option value=&quot;2009&quot;&gt;2009&lt;/option&gt;\n}
+    expected &lt;&lt; &quot;&lt;/select&gt;\n&quot;
+
+    expected &lt;&lt; %{&lt;select id=&quot;post_written_on_2i&quot; name=&quot;post[written_on(2i)]&quot; class=&quot;selector&quot;&gt;\n}
+    expected &lt;&lt; %{&lt;option value=&quot;1&quot;&gt;January&lt;/option&gt;\n&lt;option value=&quot;2&quot;&gt;February&lt;/option&gt;\n&lt;option value=&quot;3&quot;&gt;March&lt;/option&gt;\n&lt;option value=&quot;4&quot;&gt;April&lt;/option&gt;\n&lt;option value=&quot;5&quot;&gt;May&lt;/option&gt;\n&lt;option value=&quot;6&quot; selected=&quot;selected&quot;&gt;June&lt;/option&gt;\n&lt;option value=&quot;7&quot;&gt;July&lt;/option&gt;\n&lt;option value=&quot;8&quot;&gt;August&lt;/option&gt;\n&lt;option value=&quot;9&quot;&gt;September&lt;/option&gt;\n&lt;option value=&quot;10&quot;&gt;October&lt;/option&gt;\n&lt;option value=&quot;11&quot;&gt;November&lt;/option&gt;\n&lt;option value=&quot;12&quot;&gt;December&lt;/option&gt;\n}
+    expected &lt;&lt; &quot;&lt;/select&gt;\n&quot;
+
+    expected &lt;&lt; %{&lt;select id=&quot;post_written_on_3i&quot; name=&quot;post[written_on(3i)]&quot; class=&quot;selector&quot;&gt;\n}
+    expected &lt;&lt; %{&lt;option value=&quot;1&quot;&gt;1&lt;/option&gt;\n&lt;option value=&quot;2&quot;&gt;2&lt;/option&gt;\n&lt;option value=&quot;3&quot;&gt;3&lt;/option&gt;\n&lt;option value=&quot;4&quot;&gt;4&lt;/option&gt;\n&lt;option value=&quot;5&quot;&gt;5&lt;/option&gt;\n&lt;option value=&quot;6&quot;&gt;6&lt;/option&gt;\n&lt;option value=&quot;7&quot;&gt;7&lt;/option&gt;\n&lt;option value=&quot;8&quot;&gt;8&lt;/option&gt;\n&lt;option value=&quot;9&quot;&gt;9&lt;/option&gt;\n&lt;option value=&quot;10&quot;&gt;10&lt;/option&gt;\n&lt;option value=&quot;11&quot;&gt;11&lt;/option&gt;\n&lt;option value=&quot;12&quot;&gt;12&lt;/option&gt;\n&lt;option value=&quot;13&quot;&gt;13&lt;/option&gt;\n&lt;option value=&quot;14&quot;&gt;14&lt;/option&gt;\n&lt;option value=&quot;15&quot; selected=&quot;selected&quot;&gt;15&lt;/option&gt;\n&lt;option value=&quot;16&quot;&gt;16&lt;/option&gt;\n&lt;option value=&quot;17&quot;&gt;17&lt;/option&gt;\n&lt;option value=&quot;18&quot;&gt;18&lt;/option&gt;\n&lt;option value=&quot;19&quot;&gt;19&lt;/option&gt;\n&lt;option value=&quot;20&quot;&gt;20&lt;/option&gt;\n&lt;option value=&quot;21&quot;&gt;21&lt;/option&gt;\n&lt;option value=&quot;22&quot;&gt;22&lt;/option&gt;\n&lt;option value=&quot;23&quot;&gt;23&lt;/option&gt;\n&lt;option value=&quot;24&quot;&gt;24&lt;/option&gt;\n&lt;option value=&quot;25&quot;&gt;25&lt;/option&gt;\n&lt;option value=&quot;26&quot;&gt;26&lt;/option&gt;\n&lt;option value=&quot;27&quot;&gt;27&lt;/option&gt;\n&lt;option value=&quot;28&quot;&gt;28&lt;/option&gt;\n&lt;option value=&quot;29&quot;&gt;29&lt;/option&gt;\n&lt;option value=&quot;30&quot;&gt;30&lt;/option&gt;\n&lt;option value=&quot;31&quot;&gt;31&lt;/option&gt;\n}
+
+    expected &lt;&lt; &quot;&lt;/select&gt;\n&quot;
+
+    assert_dom_equal expected, _erbout
+  end
+
   def test_time_select
     @post = Post.new
     @post.written_on = Time.local(2004, 6, 15, 15, 16, 35)
@@ -1218,6 +1244,31 @@ class DateHelperTest &lt; ActionView::TestCase
     assert_dom_equal expected, time_select(&quot;post&quot;, &quot;written_on&quot;, {}, :class =&gt; 'selector')
   end
 
+  def test_time_select_with_html_options_within_fields_for
+    @post = Post.new
+    @post.written_on = Time.local(2004, 6, 15, 15, 16, 35)
+
+    _erbout = ''
+
+    fields_for :post, @post do |f|
+      _erbout.concat f.time_select(:written_on, {}, :class =&gt; 'selector')
+    end
+
+    expected = %{&lt;input type=&quot;hidden&quot; id=&quot;post_written_on_1i&quot; name=&quot;post[written_on(1i)]&quot; value=&quot;2004&quot; /&gt;\n}
+    expected &lt;&lt; %{&lt;input type=&quot;hidden&quot; id=&quot;post_written_on_2i&quot; name=&quot;post[written_on(2i)]&quot; value=&quot;6&quot; /&gt;\n}
+    expected &lt;&lt; %{&lt;input type=&quot;hidden&quot; id=&quot;post_written_on_3i&quot; name=&quot;post[written_on(3i)]&quot; value=&quot;15&quot; /&gt;\n}
+
+    expected &lt;&lt; %(&lt;select id=&quot;post_written_on_4i&quot; name=&quot;post[written_on(4i)]&quot; class=&quot;selector&quot;&gt;\n)
+    0.upto(23) { |i| expected &lt;&lt; %(&lt;option value=&quot;#{leading_zero_on_single_digits(i)}&quot;#{' selected=&quot;selected&quot;' if i == 15}&gt;#{leading_zero_on_single_digits(i)}&lt;/option&gt;\n) }
+    expected &lt;&lt; &quot;&lt;/select&gt;\n&quot;
+    expected &lt;&lt; &quot; : &quot;
+    expected &lt;&lt; %(&lt;select id=&quot;post_written_on_5i&quot; name=&quot;post[written_on(5i)]&quot; class=&quot;selector&quot;&gt;\n)
+    0.upto(59) { |i| expected &lt;&lt; %(&lt;option value=&quot;#{leading_zero_on_single_digits(i)}&quot;#{' selected=&quot;selected&quot;' if i == 16}&gt;#{leading_zero_on_single_digits(i)}&lt;/option&gt;\n) }
+    expected &lt;&lt; &quot;&lt;/select&gt;\n&quot;
+
+    assert_dom_equal expected, _erbout
+  end
+
   def test_datetime_select
     @post = Post.new
     @post.updated_at = Time.local(2004, 6, 15, 16, 35)
@@ -1283,23 +1334,23 @@ class DateHelperTest &lt; ActionView::TestCase
     end
   end
 
-  def test_datetime_select_within_fields_for
+  def test_datetime_select_with_html_options_within_fields_for
     @post = Post.new
     @post.updated_at = Time.local(2004, 6, 15, 16, 35)
 
     _erbout = ''
 
     fields_for :post, @post do |f|
-      _erbout.concat f.datetime_select(:updated_at)
+      _erbout.concat f.datetime_select(:updated_at, {}, :class =&gt; 'selector')
     end
 
-    expected = &quot;&lt;select id='post_updated_at_1i' name='post[updated_at(1i)]'&gt;\n&lt;option value='1999'&gt;1999&lt;/option&gt;\n&lt;option value='2000'&gt;2000&lt;/option&gt;\n&lt;option value='2001'&gt;2001&lt;/option&gt;\n&lt;option value='2002'&gt;2002&lt;/option&gt;\n&lt;option value='2003'&gt;2003&lt;/option&gt;\n&lt;option selected='selected' value='2004'&gt;2004&lt;/option&gt;\n&lt;option value='2005'&gt;2005&lt;/option&gt;\n&lt;option value='2006'&gt;2006&lt;/option&gt;\n&lt;option value='2007'&gt;2007&lt;/option&gt;\n&lt;option value='2008'&gt;2008&lt;/option&gt;\n&lt;option value='2009'&gt;2009&lt;/option&gt;\n&lt;/select&gt;\n&quot;
-    expected &lt;&lt; &quot;&lt;select id='post_updated_at_2i' name='post[updated_at(2i)]'&gt;\n&lt;option value='1'&gt;January&lt;/option&gt;\n&lt;option value='2'&gt;February&lt;/option&gt;\n&lt;option value='3'&gt;March&lt;/option&gt;\n&lt;option value='4'&gt;April&lt;/option&gt;\n&lt;option value='5'&gt;May&lt;/option&gt;\n&lt;option selected='selected' value='6'&gt;June&lt;/option&gt;\n&lt;option value='7'&gt;July&lt;/option&gt;\n&lt;option value='8'&gt;August&lt;/option&gt;\n&lt;option value='9'&gt;September&lt;/option&gt;\n&lt;option value='10'&gt;October&lt;/option&gt;\n&lt;option value='11'&gt;November&lt;/option&gt;\n&lt;option value='12'&gt;December&lt;/option&gt;\n&lt;/select&gt;\n&quot;
-    expected &lt;&lt; &quot;&lt;select id='post_updated_at_3i' name='post[updated_at(3i)]'&gt;\n&lt;option value='1'&gt;1&lt;/option&gt;\n&lt;option value='2'&gt;2&lt;/option&gt;\n&lt;option value='3'&gt;3&lt;/option&gt;\n&lt;option value='4'&gt;4&lt;/option&gt;\n&lt;option value='5'&gt;5&lt;/option&gt;\n&lt;option value='6'&gt;6&lt;/option&gt;\n&lt;option value='7'&gt;7&lt;/option&gt;\n&lt;option value='8'&gt;8&lt;/option&gt;\n&lt;option value='9'&gt;9&lt;/option&gt;\n&lt;option value='10'&gt;10&lt;/option&gt;\n&lt;option value='11'&gt;11&lt;/option&gt;\n&lt;option value='12'&gt;12&lt;/option&gt;\n&lt;option value='13'&gt;13&lt;/option&gt;\n&lt;option value='14'&gt;14&lt;/option&gt;\n&lt;option selected='selected' value='15'&gt;15&lt;/option&gt;\n&lt;option value='16'&gt;16&lt;/option&gt;\n&lt;option value='17'&gt;17&lt;/option&gt;\n&lt;option value='18'&gt;18&lt;/option&gt;\n&lt;option value='19'&gt;19&lt;/option&gt;\n&lt;option value='20'&gt;20&lt;/option&gt;\n&lt;option value='21'&gt;21&lt;/option&gt;\n&lt;option value='22'&gt;22&lt;/option&gt;\n&lt;option value='23'&gt;23&lt;/option&gt;\n&lt;option value='24'&gt;24&lt;/option&gt;\n&lt;option value='25'&gt;25&lt;/option&gt;\n&lt;option value='26'&gt;26&lt;/option&gt;\n&lt;option value='27'&gt;27&lt;/option&gt;\n&lt;option value='28'&gt;28&lt;/option&gt;\n&lt;option value='29'&gt;29&lt;/option&gt;\n&lt;option value='30'&gt;30&lt;/option&gt;\n&lt;option value='31'&gt;31&lt;/option&gt;\n&lt;/select&gt;\n&quot;
-   expected &lt;&lt; &quot; &amp;mdash; &lt;select id='post_updated_at_4i' name='post[updated_at(4i)]'&gt;\n&lt;option value='00'&gt;00&lt;/option&gt;\n&lt;option value='01'&gt;01&lt;/option&gt;\n&lt;option value='02'&gt;02&lt;/option&gt;\n&lt;option value='03'&gt;03&lt;/option&gt;\n&lt;option value='04'&gt;04&lt;/option&gt;\n&lt;option value='05'&gt;05&lt;/option&gt;\n&lt;option value='06'&gt;06&lt;/option&gt;\n&lt;option value='07'&gt;07&lt;/option&gt;\n&lt;option value='08'&gt;08&lt;/option&gt;\n&lt;option value='09'&gt;09&lt;/option&gt;\n&lt;option value='10'&gt;10&lt;/option&gt;\n&lt;option value='11'&gt;11&lt;/option&gt;\n&lt;option value='12'&gt;12&lt;/option&gt;\n&lt;option value='13'&gt;13&lt;/option&gt;\n&lt;option value='14'&gt;14&lt;/option&gt;\n&lt;option value='15'&gt;15&lt;/option&gt;\n&lt;option selected='selected' value='16'&gt;16&lt;/option&gt;\n&lt;option value='17'&gt;17&lt;/option&gt;\n&lt;option value='18'&gt;18&lt;/option&gt;\n&lt;option value='19'&gt;19&lt;/option&gt;\n&lt;option value='20'&gt;20&lt;/option&gt;\n&lt;option value='21'&gt;21&lt;/option&gt;\n&lt;option value='22'&gt;22&lt;/option&gt;\n&lt;option value='23'&gt;23&lt;/option&gt;\n&lt;/select&gt;\n&quot;
-  expected &lt;&lt; &quot; : &lt;select id='post_updated_at_5i' name='post[updated_at(5i)]'&gt;\n&lt;option value='00'&gt;00&lt;/option&gt;\n&lt;option value='01'&gt;01&lt;/option&gt;\n&lt;option value='02'&gt;02&lt;/option&gt;\n&lt;option value='03'&gt;03&lt;/option&gt;\n&lt;option value='04'&gt;04&lt;/option&gt;\n&lt;option value='05'&gt;05&lt;/option&gt;\n&lt;option value='06'&gt;06&lt;/option&gt;\n&lt;option value='07'&gt;07&lt;/option&gt;\n&lt;option value='08'&gt;08&lt;/option&gt;\n&lt;option value='09'&gt;09&lt;/option&gt;\n&lt;option value='10'&gt;10&lt;/option&gt;\n&lt;option value='11'&gt;11&lt;/option&gt;\n&lt;option value='12'&gt;12&lt;/option&gt;\n&lt;option value='13'&gt;13&lt;/option&gt;\n&lt;option value='14'&gt;14&lt;/option&gt;\n&lt;option value='15'&gt;15&lt;/option&gt;\n&lt;option value='16'&gt;16&lt;/option&gt;\n&lt;option value='17'&gt;17&lt;/option&gt;\n&lt;option value='18'&gt;18&lt;/option&gt;\n&lt;option value='19'&gt;19&lt;/option&gt;\n&lt;option value='20'&gt;20&lt;/option&gt;\n&lt;option value='21'&gt;21&lt;/option&gt;\n&lt;option value='22'&gt;22&lt;/option&gt;\n&lt;option value='23'&gt;23&lt;/option&gt;\n&lt;option value='24'&gt;24&lt;/option&gt;\n&lt;option value='25'&gt;25&lt;/option&gt;\n&lt;option value='26'&gt;26&lt;/option&gt;\n&lt;option value='27'&gt;27&lt;/option&gt;\n&lt;option value='28'&gt;28&lt;/option&gt;\n&lt;option value='29'&gt;29&lt;/option&gt;\n&lt;option value='30'&gt;30&lt;/option&gt;\n&lt;option value='31'&gt;31&lt;/option&gt;\n&lt;option value='32'&gt;32&lt;/option&gt;\n&lt;option value='33'&gt;33&lt;/option&gt;\n&lt;option value='34'&gt;34&lt;/option&gt;\n&lt;option selected='selected' value='35'&gt;35&lt;/option&gt;\n&lt;option value='36'&gt;36&lt;/option&gt;\n&lt;option value='37'&gt;37&lt;/option&gt;\n&lt;option value='38'&gt;38&lt;/option&gt;\n&lt;option value='39'&gt;39&lt;/option&gt;\n&lt;option value='40'&gt;40&lt;/option&gt;\n&lt;option value='41'&gt;41&lt;/option&gt;\n&lt;option value='42'&gt;42&lt;/option&gt;\n&lt;option value='43'&gt;43&lt;/option&gt;\n&lt;option value='44'&gt;44&lt;/option&gt;\n&lt;option value='45'&gt;45&lt;/option&gt;\n&lt;option value='46'&gt;46&lt;/option&gt;\n&lt;option value='47'&gt;47&lt;/option&gt;\n&lt;option value='48'&gt;48&lt;/option&gt;\n&lt;option value='49'&gt;49&lt;/option&gt;\n&lt;option value='50'&gt;50&lt;/option&gt;\n&lt;option value='51'&gt;51&lt;/option&gt;\n&lt;option value='52'&gt;52&lt;/option&gt;\n&lt;option value='53'&gt;53&lt;/option&gt;\n&lt;option value='54'&gt;54&lt;/option&gt;\n&lt;option value='55'&gt;55&lt;/option&gt;\n&lt;option value='56'&gt;56&lt;/option&gt;\n&lt;option value='57'&gt;57&lt;/option&gt;\n&lt;option value='58'&gt;58&lt;/option&gt;\n&lt;option value='59'&gt;59&lt;/option&gt;\n&lt;/select&gt;\n&quot;
+    expected = &quot;&lt;select id='post_updated_at_1i' name='post[updated_at(1i)]' class='selector'&gt;\n&lt;option value='1999'&gt;1999&lt;/option&gt;\n&lt;option value='2000'&gt;2000&lt;/option&gt;\n&lt;option value='2001'&gt;2001&lt;/option&gt;\n&lt;option value='2002'&gt;2002&lt;/option&gt;\n&lt;option value='2003'&gt;2003&lt;/option&gt;\n&lt;option selected='selected' value='2004'&gt;2004&lt;/option&gt;\n&lt;option value='2005'&gt;2005&lt;/option&gt;\n&lt;option value='2006'&gt;2006&lt;/option&gt;\n&lt;option value='2007'&gt;2007&lt;/option&gt;\n&lt;option value='2008'&gt;2008&lt;/option&gt;\n&lt;option value='2009'&gt;2009&lt;/option&gt;\n&lt;/select&gt;\n&quot;
+    expected &lt;&lt; &quot;&lt;select id='post_updated_at_2i' name='post[updated_at(2i)]' class='selector'&gt;\n&lt;option value='1'&gt;January&lt;/option&gt;\n&lt;option value='2'&gt;February&lt;/option&gt;\n&lt;option value='3'&gt;March&lt;/option&gt;\n&lt;option value='4'&gt;April&lt;/option&gt;\n&lt;option value='5'&gt;May&lt;/option&gt;\n&lt;option selected='selected' value='6'&gt;June&lt;/option&gt;\n&lt;option value='7'&gt;July&lt;/option&gt;\n&lt;option value='8'&gt;August&lt;/option&gt;\n&lt;option value='9'&gt;September&lt;/option&gt;\n&lt;option value='10'&gt;October&lt;/option&gt;\n&lt;option value='11'&gt;November&lt;/option&gt;\n&lt;option value='12'&gt;December&lt;/option&gt;\n&lt;/select&gt;\n&quot;
+    expected &lt;&lt; &quot;&lt;select id='post_updated_at_3i' name='post[updated_at(3i)]' class='selector'&gt;\n&lt;option value='1'&gt;1&lt;/option&gt;\n&lt;option value='2'&gt;2&lt;/option&gt;\n&lt;option value='3'&gt;3&lt;/option&gt;\n&lt;option value='4'&gt;4&lt;/option&gt;\n&lt;option value='5'&gt;5&lt;/option&gt;\n&lt;option value='6'&gt;6&lt;/option&gt;\n&lt;option value='7'&gt;7&lt;/option&gt;\n&lt;option value='8'&gt;8&lt;/option&gt;\n&lt;option value='9'&gt;9&lt;/option&gt;\n&lt;option value='10'&gt;10&lt;/option&gt;\n&lt;option value='11'&gt;11&lt;/option&gt;\n&lt;option value='12'&gt;12&lt;/option&gt;\n&lt;option value='13'&gt;13&lt;/option&gt;\n&lt;option value='14'&gt;14&lt;/option&gt;\n&lt;option selected='selected' value='15'&gt;15&lt;/option&gt;\n&lt;option value='16'&gt;16&lt;/option&gt;\n&lt;option value='17'&gt;17&lt;/option&gt;\n&lt;option value='18'&gt;18&lt;/option&gt;\n&lt;option value='19'&gt;19&lt;/option&gt;\n&lt;option value='20'&gt;20&lt;/option&gt;\n&lt;option value='21'&gt;21&lt;/option&gt;\n&lt;option value='22'&gt;22&lt;/option&gt;\n&lt;option value='23'&gt;23&lt;/option&gt;\n&lt;option value='24'&gt;24&lt;/option&gt;\n&lt;option value='25'&gt;25&lt;/option&gt;\n&lt;option value='26'&gt;26&lt;/option&gt;\n&lt;option value='27'&gt;27&lt;/option&gt;\n&lt;option value='28'&gt;28&lt;/option&gt;\n&lt;option value='29'&gt;29&lt;/option&gt;\n&lt;option value='30'&gt;30&lt;/option&gt;\n&lt;option value='31'&gt;31&lt;/option&gt;\n&lt;/select&gt;\n&quot;
+    expected &lt;&lt; &quot; &amp;mdash; &lt;select id='post_updated_at_4i' name='post[updated_at(4i)]' class='selector'&gt;\n&lt;option value='00'&gt;00&lt;/option&gt;\n&lt;option value='01'&gt;01&lt;/option&gt;\n&lt;option value='02'&gt;02&lt;/option&gt;\n&lt;option value='03'&gt;03&lt;/option&gt;\n&lt;option value='04'&gt;04&lt;/option&gt;\n&lt;option value='05'&gt;05&lt;/option&gt;\n&lt;option value='06'&gt;06&lt;/option&gt;\n&lt;option value='07'&gt;07&lt;/option&gt;\n&lt;option value='08'&gt;08&lt;/option&gt;\n&lt;option value='09'&gt;09&lt;/option&gt;\n&lt;option value='10'&gt;10&lt;/option&gt;\n&lt;option value='11'&gt;11&lt;/option&gt;\n&lt;option value='12'&gt;12&lt;/option&gt;\n&lt;option value='13'&gt;13&lt;/option&gt;\n&lt;option value='14'&gt;14&lt;/option&gt;\n&lt;option value='15'&gt;15&lt;/option&gt;\n&lt;option selected='selected' value='16'&gt;16&lt;/option&gt;\n&lt;option value='17'&gt;17&lt;/option&gt;\n&lt;option value='18'&gt;18&lt;/option&gt;\n&lt;option value='19'&gt;19&lt;/option&gt;\n&lt;option value='20'&gt;20&lt;/option&gt;\n&lt;option value='21'&gt;21&lt;/option&gt;\n&lt;option value='22'&gt;22&lt;/option&gt;\n&lt;option value='23'&gt;23&lt;/option&gt;\n&lt;/select&gt;\n&quot;
+    expected &lt;&lt; &quot; : &lt;select id='post_updated_at_5i' name='post[updated_at(5i)]' class='selector'&gt;\n&lt;option value='00'&gt;00&lt;/option&gt;\n&lt;option value='01'&gt;01&lt;/option&gt;\n&lt;option value='02'&gt;02&lt;/option&gt;\n&lt;option value='03'&gt;03&lt;/option&gt;\n&lt;option value='04'&gt;04&lt;/option&gt;\n&lt;option value='05'&gt;05&lt;/option&gt;\n&lt;option value='06'&gt;06&lt;/option&gt;\n&lt;option value='07'&gt;07&lt;/option&gt;\n&lt;option value='08'&gt;08&lt;/option&gt;\n&lt;option value='09'&gt;09&lt;/option&gt;\n&lt;option value='10'&gt;10&lt;/option&gt;\n&lt;option value='11'&gt;11&lt;/option&gt;\n&lt;option value='12'&gt;12&lt;/option&gt;\n&lt;option value='13'&gt;13&lt;/option&gt;\n&lt;option value='14'&gt;14&lt;/option&gt;\n&lt;option value='15'&gt;15&lt;/option&gt;\n&lt;option value='16'&gt;16&lt;/option&gt;\n&lt;option value='17'&gt;17&lt;/option&gt;\n&lt;option value='18'&gt;18&lt;/option&gt;\n&lt;option value='19'&gt;19&lt;/option&gt;\n&lt;option value='20'&gt;20&lt;/option&gt;\n&lt;option value='21'&gt;21&lt;/option&gt;\n&lt;option value='22'&gt;22&lt;/option&gt;\n&lt;option value='23'&gt;23&lt;/option&gt;\n&lt;option value='24'&gt;24&lt;/option&gt;\n&lt;option value='25'&gt;25&lt;/option&gt;\n&lt;option value='26'&gt;26&lt;/option&gt;\n&lt;option value='27'&gt;27&lt;/option&gt;\n&lt;option value='28'&gt;28&lt;/option&gt;\n&lt;option value='29'&gt;29&lt;/option&gt;\n&lt;option value='30'&gt;30&lt;/option&gt;\n&lt;option value='31'&gt;31&lt;/option&gt;\n&lt;option value='32'&gt;32&lt;/option&gt;\n&lt;option value='33'&gt;33&lt;/option&gt;\n&lt;option value='34'&gt;34&lt;/option&gt;\n&lt;option selected='selected' value='35'&gt;35&lt;/option&gt;\n&lt;option value='36'&gt;36&lt;/option&gt;\n&lt;option value='37'&gt;37&lt;/option&gt;\n&lt;option value='38'&gt;38&lt;/option&gt;\n&lt;option value='39'&gt;39&lt;/option&gt;\n&lt;option value='40'&gt;40&lt;/option&gt;\n&lt;option value='41'&gt;41&lt;/option&gt;\n&lt;option value='42'&gt;42&lt;/option&gt;\n&lt;option value='43'&gt;43&lt;/option&gt;\n&lt;option value='44'&gt;44&lt;/option&gt;\n&lt;option value='45'&gt;45&lt;/option&gt;\n&lt;option value='46'&gt;46&lt;/option&gt;\n&lt;option value='47'&gt;47&lt;/option&gt;\n&lt;option value='48'&gt;48&lt;/option&gt;\n&lt;option value='49'&gt;49&lt;/option&gt;\n&lt;option value='50'&gt;50&lt;/option&gt;\n&lt;option value='51'&gt;51&lt;/option&gt;\n&lt;option value='52'&gt;52&lt;/option&gt;\n&lt;option value='53'&gt;53&lt;/option&gt;\n&lt;option value='54'&gt;54&lt;/option&gt;\n&lt;option value='55'&gt;55&lt;/option&gt;\n&lt;option value='56'&gt;56&lt;/option&gt;\n&lt;option value='57'&gt;57&lt;/option&gt;\n&lt;option value='58'&gt;58&lt;/option&gt;\n&lt;option value='59'&gt;59&lt;/option&gt;\n&lt;/select&gt;\n&quot;
 
-    assert_dom_equal(expected, _erbout)
+    assert_dom_equal expected, _erbout
   end
 
   def test_date_select_with_zero_value_and_no_start_year</diff>
      <filename>vendor/rails/actionpack/test/template/date_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,66 +1,43 @@
 require 'abstract_unit'
 
-class MockTimeZone
-  attr_reader :name
-
-  def initialize( name )
-    @name = name
-  end
-
-  def self.all
-    [ &quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;, &quot;E&quot; ].map { |s| new s }
-  end
-
-  def ==( z )
-    z &amp;&amp; @name == z.name
-  end
-
-  def to_s
-    @name
-  end
-end
-
-ActionView::Helpers::FormOptionsHelper::TimeZone = MockTimeZone
-
-class FormOptionsHelperTest &lt; ActionView::TestCase
-  tests ActionView::Helpers::FormOptionsHelper
-
-  silence_warnings do
-    Post      = Struct.new('Post', :title, :author_name, :body, :secret, :written_on, :category, :origin)
-    Continent = Struct.new('Continent', :continent_name, :countries)
-    Country   = Struct.new('Country', :country_id, :country_name)
-    Firm      = Struct.new('Firm', :time_zone)
-    Album     = Struct.new('Album', :id, :title, :genre)
-  end
+TZInfo::Timezone.cattr_reader :loaded_zones
+
+uses_mocha &quot;FormOptionsHelperTest&quot; do
+  class FormOptionsHelperTest &lt; ActionView::TestCase
+    tests ActionView::Helpers::FormOptionsHelper
+
+    silence_warnings do
+      Post      = Struct.new('Post', :title, :author_name, :body, :secret, :written_on, :category, :origin)
+      Continent = Struct.new('Continent', :continent_name, :countries)
+      Country   = Struct.new('Country', :country_id, :country_name)
+      Firm      = Struct.new('Firm', :time_zone)
+      Album     = Struct.new('Album', :id, :title, :genre)
+    end
 
-  def test_collection_options
-    @posts = [
-      Post.new(&quot;&lt;Abe&gt; went home&quot;, &quot;&lt;Abe&gt;&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
-      Post.new(&quot;Babe went home&quot;, &quot;Babe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
-      Post.new(&quot;Cabe went home&quot;, &quot;Cabe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;)
-    ]
-
-    assert_dom_equal(
-      &quot;&lt;option value=\&quot;&amp;lt;Abe&amp;gt;\&quot;&gt;&amp;lt;Abe&amp;gt; went home&lt;/option&gt;\n&lt;option value=\&quot;Babe\&quot;&gt;Babe went home&lt;/option&gt;\n&lt;option value=\&quot;Cabe\&quot;&gt;Cabe went home&lt;/option&gt;&quot;,
-      options_from_collection_for_select(@posts, &quot;author_name&quot;, &quot;title&quot;)
-    )
-  end
+    def setup
+      @fake_timezones = %w(A B C D E).inject([]) do |zones, id|
+        tz = TZInfo::Timezone.loaded_zones[id] = stub(:name =&gt; id, :to_s =&gt; id)
+        ActiveSupport::TimeZone.stubs(:[]).with(id).returns(tz)
+        zones &lt;&lt; tz
+      end
+      ActiveSupport::TimeZone.stubs(:all).returns(@fake_timezones)
+    end
 
+    def test_collection_options
+      @posts = [
+        Post.new(&quot;&lt;Abe&gt; went home&quot;, &quot;&lt;Abe&gt;&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
+        Post.new(&quot;Babe went home&quot;, &quot;Babe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
+        Post.new(&quot;Cabe went home&quot;, &quot;Cabe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;)
+      ]
 
-  def test_collection_options_with_preselected_value
-    @posts = [
-      Post.new(&quot;&lt;Abe&gt; went home&quot;, &quot;&lt;Abe&gt;&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
-      Post.new(&quot;Babe went home&quot;, &quot;Babe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
-      Post.new(&quot;Cabe went home&quot;, &quot;Cabe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;)
-    ]
+      assert_dom_equal(
+        &quot;&lt;option value=\&quot;&amp;lt;Abe&amp;gt;\&quot;&gt;&amp;lt;Abe&amp;gt; went home&lt;/option&gt;\n&lt;option value=\&quot;Babe\&quot;&gt;Babe went home&lt;/option&gt;\n&lt;option value=\&quot;Cabe\&quot;&gt;Cabe went home&lt;/option&gt;&quot;,
+        options_from_collection_for_select(@posts, &quot;author_name&quot;, &quot;title&quot;)
+      )
+    end
 
-    assert_dom_equal(
-      &quot;&lt;option value=\&quot;&amp;lt;Abe&amp;gt;\&quot;&gt;&amp;lt;Abe&amp;gt; went home&lt;/option&gt;\n&lt;option value=\&quot;Babe\&quot; selected=\&quot;selected\&quot;&gt;Babe went home&lt;/option&gt;\n&lt;option value=\&quot;Cabe\&quot;&gt;Cabe went home&lt;/option&gt;&quot;,
-      options_from_collection_for_select(@posts, &quot;author_name&quot;, &quot;title&quot;, &quot;Babe&quot;)
-    )
-  end
 
-  def test_collection_options_with_preselected_value_array
+    def test_collection_options_with_preselected_value
       @posts = [
         Post.new(&quot;&lt;Abe&gt; went home&quot;, &quot;&lt;Abe&gt;&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
         Post.new(&quot;Babe went home&quot;, &quot;Babe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
@@ -68,358 +45,371 @@ class FormOptionsHelperTest &lt; ActionView::TestCase
       ]
 
       assert_dom_equal(
-        &quot;&lt;option value=\&quot;&amp;lt;Abe&amp;gt;\&quot;&gt;&amp;lt;Abe&amp;gt; went home&lt;/option&gt;\n&lt;option value=\&quot;Babe\&quot; selected=\&quot;selected\&quot;&gt;Babe went home&lt;/option&gt;\n&lt;option value=\&quot;Cabe\&quot; selected=\&quot;selected\&quot;&gt;Cabe went home&lt;/option&gt;&quot;,
-        options_from_collection_for_select(@posts, &quot;author_name&quot;, &quot;title&quot;, [ &quot;Babe&quot;, &quot;Cabe&quot; ])
+        &quot;&lt;option value=\&quot;&amp;lt;Abe&amp;gt;\&quot;&gt;&amp;lt;Abe&amp;gt; went home&lt;/option&gt;\n&lt;option value=\&quot;Babe\&quot; selected=\&quot;selected\&quot;&gt;Babe went home&lt;/option&gt;\n&lt;option value=\&quot;Cabe\&quot;&gt;Cabe went home&lt;/option&gt;&quot;,
+        options_from_collection_for_select(@posts, &quot;author_name&quot;, &quot;title&quot;, &quot;Babe&quot;)
       )
-  end
+    end
 
-  def test_array_options_for_select
-    assert_dom_equal(
-      &quot;&lt;option value=\&quot;&amp;lt;Denmark&amp;gt;\&quot;&gt;&amp;lt;Denmark&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;USA\&quot;&gt;USA&lt;/option&gt;\n&lt;option value=\&quot;Sweden\&quot;&gt;Sweden&lt;/option&gt;&quot;,
-      options_for_select([ &quot;&lt;Denmark&gt;&quot;, &quot;USA&quot;, &quot;Sweden&quot; ])
-    )
-  end
+    def test_collection_options_with_preselected_value_array
+        @posts = [
+          Post.new(&quot;&lt;Abe&gt; went home&quot;, &quot;&lt;Abe&gt;&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
+          Post.new(&quot;Babe went home&quot;, &quot;Babe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
+          Post.new(&quot;Cabe went home&quot;, &quot;Cabe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;)
+        ]
+
+        assert_dom_equal(
+          &quot;&lt;option value=\&quot;&amp;lt;Abe&amp;gt;\&quot;&gt;&amp;lt;Abe&amp;gt; went home&lt;/option&gt;\n&lt;option value=\&quot;Babe\&quot; selected=\&quot;selected\&quot;&gt;Babe went home&lt;/option&gt;\n&lt;option value=\&quot;Cabe\&quot; selected=\&quot;selected\&quot;&gt;Cabe went home&lt;/option&gt;&quot;,
+          options_from_collection_for_select(@posts, &quot;author_name&quot;, &quot;title&quot;, [ &quot;Babe&quot;, &quot;Cabe&quot; ])
+        )
+    end
 
-  def test_array_options_for_select_with_selection
-    assert_dom_equal(
-      &quot;&lt;option value=\&quot;Denmark\&quot;&gt;Denmark&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;USA&amp;gt;\&quot; selected=\&quot;selected\&quot;&gt;&amp;lt;USA&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Sweden\&quot;&gt;Sweden&lt;/option&gt;&quot;,
-      options_for_select([ &quot;Denmark&quot;, &quot;&lt;USA&gt;&quot;, &quot;Sweden&quot; ], &quot;&lt;USA&gt;&quot;)
-    )
-  end
+    def test_array_options_for_select
+      assert_dom_equal(
+        &quot;&lt;option value=\&quot;&amp;lt;Denmark&amp;gt;\&quot;&gt;&amp;lt;Denmark&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;USA\&quot;&gt;USA&lt;/option&gt;\n&lt;option value=\&quot;Sweden\&quot;&gt;Sweden&lt;/option&gt;&quot;,
+        options_for_select([ &quot;&lt;Denmark&gt;&quot;, &quot;USA&quot;, &quot;Sweden&quot; ])
+      )
+    end
 
-  def test_array_options_for_select_with_selection_array
+    def test_array_options_for_select_with_selection
       assert_dom_equal(
-        &quot;&lt;option value=\&quot;Denmark\&quot;&gt;Denmark&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;USA&amp;gt;\&quot; selected=\&quot;selected\&quot;&gt;&amp;lt;USA&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Sweden\&quot; selected=\&quot;selected\&quot;&gt;Sweden&lt;/option&gt;&quot;,
-        options_for_select([ &quot;Denmark&quot;, &quot;&lt;USA&gt;&quot;, &quot;Sweden&quot; ], [ &quot;&lt;USA&gt;&quot;, &quot;Sweden&quot; ])
+        &quot;&lt;option value=\&quot;Denmark\&quot;&gt;Denmark&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;USA&amp;gt;\&quot; selected=\&quot;selected\&quot;&gt;&amp;lt;USA&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Sweden\&quot;&gt;Sweden&lt;/option&gt;&quot;,
+        options_for_select([ &quot;Denmark&quot;, &quot;&lt;USA&gt;&quot;, &quot;Sweden&quot; ], &quot;&lt;USA&gt;&quot;)
       )
-  end
+    end
+
+    def test_array_options_for_select_with_selection_array
+        assert_dom_equal(
+          &quot;&lt;option value=\&quot;Denmark\&quot;&gt;Denmark&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;USA&amp;gt;\&quot; selected=\&quot;selected\&quot;&gt;&amp;lt;USA&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Sweden\&quot; selected=\&quot;selected\&quot;&gt;Sweden&lt;/option&gt;&quot;,
+          options_for_select([ &quot;Denmark&quot;, &quot;&lt;USA&gt;&quot;, &quot;Sweden&quot; ], [ &quot;&lt;USA&gt;&quot;, &quot;Sweden&quot; ])
+        )
+    end
+
+    def test_array_options_for_string_include_in_other_string_bug_fix
+        assert_dom_equal(
+          &quot;&lt;option value=\&quot;ruby\&quot;&gt;ruby&lt;/option&gt;\n&lt;option value=\&quot;rubyonrails\&quot; selected=\&quot;selected\&quot;&gt;rubyonrails&lt;/option&gt;&quot;,
+          options_for_select([ &quot;ruby&quot;, &quot;rubyonrails&quot; ], &quot;rubyonrails&quot;)
+        )
+        assert_dom_equal(
+          &quot;&lt;option value=\&quot;ruby\&quot; selected=\&quot;selected\&quot;&gt;ruby&lt;/option&gt;\n&lt;option value=\&quot;rubyonrails\&quot;&gt;rubyonrails&lt;/option&gt;&quot;,
+          options_for_select([ &quot;ruby&quot;, &quot;rubyonrails&quot; ], &quot;ruby&quot;)
+        )
+        assert_dom_equal(
+          %(&lt;option value=&quot;ruby&quot; selected=&quot;selected&quot;&gt;ruby&lt;/option&gt;\n&lt;option value=&quot;rubyonrails&quot;&gt;rubyonrails&lt;/option&gt;\n&lt;option value=&quot;&quot;&gt;&lt;/option&gt;),
+          options_for_select([ &quot;ruby&quot;, &quot;rubyonrails&quot;, nil ], &quot;ruby&quot;)
+        )
+    end
 
-  def test_array_options_for_string_include_in_other_string_bug_fix
+    def test_hash_options_for_select
       assert_dom_equal(
-        &quot;&lt;option value=\&quot;ruby\&quot;&gt;ruby&lt;/option&gt;\n&lt;option value=\&quot;rubyonrails\&quot; selected=\&quot;selected\&quot;&gt;rubyonrails&lt;/option&gt;&quot;,
-        options_for_select([ &quot;ruby&quot;, &quot;rubyonrails&quot; ], &quot;rubyonrails&quot;)
+        &quot;&lt;option value=\&quot;&amp;lt;Kroner&amp;gt;\&quot;&gt;&amp;lt;DKR&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Dollar\&quot;&gt;$&lt;/option&gt;&quot;,
+        options_for_select(&quot;$&quot; =&gt; &quot;Dollar&quot;, &quot;&lt;DKR&gt;&quot; =&gt; &quot;&lt;Kroner&gt;&quot;).split(&quot;\n&quot;).sort.join(&quot;\n&quot;)
       )
       assert_dom_equal(
-        &quot;&lt;option value=\&quot;ruby\&quot; selected=\&quot;selected\&quot;&gt;ruby&lt;/option&gt;\n&lt;option value=\&quot;rubyonrails\&quot;&gt;rubyonrails&lt;/option&gt;&quot;,
-        options_for_select([ &quot;ruby&quot;, &quot;rubyonrails&quot; ], &quot;ruby&quot;)
+        &quot;&lt;option value=\&quot;&amp;lt;Kroner&amp;gt;\&quot;&gt;&amp;lt;DKR&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Dollar\&quot; selected=\&quot;selected\&quot;&gt;$&lt;/option&gt;&quot;,
+        options_for_select({ &quot;$&quot; =&gt; &quot;Dollar&quot;, &quot;&lt;DKR&gt;&quot; =&gt; &quot;&lt;Kroner&gt;&quot; }, &quot;Dollar&quot;).split(&quot;\n&quot;).sort.join(&quot;\n&quot;)
       )
       assert_dom_equal(
-        %(&lt;option value=&quot;ruby&quot; selected=&quot;selected&quot;&gt;ruby&lt;/option&gt;\n&lt;option value=&quot;rubyonrails&quot;&gt;rubyonrails&lt;/option&gt;\n&lt;option value=&quot;&quot;&gt;&lt;/option&gt;),
-        options_for_select([ &quot;ruby&quot;, &quot;rubyonrails&quot;, nil ], &quot;ruby&quot;)
+        &quot;&lt;option value=\&quot;&amp;lt;Kroner&amp;gt;\&quot; selected=\&quot;selected\&quot;&gt;&amp;lt;DKR&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Dollar\&quot; selected=\&quot;selected\&quot;&gt;$&lt;/option&gt;&quot;,
+        options_for_select({ &quot;$&quot; =&gt; &quot;Dollar&quot;, &quot;&lt;DKR&gt;&quot; =&gt; &quot;&lt;Kroner&gt;&quot; }, [ &quot;Dollar&quot;, &quot;&lt;Kroner&gt;&quot; ]).split(&quot;\n&quot;).sort.join(&quot;\n&quot;)
       )
-  end
+    end
 
-  def test_hash_options_for_select
-    assert_dom_equal(
-      &quot;&lt;option value=\&quot;&amp;lt;Kroner&amp;gt;\&quot;&gt;&amp;lt;DKR&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Dollar\&quot;&gt;$&lt;/option&gt;&quot;,
-      options_for_select(&quot;$&quot; =&gt; &quot;Dollar&quot;, &quot;&lt;DKR&gt;&quot; =&gt; &quot;&lt;Kroner&gt;&quot;).split(&quot;\n&quot;).sort.join(&quot;\n&quot;)
-    )
-    assert_dom_equal(
-      &quot;&lt;option value=\&quot;&amp;lt;Kroner&amp;gt;\&quot;&gt;&amp;lt;DKR&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Dollar\&quot; selected=\&quot;selected\&quot;&gt;$&lt;/option&gt;&quot;,
-      options_for_select({ &quot;$&quot; =&gt; &quot;Dollar&quot;, &quot;&lt;DKR&gt;&quot; =&gt; &quot;&lt;Kroner&gt;&quot; }, &quot;Dollar&quot;).split(&quot;\n&quot;).sort.join(&quot;\n&quot;)
-    )
-    assert_dom_equal(
-      &quot;&lt;option value=\&quot;&amp;lt;Kroner&amp;gt;\&quot; selected=\&quot;selected\&quot;&gt;&amp;lt;DKR&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Dollar\&quot; selected=\&quot;selected\&quot;&gt;$&lt;/option&gt;&quot;,
-      options_for_select({ &quot;$&quot; =&gt; &quot;Dollar&quot;, &quot;&lt;DKR&gt;&quot; =&gt; &quot;&lt;Kroner&gt;&quot; }, [ &quot;Dollar&quot;, &quot;&lt;Kroner&gt;&quot; ]).split(&quot;\n&quot;).sort.join(&quot;\n&quot;)
-    )
-  end
+    def test_ducktyped_options_for_select
+      quack = Struct.new(:first, :last)
+      assert_dom_equal(
+        &quot;&lt;option value=\&quot;&amp;lt;Kroner&amp;gt;\&quot;&gt;&amp;lt;DKR&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Dollar\&quot;&gt;$&lt;/option&gt;&quot;,
+        options_for_select([quack.new(&quot;&lt;DKR&gt;&quot;, &quot;&lt;Kroner&gt;&quot;), quack.new(&quot;$&quot;, &quot;Dollar&quot;)])
+      )
+      assert_dom_equal(
+        &quot;&lt;option value=\&quot;&amp;lt;Kroner&amp;gt;\&quot;&gt;&amp;lt;DKR&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Dollar\&quot; selected=\&quot;selected\&quot;&gt;$&lt;/option&gt;&quot;,
+        options_for_select([quack.new(&quot;&lt;DKR&gt;&quot;, &quot;&lt;Kroner&gt;&quot;), quack.new(&quot;$&quot;, &quot;Dollar&quot;)], &quot;Dollar&quot;)
+      )
+      assert_dom_equal(
+        &quot;&lt;option value=\&quot;&amp;lt;Kroner&amp;gt;\&quot; selected=\&quot;selected\&quot;&gt;&amp;lt;DKR&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Dollar\&quot; selected=\&quot;selected\&quot;&gt;$&lt;/option&gt;&quot;,
+        options_for_select([quack.new(&quot;&lt;DKR&gt;&quot;, &quot;&lt;Kroner&gt;&quot;), quack.new(&quot;$&quot;, &quot;Dollar&quot;)], [&quot;Dollar&quot;, &quot;&lt;Kroner&gt;&quot;])
+      )
+    end
 
-  def test_ducktyped_options_for_select
-    quack = Struct.new(:first, :last)
-    assert_dom_equal(
-      &quot;&lt;option value=\&quot;&amp;lt;Kroner&amp;gt;\&quot;&gt;&amp;lt;DKR&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Dollar\&quot;&gt;$&lt;/option&gt;&quot;,
-      options_for_select([quack.new(&quot;&lt;DKR&gt;&quot;, &quot;&lt;Kroner&gt;&quot;), quack.new(&quot;$&quot;, &quot;Dollar&quot;)])
-    )
-    assert_dom_equal(
-      &quot;&lt;option value=\&quot;&amp;lt;Kroner&amp;gt;\&quot;&gt;&amp;lt;DKR&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Dollar\&quot; selected=\&quot;selected\&quot;&gt;$&lt;/option&gt;&quot;,
-      options_for_select([quack.new(&quot;&lt;DKR&gt;&quot;, &quot;&lt;Kroner&gt;&quot;), quack.new(&quot;$&quot;, &quot;Dollar&quot;)], &quot;Dollar&quot;)
-    )
-    assert_dom_equal(
-      &quot;&lt;option value=\&quot;&amp;lt;Kroner&amp;gt;\&quot; selected=\&quot;selected\&quot;&gt;&amp;lt;DKR&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Dollar\&quot; selected=\&quot;selected\&quot;&gt;$&lt;/option&gt;&quot;,
-      options_for_select([quack.new(&quot;&lt;DKR&gt;&quot;, &quot;&lt;Kroner&gt;&quot;), quack.new(&quot;$&quot;, &quot;Dollar&quot;)], [&quot;Dollar&quot;, &quot;&lt;Kroner&gt;&quot;])
-    )
-  end
+    def test_option_groups_from_collection_for_select
+      @continents = [
+        Continent.new(&quot;&lt;Africa&gt;&quot;, [Country.new(&quot;&lt;sa&gt;&quot;, &quot;&lt;South Africa&gt;&quot;), Country.new(&quot;so&quot;, &quot;Somalia&quot;)] ),
+        Continent.new(&quot;Europe&quot;, [Country.new(&quot;dk&quot;, &quot;Denmark&quot;), Country.new(&quot;ie&quot;, &quot;Ireland&quot;)] )
+      ]
 
-  def test_option_groups_from_collection_for_select
-    @continents = [
-      Continent.new(&quot;&lt;Africa&gt;&quot;, [Country.new(&quot;&lt;sa&gt;&quot;, &quot;&lt;South Africa&gt;&quot;), Country.new(&quot;so&quot;, &quot;Somalia&quot;)] ),
-      Continent.new(&quot;Europe&quot;, [Country.new(&quot;dk&quot;, &quot;Denmark&quot;), Country.new(&quot;ie&quot;, &quot;Ireland&quot;)] )
-    ]
+      assert_dom_equal(
+        &quot;&lt;optgroup label=\&quot;&amp;lt;Africa&amp;gt;\&quot;&gt;&lt;option value=\&quot;&amp;lt;sa&amp;gt;\&quot;&gt;&amp;lt;South Africa&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;so\&quot;&gt;Somalia&lt;/option&gt;&lt;/optgroup&gt;&lt;optgroup label=\&quot;Europe\&quot;&gt;&lt;option value=\&quot;dk\&quot; selected=\&quot;selected\&quot;&gt;Denmark&lt;/option&gt;\n&lt;option value=\&quot;ie\&quot;&gt;Ireland&lt;/option&gt;&lt;/optgroup&gt;&quot;,
+        option_groups_from_collection_for_select(@continents, &quot;countries&quot;, &quot;continent_name&quot;, &quot;country_id&quot;, &quot;country_name&quot;, &quot;dk&quot;)
+      )
+    end
 
-    assert_dom_equal(
-      &quot;&lt;optgroup label=\&quot;&amp;lt;Africa&amp;gt;\&quot;&gt;&lt;option value=\&quot;&amp;lt;sa&amp;gt;\&quot;&gt;&amp;lt;South Africa&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;so\&quot;&gt;Somalia&lt;/option&gt;&lt;/optgroup&gt;&lt;optgroup label=\&quot;Europe\&quot;&gt;&lt;option value=\&quot;dk\&quot; selected=\&quot;selected\&quot;&gt;Denmark&lt;/option&gt;\n&lt;option value=\&quot;ie\&quot;&gt;Ireland&lt;/option&gt;&lt;/optgroup&gt;&quot;,
-      option_groups_from_collection_for_select(@continents, &quot;countries&quot;, &quot;continent_name&quot;, &quot;country_id&quot;, &quot;country_name&quot;, &quot;dk&quot;)
-    )
-  end
+    def test_time_zone_options_no_parms
+      opts = time_zone_options_for_select
+      assert_dom_equal &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;D\&quot;&gt;D&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot;,
+                  opts
+    end
 
-  def test_time_zone_options_no_parms
-    opts = time_zone_options_for_select
-    assert_dom_equal &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;D\&quot;&gt;D&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot;,
-                 opts
-  end
+    def test_time_zone_options_with_selected
+      opts = time_zone_options_for_select( &quot;D&quot; )
+      assert_dom_equal &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot;,
+                  opts
+    end
 
-  def test_time_zone_options_with_selected
-    opts = time_zone_options_for_select( &quot;D&quot; )
-    assert_dom_equal &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot;,
-                 opts
-  end
+    def test_time_zone_options_with_unknown_selected
+      opts = time_zone_options_for_select( &quot;K&quot; )
+      assert_dom_equal &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;D\&quot;&gt;D&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot;,
+                  opts
+    end
 
-  def test_time_zone_options_with_unknown_selected
-    opts = time_zone_options_for_select( &quot;K&quot; )
-    assert_dom_equal &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;D\&quot;&gt;D&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot;,
-                 opts
-  end
+    def test_time_zone_options_with_priority_zones
+      zones = [ ActiveSupport::TimeZone.new( &quot;B&quot; ), ActiveSupport::TimeZone.new( &quot;E&quot; ) ]
+      opts = time_zone_options_for_select( nil, zones )
+      assert_dom_equal &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
+                  &quot;&lt;option value=\&quot;\&quot; disabled=\&quot;disabled\&quot;&gt;-------------&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;D\&quot;&gt;D&lt;/option&gt;&quot;,
+                  opts
+    end
 
-  def test_time_zone_options_with_priority_zones
-    zones = [ TimeZone.new( &quot;B&quot; ), TimeZone.new( &quot;E&quot; ) ]
-    opts = time_zone_options_for_select( nil, zones )
-    assert_dom_equal &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
-                 &quot;&lt;option value=\&quot;\&quot; disabled=\&quot;disabled\&quot;&gt;-------------&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;D\&quot;&gt;D&lt;/option&gt;&quot;,
-                 opts
-  end
+    def test_time_zone_options_with_selected_priority_zones
+      zones = [ ActiveSupport::TimeZone.new( &quot;B&quot; ), ActiveSupport::TimeZone.new( &quot;E&quot; ) ]
+      opts = time_zone_options_for_select( &quot;E&quot;, zones )
+      assert_dom_equal &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;E\&quot; selected=\&quot;selected\&quot;&gt;E&lt;/option&gt;&quot; +
+                  &quot;&lt;option value=\&quot;\&quot; disabled=\&quot;disabled\&quot;&gt;-------------&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;D\&quot;&gt;D&lt;/option&gt;&quot;,
+                  opts
+    end
 
-  def test_time_zone_options_with_selected_priority_zones
-    zones = [ TimeZone.new( &quot;B&quot; ), TimeZone.new( &quot;E&quot; ) ]
-    opts = time_zone_options_for_select( &quot;E&quot;, zones )
-    assert_dom_equal &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;E\&quot; selected=\&quot;selected\&quot;&gt;E&lt;/option&gt;&quot; +
-                 &quot;&lt;option value=\&quot;\&quot; disabled=\&quot;disabled\&quot;&gt;-------------&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;D\&quot;&gt;D&lt;/option&gt;&quot;,
-                 opts
-  end
+    def test_time_zone_options_with_unselected_priority_zones
+      zones = [ ActiveSupport::TimeZone.new( &quot;B&quot; ), ActiveSupport::TimeZone.new( &quot;E&quot; ) ]
+      opts = time_zone_options_for_select( &quot;C&quot;, zones )
+      assert_dom_equal &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
+                  &quot;&lt;option value=\&quot;\&quot; disabled=\&quot;disabled\&quot;&gt;-------------&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;C\&quot; selected=\&quot;selected\&quot;&gt;C&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;D\&quot;&gt;D&lt;/option&gt;&quot;,
+                  opts
+    end
 
-  def test_time_zone_options_with_unselected_priority_zones
-    zones = [ TimeZone.new( &quot;B&quot; ), TimeZone.new( &quot;E&quot; ) ]
-    opts = time_zone_options_for_select( &quot;C&quot;, zones )
-    assert_dom_equal &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
-                 &quot;&lt;option value=\&quot;\&quot; disabled=\&quot;disabled\&quot;&gt;-------------&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;C\&quot; selected=\&quot;selected\&quot;&gt;C&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;D\&quot;&gt;D&lt;/option&gt;&quot;,
-                 opts
-  end
+    def test_select
+      @post = Post.new
+      @post.category = &quot;&lt;mus&gt;&quot;
+      assert_dom_equal(
+        &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;abe\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot; selected=\&quot;selected\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
+        select(&quot;post&quot;, &quot;category&quot;, %w( abe &lt;mus&gt; hest))
+      )
+    end
 
-  def test_select
-    @post = Post.new
-    @post.category = &quot;&lt;mus&gt;&quot;
-    assert_dom_equal(
-      &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;abe\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot; selected=\&quot;selected\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
-      select(&quot;post&quot;, &quot;category&quot;, %w( abe &lt;mus&gt; hest))
-    )
-  end
+    def test_select_under_fields_for
+      @post = Post.new
+      @post.category = &quot;&lt;mus&gt;&quot;
 
-  def test_select_under_fields_for
-    @post = Post.new
-    @post.category = &quot;&lt;mus&gt;&quot;
-    
-    _erbout = ''
-    
-    fields_for :post, @post do |f|
-      _erbout.concat f.select(:category, %w( abe &lt;mus&gt; hest))
+      _erbout = ''
+
+      fields_for :post, @post do |f|
+        _erbout.concat f.select(:category, %w( abe &lt;mus&gt; hest))
+      end
+
+      assert_dom_equal(
+        &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;abe\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot; selected=\&quot;selected\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
+        _erbout
+      )
     end
-    
-    assert_dom_equal(
-      &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;abe\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot; selected=\&quot;selected\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
-      _erbout
-    )
-  end
 
-  def test_select_with_blank
-    @post = Post.new
-    @post.category = &quot;&lt;mus&gt;&quot;
-    assert_dom_equal(
-      &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;\&quot;&gt;&lt;/option&gt;\n&lt;option value=\&quot;abe\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot; selected=\&quot;selected\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
-      select(&quot;post&quot;, &quot;category&quot;, %w( abe &lt;mus&gt; hest), :include_blank =&gt; true)
-    )
-  end
+    def test_select_with_blank
+      @post = Post.new
+      @post.category = &quot;&lt;mus&gt;&quot;
+      assert_dom_equal(
+        &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;\&quot;&gt;&lt;/option&gt;\n&lt;option value=\&quot;abe\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot; selected=\&quot;selected\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
+        select(&quot;post&quot;, &quot;category&quot;, %w( abe &lt;mus&gt; hest), :include_blank =&gt; true)
+      )
+    end
 
-  def test_select_with_blank_as_string
-    @post = Post.new
-    @post.category = &quot;&lt;mus&gt;&quot;
-    assert_dom_equal(
-      &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;\&quot;&gt;None&lt;/option&gt;\n&lt;option value=\&quot;abe\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot; selected=\&quot;selected\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
-      select(&quot;post&quot;, &quot;category&quot;, %w( abe &lt;mus&gt; hest), :include_blank =&gt; 'None')
-    )
-  end
+    def test_select_with_blank_as_string
+      @post = Post.new
+      @post.category = &quot;&lt;mus&gt;&quot;
+      assert_dom_equal(
+        &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;\&quot;&gt;None&lt;/option&gt;\n&lt;option value=\&quot;abe\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot; selected=\&quot;selected\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
+        select(&quot;post&quot;, &quot;category&quot;, %w( abe &lt;mus&gt; hest), :include_blank =&gt; 'None')
+      )
+    end
 
-  def test_select_with_default_prompt
-    @post = Post.new
-    @post.category = &quot;&quot;
-    assert_dom_equal(
-      &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;\&quot;&gt;Please select&lt;/option&gt;\n&lt;option value=\&quot;abe\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
-      select(&quot;post&quot;, &quot;category&quot;, %w( abe &lt;mus&gt; hest), :prompt =&gt; true)
-    )
-  end
+    def test_select_with_default_prompt
+      @post = Post.new
+      @post.category = &quot;&quot;
+      assert_dom_equal(
+        &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;\&quot;&gt;Please select&lt;/option&gt;\n&lt;option value=\&quot;abe\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
+        select(&quot;post&quot;, &quot;category&quot;, %w( abe &lt;mus&gt; hest), :prompt =&gt; true)
+      )
+    end
 
-  def test_select_no_prompt_when_select_has_value
-    @post = Post.new
-    @post.category = &quot;&lt;mus&gt;&quot;
-    assert_dom_equal(
-      &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;abe\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot; selected=\&quot;selected\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
-      select(&quot;post&quot;, &quot;category&quot;, %w( abe &lt;mus&gt; hest), :prompt =&gt; true)
-    )
-  end
+    def test_select_no_prompt_when_select_has_value
+      @post = Post.new
+      @post.category = &quot;&lt;mus&gt;&quot;
+      assert_dom_equal(
+        &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;abe\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot; selected=\&quot;selected\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
+        select(&quot;post&quot;, &quot;category&quot;, %w( abe &lt;mus&gt; hest), :prompt =&gt; true)
+      )
+    end
 
-  def test_select_with_given_prompt
-    @post = Post.new
-    @post.category = &quot;&quot;
-    assert_dom_equal(
-      &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;\&quot;&gt;The prompt&lt;/option&gt;\n&lt;option value=\&quot;abe\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
-      select(&quot;post&quot;, &quot;category&quot;, %w( abe &lt;mus&gt; hest), :prompt =&gt; 'The prompt')
-    )
-  end
+    def test_select_with_given_prompt
+      @post = Post.new
+      @post.category = &quot;&quot;
+      assert_dom_equal(
+        &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;\&quot;&gt;The prompt&lt;/option&gt;\n&lt;option value=\&quot;abe\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
+        select(&quot;post&quot;, &quot;category&quot;, %w( abe &lt;mus&gt; hest), :prompt =&gt; 'The prompt')
+      )
+    end
 
-  def test_select_with_prompt_and_blank
-    @post = Post.new
-    @post.category = &quot;&quot;
-    assert_dom_equal(
-      &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;\&quot;&gt;Please select&lt;/option&gt;\n&lt;option value=\&quot;\&quot;&gt;&lt;/option&gt;\n&lt;option value=\&quot;abe\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
-      select(&quot;post&quot;, &quot;category&quot;, %w( abe &lt;mus&gt; hest), :prompt =&gt; true, :include_blank =&gt; true)
-    )
-  end
+    def test_select_with_prompt_and_blank
+      @post = Post.new
+      @post.category = &quot;&quot;
+      assert_dom_equal(
+        &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;\&quot;&gt;Please select&lt;/option&gt;\n&lt;option value=\&quot;\&quot;&gt;&lt;/option&gt;\n&lt;option value=\&quot;abe\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
+        select(&quot;post&quot;, &quot;category&quot;, %w( abe &lt;mus&gt; hest), :prompt =&gt; true, :include_blank =&gt; true)
+      )
+    end
 
-  def test_select_with_selected_value
-    @post = Post.new
-    @post.category = &quot;&lt;mus&gt;&quot;
-    assert_dom_equal(
-      &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;abe\&quot; selected=\&quot;selected\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
-      select(&quot;post&quot;, &quot;category&quot;, %w( abe &lt;mus&gt; hest ), :selected =&gt; 'abe')
-    )
-  end
-  
-  def test_select_with_index_option
-    @album = Album.new
-    @album.id = 1
+    def test_select_with_selected_value
+      @post = Post.new
+      @post.category = &quot;&lt;mus&gt;&quot;
+      assert_dom_equal(
+        &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;abe\&quot; selected=\&quot;selected\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
+        select(&quot;post&quot;, &quot;category&quot;, %w( abe &lt;mus&gt; hest ), :selected =&gt; 'abe')
+      )
+    end
     
-    expected = &quot;&lt;select id=\&quot;album__genre\&quot; name=\&quot;album[][genre]\&quot;&gt;&lt;option value=\&quot;rap\&quot;&gt;rap&lt;/option&gt;\n&lt;option value=\&quot;rock\&quot;&gt;rock&lt;/option&gt;\n&lt;option value=\&quot;country\&quot;&gt;country&lt;/option&gt;&lt;/select&gt;&quot;    
+    def test_select_with_index_option
+      @album = Album.new
+      @album.id = 1
 
-    assert_dom_equal(
-      expected, 
-      select(&quot;album[]&quot;, &quot;genre&quot;, %w[rap rock country], {}, { :index =&gt; nil })
-    )
-  end
+      expected = &quot;&lt;select id=\&quot;album__genre\&quot; name=\&quot;album[][genre]\&quot;&gt;&lt;option value=\&quot;rap\&quot;&gt;rap&lt;/option&gt;\n&lt;option value=\&quot;rock\&quot;&gt;rock&lt;/option&gt;\n&lt;option value=\&quot;country\&quot;&gt;country&lt;/option&gt;&lt;/select&gt;&quot;
 
-  def test_select_with_selected_nil
-    @post = Post.new
-    @post.category = &quot;&lt;mus&gt;&quot;
-    assert_dom_equal(
-      &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;abe\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
-      select(&quot;post&quot;, &quot;category&quot;, %w( abe &lt;mus&gt; hest ), :selected =&gt; nil)
-    )
-  end
+      assert_dom_equal(
+        expected,
+        select(&quot;album[]&quot;, &quot;genre&quot;, %w[rap rock country], {}, { :index =&gt; nil })
+      )
+    end
 
-  def test_collection_select
-    @posts = [
-      Post.new(&quot;&lt;Abe&gt; went home&quot;, &quot;&lt;Abe&gt;&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
-      Post.new(&quot;Babe went home&quot;, &quot;Babe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
-      Post.new(&quot;Cabe went home&quot;, &quot;Cabe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;)
-    ]
+    def test_select_with_selected_nil
+      @post = Post.new
+      @post.category = &quot;&lt;mus&gt;&quot;
+      assert_dom_equal(
+        &quot;&lt;select id=\&quot;post_category\&quot; name=\&quot;post[category]\&quot;&gt;&lt;option value=\&quot;abe\&quot;&gt;abe&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;mus&amp;gt;\&quot;&gt;&amp;lt;mus&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;hest\&quot;&gt;hest&lt;/option&gt;&lt;/select&gt;&quot;,
+        select(&quot;post&quot;, &quot;category&quot;, %w( abe &lt;mus&gt; hest ), :selected =&gt; nil)
+      )
+    end
 
-    @post = Post.new
-    @post.author_name = &quot;Babe&quot;
+    def test_collection_select
+      @posts = [
+        Post.new(&quot;&lt;Abe&gt; went home&quot;, &quot;&lt;Abe&gt;&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
+        Post.new(&quot;Babe went home&quot;, &quot;Babe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
+        Post.new(&quot;Cabe went home&quot;, &quot;Cabe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;)
+      ]
 
-    assert_dom_equal(
-      &quot;&lt;select id=\&quot;post_author_name\&quot; name=\&quot;post[author_name]\&quot;&gt;&lt;option value=\&quot;&amp;lt;Abe&amp;gt;\&quot;&gt;&amp;lt;Abe&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Babe\&quot; selected=\&quot;selected\&quot;&gt;Babe&lt;/option&gt;\n&lt;option value=\&quot;Cabe\&quot;&gt;Cabe&lt;/option&gt;&lt;/select&gt;&quot;,
-      collection_select(&quot;post&quot;, &quot;author_name&quot;, @posts, &quot;author_name&quot;, &quot;author_name&quot;)
-    )
-  end
+      @post = Post.new
+      @post.author_name = &quot;Babe&quot;
 
-  def test_collection_select_under_fields_for
-    @posts = [
-      Post.new(&quot;&lt;Abe&gt; went home&quot;, &quot;&lt;Abe&gt;&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
-      Post.new(&quot;Babe went home&quot;, &quot;Babe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
-      Post.new(&quot;Cabe went home&quot;, &quot;Cabe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;)
-    ]
+      assert_dom_equal(
+        &quot;&lt;select id=\&quot;post_author_name\&quot; name=\&quot;post[author_name]\&quot;&gt;&lt;option value=\&quot;&amp;lt;Abe&amp;gt;\&quot;&gt;&amp;lt;Abe&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Babe\&quot; selected=\&quot;selected\&quot;&gt;Babe&lt;/option&gt;\n&lt;option value=\&quot;Cabe\&quot;&gt;Cabe&lt;/option&gt;&lt;/select&gt;&quot;,
+        collection_select(&quot;post&quot;, &quot;author_name&quot;, @posts, &quot;author_name&quot;, &quot;author_name&quot;)
+      )
+    end
 
-    @post = Post.new
-    @post.author_name = &quot;Babe&quot;
-    
-    _erbout = ''
-    
-    fields_for :post, @post do |f|
-      _erbout.concat f.collection_select(:author_name, @posts, :author_name, :author_name)
+    def test_collection_select_under_fields_for
+      @posts = [
+        Post.new(&quot;&lt;Abe&gt; went home&quot;, &quot;&lt;Abe&gt;&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
+        Post.new(&quot;Babe went home&quot;, &quot;Babe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
+        Post.new(&quot;Cabe went home&quot;, &quot;Cabe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;)
+      ]
+
+      @post = Post.new
+      @post.author_name = &quot;Babe&quot;
+
+      _erbout = ''
+
+      fields_for :post, @post do |f|
+        _erbout.concat f.collection_select(:author_name, @posts, :author_name, :author_name)
+      end
+
+      assert_dom_equal(
+        &quot;&lt;select id=\&quot;post_author_name\&quot; name=\&quot;post[author_name]\&quot;&gt;&lt;option value=\&quot;&amp;lt;Abe&amp;gt;\&quot;&gt;&amp;lt;Abe&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Babe\&quot; selected=\&quot;selected\&quot;&gt;Babe&lt;/option&gt;\n&lt;option value=\&quot;Cabe\&quot;&gt;Cabe&lt;/option&gt;&lt;/select&gt;&quot;,
+        _erbout
+      )
     end
-    
-    assert_dom_equal(
-      &quot;&lt;select id=\&quot;post_author_name\&quot; name=\&quot;post[author_name]\&quot;&gt;&lt;option value=\&quot;&amp;lt;Abe&amp;gt;\&quot;&gt;&amp;lt;Abe&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Babe\&quot; selected=\&quot;selected\&quot;&gt;Babe&lt;/option&gt;\n&lt;option value=\&quot;Cabe\&quot;&gt;Cabe&lt;/option&gt;&lt;/select&gt;&quot;,
-      _erbout
-    )
-  end
 
-  def test_collection_select_with_blank_and_style
-    @posts = [
-      Post.new(&quot;&lt;Abe&gt; went home&quot;, &quot;&lt;Abe&gt;&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
-      Post.new(&quot;Babe went home&quot;, &quot;Babe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
-      Post.new(&quot;Cabe went home&quot;, &quot;Cabe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;)
-    ]
+    def test_collection_select_with_blank_and_style
+      @posts = [
+        Post.new(&quot;&lt;Abe&gt; went home&quot;, &quot;&lt;Abe&gt;&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
+        Post.new(&quot;Babe went home&quot;, &quot;Babe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
+        Post.new(&quot;Cabe went home&quot;, &quot;Cabe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;)
+      ]
 
-    @post = Post.new
-    @post.author_name = &quot;Babe&quot;
+      @post = Post.new
+      @post.author_name = &quot;Babe&quot;
 
-    assert_dom_equal(
-      &quot;&lt;select id=\&quot;post_author_name\&quot; name=\&quot;post[author_name]\&quot; style=\&quot;width: 200px\&quot;&gt;&lt;option value=\&quot;\&quot;&gt;&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;Abe&amp;gt;\&quot;&gt;&amp;lt;Abe&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Babe\&quot; selected=\&quot;selected\&quot;&gt;Babe&lt;/option&gt;\n&lt;option value=\&quot;Cabe\&quot;&gt;Cabe&lt;/option&gt;&lt;/select&gt;&quot;,
-      collection_select(&quot;post&quot;, &quot;author_name&quot;, @posts, &quot;author_name&quot;, &quot;author_name&quot;, { :include_blank =&gt; true }, &quot;style&quot; =&gt; &quot;width: 200px&quot;)
-    )
-  end
+      assert_dom_equal(
+        &quot;&lt;select id=\&quot;post_author_name\&quot; name=\&quot;post[author_name]\&quot; style=\&quot;width: 200px\&quot;&gt;&lt;option value=\&quot;\&quot;&gt;&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;Abe&amp;gt;\&quot;&gt;&amp;lt;Abe&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Babe\&quot; selected=\&quot;selected\&quot;&gt;Babe&lt;/option&gt;\n&lt;option value=\&quot;Cabe\&quot;&gt;Cabe&lt;/option&gt;&lt;/select&gt;&quot;,
+        collection_select(&quot;post&quot;, &quot;author_name&quot;, @posts, &quot;author_name&quot;, &quot;author_name&quot;, { :include_blank =&gt; true }, &quot;style&quot; =&gt; &quot;width: 200px&quot;)
+      )
+    end
 
-  def test_collection_select_with_blank_as_string_and_style
-    @posts = [
-      Post.new(&quot;&lt;Abe&gt; went home&quot;, &quot;&lt;Abe&gt;&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
-      Post.new(&quot;Babe went home&quot;, &quot;Babe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
-      Post.new(&quot;Cabe went home&quot;, &quot;Cabe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;)
-    ]
+    def test_collection_select_with_blank_as_string_and_style
+      @posts = [
+        Post.new(&quot;&lt;Abe&gt; went home&quot;, &quot;&lt;Abe&gt;&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
+        Post.new(&quot;Babe went home&quot;, &quot;Babe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
+        Post.new(&quot;Cabe went home&quot;, &quot;Cabe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;)
+      ]
 
-    @post = Post.new
-    @post.author_name = &quot;Babe&quot;
+      @post = Post.new
+      @post.author_name = &quot;Babe&quot;
 
-    assert_dom_equal(
-      &quot;&lt;select id=\&quot;post_author_name\&quot; name=\&quot;post[author_name]\&quot; style=\&quot;width: 200px\&quot;&gt;&lt;option value=\&quot;\&quot;&gt;No Selection&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;Abe&amp;gt;\&quot;&gt;&amp;lt;Abe&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Babe\&quot; selected=\&quot;selected\&quot;&gt;Babe&lt;/option&gt;\n&lt;option value=\&quot;Cabe\&quot;&gt;Cabe&lt;/option&gt;&lt;/select&gt;&quot;,
-      collection_select(&quot;post&quot;, &quot;author_name&quot;, @posts, &quot;author_name&quot;, &quot;author_name&quot;, { :include_blank =&gt; 'No Selection' }, &quot;style&quot; =&gt; &quot;width: 200px&quot;)
-    )
-  end
+      assert_dom_equal(
+        &quot;&lt;select id=\&quot;post_author_name\&quot; name=\&quot;post[author_name]\&quot; style=\&quot;width: 200px\&quot;&gt;&lt;option value=\&quot;\&quot;&gt;No Selection&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;Abe&amp;gt;\&quot;&gt;&amp;lt;Abe&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Babe\&quot; selected=\&quot;selected\&quot;&gt;Babe&lt;/option&gt;\n&lt;option value=\&quot;Cabe\&quot;&gt;Cabe&lt;/option&gt;&lt;/select&gt;&quot;,
+        collection_select(&quot;post&quot;, &quot;author_name&quot;, @posts, &quot;author_name&quot;, &quot;author_name&quot;, { :include_blank =&gt; 'No Selection' }, &quot;style&quot; =&gt; &quot;width: 200px&quot;)
+      )
+    end
 
-  def test_collection_select_with_multiple_option_appends_array_brackets
-    @posts = [
-      Post.new(&quot;&lt;Abe&gt; went home&quot;, &quot;&lt;Abe&gt;&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
-      Post.new(&quot;Babe went home&quot;, &quot;Babe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
-      Post.new(&quot;Cabe went home&quot;, &quot;Cabe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;)
-    ]
+    def test_collection_select_with_multiple_option_appends_array_brackets
+      @posts = [
+        Post.new(&quot;&lt;Abe&gt; went home&quot;, &quot;&lt;Abe&gt;&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
+        Post.new(&quot;Babe went home&quot;, &quot;Babe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;),
+        Post.new(&quot;Cabe went home&quot;, &quot;Cabe&quot;, &quot;To a little house&quot;, &quot;shh!&quot;)
+      ]
 
-    @post = Post.new
-    @post.author_name = &quot;Babe&quot;
+      @post = Post.new
+      @post.author_name = &quot;Babe&quot;
 
-    expected = &quot;&lt;select id=\&quot;post_author_name\&quot; name=\&quot;post[author_name][]\&quot; multiple=\&quot;multiple\&quot;&gt;&lt;option value=\&quot;\&quot;&gt;&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;Abe&amp;gt;\&quot;&gt;&amp;lt;Abe&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Babe\&quot; selected=\&quot;selected\&quot;&gt;Babe&lt;/option&gt;\n&lt;option value=\&quot;Cabe\&quot;&gt;Cabe&lt;/option&gt;&lt;/select&gt;&quot;
+      expected = &quot;&lt;select id=\&quot;post_author_name\&quot; name=\&quot;post[author_name][]\&quot; multiple=\&quot;multiple\&quot;&gt;&lt;option value=\&quot;\&quot;&gt;&lt;/option&gt;\n&lt;option value=\&quot;&amp;lt;Abe&amp;gt;\&quot;&gt;&amp;lt;Abe&amp;gt;&lt;/option&gt;\n&lt;option value=\&quot;Babe\&quot; selected=\&quot;selected\&quot;&gt;Babe&lt;/option&gt;\n&lt;option value=\&quot;Cabe\&quot;&gt;Cabe&lt;/option&gt;&lt;/select&gt;&quot;
 
-    # Should suffix default name with [].
-    assert_dom_equal expected, collection_select(&quot;post&quot;, &quot;author_name&quot;, @posts, &quot;author_name&quot;, &quot;author_name&quot;, { :include_blank =&gt; true }, :multiple =&gt; true)
+      # Should suffix default name with [].
+      assert_dom_equal expected, collection_select(&quot;post&quot;, &quot;author_name&quot;, @posts, &quot;author_name&quot;, &quot;author_name&quot;, { :include_blank =&gt; true }, :multiple =&gt; true)
 
-    # Shouldn't suffix custom name with [].
-    assert_dom_equal expected, collection_select(&quot;post&quot;, &quot;author_name&quot;, @posts, &quot;author_name&quot;, &quot;author_name&quot;, { :include_blank =&gt; true, :name =&gt; 'post[author_name][]' }, :multiple =&gt; true)
-  end
+      # Shouldn't suffix custom name with [].
+      assert_dom_equal expected, collection_select(&quot;post&quot;, &quot;author_name&quot;, @posts, &quot;author_name&quot;, &quot;author_name&quot;, { :include_blank =&gt; true, :name =&gt; 'post[author_name][]' }, :multiple =&gt; true)
+    end
 
-  def test_country_select
-    @post = Post.new
-    @post.origin = &quot;Denmark&quot;
-    expected_select = &lt;&lt;-COUNTRIES
+    def test_country_select
+      @post = Post.new
+      @post.origin = &quot;Denmark&quot;
+      expected_select = &lt;&lt;-COUNTRIES
 &lt;select id=&quot;post_origin&quot; name=&quot;post[origin]&quot;&gt;&lt;option value=&quot;Afghanistan&quot;&gt;Afghanistan&lt;/option&gt;
 &lt;option value=&quot;Aland Islands&quot;&gt;Aland Islands&lt;/option&gt;
 &lt;option value=&quot;Albania&quot;&gt;Albania&lt;/option&gt;
@@ -665,14 +655,14 @@ class FormOptionsHelperTest &lt; ActionView::TestCase
 &lt;option value=&quot;Yemen&quot;&gt;Yemen&lt;/option&gt;
 &lt;option value=&quot;Zambia&quot;&gt;Zambia&lt;/option&gt;
 &lt;option value=&quot;Zimbabwe&quot;&gt;Zimbabwe&lt;/option&gt;&lt;/select&gt;
-COUNTRIES
-    assert_dom_equal(expected_select[0..-2], country_select(&quot;post&quot;, &quot;origin&quot;))
-  end
+  COUNTRIES
+      assert_dom_equal(expected_select[0..-2], country_select(&quot;post&quot;, &quot;origin&quot;))
+    end
 
-  def test_country_select_with_priority_countries
-    @post = Post.new
-    @post.origin = &quot;Denmark&quot;
-    expected_select = &lt;&lt;-COUNTRIES
+    def test_country_select_with_priority_countries
+      @post = Post.new
+      @post.origin = &quot;Denmark&quot;
+      expected_select = &lt;&lt;-COUNTRIES
 &lt;select id=&quot;post_origin&quot; name=&quot;post[origin]&quot;&gt;&lt;option value=&quot;New Zealand&quot;&gt;New Zealand&lt;/option&gt;
 &lt;option value=&quot;Nicaragua&quot;&gt;Nicaragua&lt;/option&gt;&lt;option value=&quot;&quot; disabled=&quot;disabled&quot;&gt;-------------&lt;/option&gt;
 &lt;option value=&quot;Afghanistan&quot;&gt;Afghanistan&lt;/option&gt;
@@ -920,14 +910,14 @@ COUNTRIES
 &lt;option value=&quot;Yemen&quot;&gt;Yemen&lt;/option&gt;
 &lt;option value=&quot;Zambia&quot;&gt;Zambia&lt;/option&gt;
 &lt;option value=&quot;Zimbabwe&quot;&gt;Zimbabwe&lt;/option&gt;&lt;/select&gt;
-COUNTRIES
-    assert_dom_equal(expected_select[0..-2], country_select(&quot;post&quot;, &quot;origin&quot;, [&quot;New Zealand&quot;, &quot;Nicaragua&quot;]))
-  end
+  COUNTRIES
+      assert_dom_equal(expected_select[0..-2], country_select(&quot;post&quot;, &quot;origin&quot;, [&quot;New Zealand&quot;, &quot;Nicaragua&quot;]))
+    end
 
-  def test_country_select_with_selected_priority_country
-    @post = Post.new
-    @post.origin = &quot;New Zealand&quot;
-    expected_select = &lt;&lt;-COUNTRIES
+    def test_country_select_with_selected_priority_country
+      @post = Post.new
+      @post.origin = &quot;New Zealand&quot;
+      expected_select = &lt;&lt;-COUNTRIES
 &lt;select id=&quot;post_origin&quot; name=&quot;post[origin]&quot;&gt;&lt;option selected=&quot;selected&quot; value=&quot;New Zealand&quot;&gt;New Zealand&lt;/option&gt;
 &lt;option value=&quot;Nicaragua&quot;&gt;Nicaragua&lt;/option&gt;&lt;option value=&quot;&quot; disabled=&quot;disabled&quot;&gt;-------------&lt;/option&gt;
 &lt;option value=&quot;Afghanistan&quot;&gt;Afghanistan&lt;/option&gt;
@@ -1175,162 +1165,163 @@ COUNTRIES
 &lt;option value=&quot;Yemen&quot;&gt;Yemen&lt;/option&gt;
 &lt;option value=&quot;Zambia&quot;&gt;Zambia&lt;/option&gt;
 &lt;option value=&quot;Zimbabwe&quot;&gt;Zimbabwe&lt;/option&gt;&lt;/select&gt;
-COUNTRIES
-    assert_dom_equal(expected_select[0..-2], country_select(&quot;post&quot;, &quot;origin&quot;, [&quot;New Zealand&quot;, &quot;Nicaragua&quot;]))
-  end
-
-  def test_time_zone_select
-    @firm = Firm.new(&quot;D&quot;)
-    html = time_zone_select( &quot;firm&quot;, &quot;time_zone&quot; )
-    assert_dom_equal &quot;&lt;select id=\&quot;firm_time_zone\&quot; name=\&quot;firm[time_zone]\&quot;&gt;&quot; +
-                 &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
-                 &quot;&lt;/select&gt;&quot;,
-                 html
-  end
+  COUNTRIES
+      assert_dom_equal(expected_select[0..-2], country_select(&quot;post&quot;, &quot;origin&quot;, [&quot;New Zealand&quot;, &quot;Nicaragua&quot;]))
+    end
 
-  def test_time_zone_select_under_fields_for
-    @firm = Firm.new(&quot;D&quot;)
-    
-    _erbout = ''
-    
-    fields_for :firm, @firm do |f|
-      _erbout.concat f.time_zone_select(:time_zone)
+    def test_time_zone_select
+      @firm = Firm.new(&quot;D&quot;)
+      html = time_zone_select( &quot;firm&quot;, &quot;time_zone&quot; )
+      assert_dom_equal &quot;&lt;select id=\&quot;firm_time_zone\&quot; name=\&quot;firm[time_zone]\&quot;&gt;&quot; +
+                  &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
+                  &quot;&lt;/select&gt;&quot;,
+                  html
     end
-    
-    assert_dom_equal(
-      &quot;&lt;select id=\&quot;firm_time_zone\&quot; name=\&quot;firm[time_zone]\&quot;&gt;&quot; +
-      &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
-      &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
-      &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
-      &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;\n&quot; +
-      &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
-      &quot;&lt;/select&gt;&quot;,
-      _erbout
-    )
-  end
 
-  def test_time_zone_select_with_blank
-    @firm = Firm.new(&quot;D&quot;)
-    html = time_zone_select(&quot;firm&quot;, &quot;time_zone&quot;, nil, :include_blank =&gt; true)
-    assert_dom_equal &quot;&lt;select id=\&quot;firm_time_zone\&quot; name=\&quot;firm[time_zone]\&quot;&gt;&quot; +
-                 &quot;&lt;option value=\&quot;\&quot;&gt;&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
-                 &quot;&lt;/select&gt;&quot;,
-                 html
-  end
+    def test_time_zone_select_under_fields_for
+      @firm = Firm.new(&quot;D&quot;)
 
-  def test_time_zone_select_with_blank_as_string
-    @firm = Firm.new(&quot;D&quot;)
-    html = time_zone_select(&quot;firm&quot;, &quot;time_zone&quot;, nil, :include_blank =&gt; 'No Zone')
-    assert_dom_equal &quot;&lt;select id=\&quot;firm_time_zone\&quot; name=\&quot;firm[time_zone]\&quot;&gt;&quot; +
-                 &quot;&lt;option value=\&quot;\&quot;&gt;No Zone&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
-                 &quot;&lt;/select&gt;&quot;,
-                 html
-  end
+      _erbout = ''
 
-  def test_time_zone_select_with_style
-    @firm = Firm.new(&quot;D&quot;)
-    html = time_zone_select(&quot;firm&quot;, &quot;time_zone&quot;, nil, {},
-      &quot;style&quot; =&gt; &quot;color: red&quot;)
-    assert_dom_equal &quot;&lt;select id=\&quot;firm_time_zone\&quot; name=\&quot;firm[time_zone]\&quot; style=\&quot;color: red\&quot;&gt;&quot; +
-                 &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
-                 &quot;&lt;/select&gt;&quot;,
-                 html
-    assert_dom_equal html, time_zone_select(&quot;firm&quot;, &quot;time_zone&quot;, nil, {},
-      :style =&gt; &quot;color: red&quot;)
-  end
-
-  def test_time_zone_select_with_blank_and_style
-    @firm = Firm.new(&quot;D&quot;)
-    html = time_zone_select(&quot;firm&quot;, &quot;time_zone&quot;, nil,
-      { :include_blank =&gt; true }, &quot;style&quot; =&gt; &quot;color: red&quot;)
-    assert_dom_equal &quot;&lt;select id=\&quot;firm_time_zone\&quot; name=\&quot;firm[time_zone]\&quot; style=\&quot;color: red\&quot;&gt;&quot; +
-                 &quot;&lt;option value=\&quot;\&quot;&gt;&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
-                 &quot;&lt;/select&gt;&quot;,
-                 html
-    assert_dom_equal html, time_zone_select(&quot;firm&quot;, &quot;time_zone&quot;, nil,
-      { :include_blank =&gt; true }, :style =&gt; &quot;color: red&quot;)
-  end
+      fields_for :firm, @firm do |f|
+        _erbout.concat f.time_zone_select(:time_zone)
+      end
 
-  def test_time_zone_select_with_blank_as_string_and_style
-    @firm = Firm.new(&quot;D&quot;)
-    html = time_zone_select(&quot;firm&quot;, &quot;time_zone&quot;, nil,
-      { :include_blank =&gt; 'No Zone' }, &quot;style&quot; =&gt; &quot;color: red&quot;)
-    assert_dom_equal &quot;&lt;select id=\&quot;firm_time_zone\&quot; name=\&quot;firm[time_zone]\&quot; style=\&quot;color: red\&quot;&gt;&quot; +
-                 &quot;&lt;option value=\&quot;\&quot;&gt;No Zone&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
-                 &quot;&lt;/select&gt;&quot;,
-                 html
-    assert_dom_equal html, time_zone_select(&quot;firm&quot;, &quot;time_zone&quot;, nil,
-      { :include_blank =&gt; 'No Zone' }, :style =&gt; &quot;color: red&quot;)
-  end
+      assert_dom_equal(
+        &quot;&lt;select id=\&quot;firm_time_zone\&quot; name=\&quot;firm[time_zone]\&quot;&gt;&quot; +
+        &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
+        &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
+        &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
+        &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;\n&quot; +
+        &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
+        &quot;&lt;/select&gt;&quot;,
+        _erbout
+      )
+    end
 
-  def test_time_zone_select_with_priority_zones
-    @firm = Firm.new(&quot;D&quot;)
-    zones = [ TimeZone.new(&quot;A&quot;), TimeZone.new(&quot;D&quot;) ]
-    html = time_zone_select(&quot;firm&quot;, &quot;time_zone&quot;, zones )
-    assert_dom_equal &quot;&lt;select id=\&quot;firm_time_zone\&quot; name=\&quot;firm[time_zone]\&quot;&gt;&quot; +
-                 &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;&quot; +
-                 &quot;&lt;option value=\&quot;\&quot; disabled=\&quot;disabled\&quot;&gt;-------------&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
-                 &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
-                 &quot;&lt;/select&gt;&quot;,
-                 html
-  end
+    def test_time_zone_select_with_blank
+      @firm = Firm.new(&quot;D&quot;)
+      html = time_zone_select(&quot;firm&quot;, &quot;time_zone&quot;, nil, :include_blank =&gt; true)
+      assert_dom_equal &quot;&lt;select id=\&quot;firm_time_zone\&quot; name=\&quot;firm[time_zone]\&quot;&gt;&quot; +
+                  &quot;&lt;option value=\&quot;\&quot;&gt;&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
+                  &quot;&lt;/select&gt;&quot;,
+                  html
+    end
 
-  def test_time_zone_select_with_default_time_zone_and_nil_value
-     @firm = Firm.new()
-     @firm.time_zone = nil
-      html = time_zone_select( &quot;firm&quot;, &quot;time_zone&quot;, nil, :default =&gt; 'B' )
+    def test_time_zone_select_with_blank_as_string
+      @firm = Firm.new(&quot;D&quot;)
+      html = time_zone_select(&quot;firm&quot;, &quot;time_zone&quot;, nil, :include_blank =&gt; 'No Zone')
       assert_dom_equal &quot;&lt;select id=\&quot;firm_time_zone\&quot; name=\&quot;firm[time_zone]\&quot;&gt;&quot; +
-                   &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
-                   &quot;&lt;option value=\&quot;B\&quot; selected=\&quot;selected\&quot;&gt;B&lt;/option&gt;\n&quot; +
-                   &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
-                   &quot;&lt;option value=\&quot;D\&quot;&gt;D&lt;/option&gt;\n&quot; +
-                   &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
-                   &quot;&lt;/select&gt;&quot;,
-                   html
-  end
+                  &quot;&lt;option value=\&quot;\&quot;&gt;No Zone&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
+                  &quot;&lt;/select&gt;&quot;,
+                  html
+    end
 
-  def test_time_zone_select_with_default_time_zone_and_value
-     @firm = Firm.new('D')
-      html = time_zone_select( &quot;firm&quot;, &quot;time_zone&quot;, nil, :default =&gt; 'B' )
+    def test_time_zone_select_with_style
+      @firm = Firm.new(&quot;D&quot;)
+      html = time_zone_select(&quot;firm&quot;, &quot;time_zone&quot;, nil, {},
+        &quot;style&quot; =&gt; &quot;color: red&quot;)
+      assert_dom_equal &quot;&lt;select id=\&quot;firm_time_zone\&quot; name=\&quot;firm[time_zone]\&quot; style=\&quot;color: red\&quot;&gt;&quot; +
+                  &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
+                  &quot;&lt;/select&gt;&quot;,
+                  html
+      assert_dom_equal html, time_zone_select(&quot;firm&quot;, &quot;time_zone&quot;, nil, {},
+        :style =&gt; &quot;color: red&quot;)
+    end
+
+    def test_time_zone_select_with_blank_and_style
+      @firm = Firm.new(&quot;D&quot;)
+      html = time_zone_select(&quot;firm&quot;, &quot;time_zone&quot;, nil,
+        { :include_blank =&gt; true }, &quot;style&quot; =&gt; &quot;color: red&quot;)
+      assert_dom_equal &quot;&lt;select id=\&quot;firm_time_zone\&quot; name=\&quot;firm[time_zone]\&quot; style=\&quot;color: red\&quot;&gt;&quot; +
+                  &quot;&lt;option value=\&quot;\&quot;&gt;&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
+                  &quot;&lt;/select&gt;&quot;,
+                  html
+      assert_dom_equal html, time_zone_select(&quot;firm&quot;, &quot;time_zone&quot;, nil,
+        { :include_blank =&gt; true }, :style =&gt; &quot;color: red&quot;)
+    end
+
+    def test_time_zone_select_with_blank_as_string_and_style
+      @firm = Firm.new(&quot;D&quot;)
+      html = time_zone_select(&quot;firm&quot;, &quot;time_zone&quot;, nil,
+        { :include_blank =&gt; 'No Zone' }, &quot;style&quot; =&gt; &quot;color: red&quot;)
+      assert_dom_equal &quot;&lt;select id=\&quot;firm_time_zone\&quot; name=\&quot;firm[time_zone]\&quot; style=\&quot;color: red\&quot;&gt;&quot; +
+                  &quot;&lt;option value=\&quot;\&quot;&gt;No Zone&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
+                  &quot;&lt;/select&gt;&quot;,
+                  html
+      assert_dom_equal html, time_zone_select(&quot;firm&quot;, &quot;time_zone&quot;, nil,
+        { :include_blank =&gt; 'No Zone' }, :style =&gt; &quot;color: red&quot;)
+    end
+
+    def test_time_zone_select_with_priority_zones
+      @firm = Firm.new(&quot;D&quot;)
+      zones = [ ActiveSupport::TimeZone.new(&quot;A&quot;), ActiveSupport::TimeZone.new(&quot;D&quot;) ]
+      html = time_zone_select(&quot;firm&quot;, &quot;time_zone&quot;, zones )
       assert_dom_equal &quot;&lt;select id=\&quot;firm_time_zone\&quot; name=\&quot;firm[time_zone]\&quot;&gt;&quot; +
-                   &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
-                   &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
-                   &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
-                   &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;\n&quot; +
-                   &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
-                   &quot;&lt;/select&gt;&quot;,
-                   html
-  end
+                  &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;&quot; +
+                  &quot;&lt;option value=\&quot;\&quot; disabled=\&quot;disabled\&quot;&gt;-------------&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
+                  &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
+                  &quot;&lt;/select&gt;&quot;,
+                  html
+    end
+
+    def test_time_zone_select_with_default_time_zone_and_nil_value
+      @firm = Firm.new()
+      @firm.time_zone = nil
+        html = time_zone_select( &quot;firm&quot;, &quot;time_zone&quot;, nil, :default =&gt; 'B' )
+        assert_dom_equal &quot;&lt;select id=\&quot;firm_time_zone\&quot; name=\&quot;firm[time_zone]\&quot;&gt;&quot; +
+                    &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
+                    &quot;&lt;option value=\&quot;B\&quot; selected=\&quot;selected\&quot;&gt;B&lt;/option&gt;\n&quot; +
+                    &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
+                    &quot;&lt;option value=\&quot;D\&quot;&gt;D&lt;/option&gt;\n&quot; +
+                    &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
+                    &quot;&lt;/select&gt;&quot;,
+                    html
+    end
 
+    def test_time_zone_select_with_default_time_zone_and_value
+      @firm = Firm.new('D')
+        html = time_zone_select( &quot;firm&quot;, &quot;time_zone&quot;, nil, :default =&gt; 'B' )
+        assert_dom_equal &quot;&lt;select id=\&quot;firm_time_zone\&quot; name=\&quot;firm[time_zone]\&quot;&gt;&quot; +
+                    &quot;&lt;option value=\&quot;A\&quot;&gt;A&lt;/option&gt;\n&quot; +
+                    &quot;&lt;option value=\&quot;B\&quot;&gt;B&lt;/option&gt;\n&quot; +
+                    &quot;&lt;option value=\&quot;C\&quot;&gt;C&lt;/option&gt;\n&quot; +
+                    &quot;&lt;option value=\&quot;D\&quot; selected=\&quot;selected\&quot;&gt;D&lt;/option&gt;\n&quot; +
+                    &quot;&lt;option value=\&quot;E\&quot;&gt;E&lt;/option&gt;&quot; +
+                    &quot;&lt;/select&gt;&quot;,
+                    html
+    end
+
+  end
 end</diff>
      <filename>vendor/rails/actionpack/test/template/form_options_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -190,6 +190,12 @@ class FormTagHelperTest &lt; ActionView::TestCase
     assert_dom_equal expected, actual
   end
 
+  def test_label_tag_with_symbol
+    actual = label_tag :title
+    expected = %(&lt;label for=&quot;title&quot;&gt;Title&lt;/label&gt;)
+    assert_dom_equal expected, actual
+  end
+
   def test_label_tag_with_text
     actual = label_tag &quot;title&quot;, &quot;My Title&quot;
     expected = %(&lt;label for=&quot;title&quot;&gt;My Title&lt;/label&gt;)
@@ -222,6 +228,13 @@ class FormTagHelperTest &lt; ActionView::TestCase
     )
   end
 
+  def test_submit_tag_with_no_onclick_options
+    assert_dom_equal(
+      %(&lt;input name='commit' type='submit' value='Save' onclick=&quot;this.setAttribute('originalValue', this.value);this.disabled=true;this.value='Saving...';result = (this.form.onsubmit ? (this.form.onsubmit() ? this.form.submit() : false) : this.form.submit());if (result == false) { this.value = this.getAttribute('originalValue'); this.disabled = false };return result;&quot; /&gt;),
+      submit_tag(&quot;Save&quot;, :disable_with =&gt; &quot;Saving...&quot;)
+    )
+  end
+
   def test_submit_tag_with_confirmation
     assert_dom_equal(
       %(&lt;input name='commit' type='submit' value='Save' onclick=&quot;return confirm('Are you sure?');&quot;/&gt;),</diff>
      <filename>vendor/rails/actionpack/test/template/form_tag_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,11 +4,14 @@ class JavaScriptHelperTest &lt; ActionView::TestCase
   tests ActionView::Helpers::JavaScriptHelper
 
   def test_define_javascript_functions
-    # check if prototype.js is included first
-    assert_not_nil define_javascript_functions.split(&quot;\n&quot;)[1].match(/Prototype JavaScript framework/)
+    assert_deprecated(/javascript_include_tag/) do
+      # check if prototype.js is included first
+      src = define_javascript_functions
+      assert_not_nil src.split(&quot;\n&quot;)[1].match(/Prototype JavaScript framework/)
 
-    # check that scriptaculous.js is not in here, only needed if loaded remotely
-    assert_nil define_javascript_functions.split(&quot;\n&quot;)[1].match(/var Scriptaculous = \{/)
+      # check that scriptaculous.js is not in here, only needed if loaded remotely
+      assert_nil src.split(&quot;\n&quot;)[1].match(/var Scriptaculous = \{/)
+    end
   end
 
   def test_escape_javascript</diff>
      <filename>vendor/rails/actionpack/test/template/javascript_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -77,6 +77,10 @@ class PrototypeHelperTest &lt; PrototypeHelperBaseTest
       link_to_remote(&quot;Remote outauthor&quot;, :failure =&gt; &quot;alert(request.responseText)&quot;, :url =&gt; { :action =&gt; &quot;whatnot&quot;  })
     assert_dom_equal %(&lt;a href=\&quot;#\&quot; onclick=\&quot;new Ajax.Request('http://www.example.com/whatnot?a=10&amp;amp;b=20', {asynchronous:true, evalScripts:true, onFailure:function(request){alert(request.responseText)}}); return false;\&quot;&gt;Remote outauthor&lt;/a&gt;),
       link_to_remote(&quot;Remote outauthor&quot;, :failure =&gt; &quot;alert(request.responseText)&quot;, :url =&gt; { :action =&gt; &quot;whatnot&quot;, :a =&gt; '10', :b =&gt; '20' })
+    assert_dom_equal %(&lt;a href=\&quot;#\&quot; onclick=\&quot;new Ajax.Request('http://www.example.com/whatnot', {asynchronous:false, evalScripts:true}); return false;\&quot;&gt;Remote outauthor&lt;/a&gt;),
+      link_to_remote(&quot;Remote outauthor&quot;, :url =&gt; { :action =&gt; &quot;whatnot&quot; }, :type =&gt; :synchronous)
+    assert_dom_equal %(&lt;a href=\&quot;#\&quot; onclick=\&quot;new Ajax.Request('http://www.example.com/whatnot', {asynchronous:true, evalScripts:true, insertion:'bottom'}); return false;\&quot;&gt;Remote outauthor&lt;/a&gt;),
+      link_to_remote(&quot;Remote outauthor&quot;, :url =&gt; { :action =&gt; &quot;whatnot&quot; }, :position =&gt; :bottom)
   end
   
   def test_link_to_remote_html_options
@@ -288,13 +292,13 @@ class JavaScriptGeneratorTest &lt; PrototypeHelperBaseTest
   end
   
   def test_insert_html_with_string
-    assert_equal 'new Insertion.Top(&quot;element&quot;, &quot;\\u003Cp\\u003EThis is a test\\u003C/p\\u003E&quot;);',
+    assert_equal 'Element.insert(&quot;element&quot;, { top: &quot;\\u003Cp\\u003EThis is a test\\u003C/p\\u003E&quot; });',
       @generator.insert_html(:top, 'element', '&lt;p&gt;This is a test&lt;/p&gt;')
-    assert_equal 'new Insertion.Bottom(&quot;element&quot;, &quot;\\u003Cp\u003EThis is a test\\u003C/p\u003E&quot;);',
+    assert_equal 'Element.insert(&quot;element&quot;, { bottom: &quot;\\u003Cp\u003EThis is a test\\u003C/p\u003E&quot; });',
       @generator.insert_html(:bottom, 'element', '&lt;p&gt;This is a test&lt;/p&gt;')
-    assert_equal 'new Insertion.Before(&quot;element&quot;, &quot;\\u003Cp\u003EThis is a test\\u003C/p\u003E&quot;);',
+    assert_equal 'Element.insert(&quot;element&quot;, { before: &quot;\\u003Cp\u003EThis is a test\\u003C/p\u003E&quot; });',
       @generator.insert_html(:before, 'element', '&lt;p&gt;This is a test&lt;/p&gt;')
-    assert_equal 'new Insertion.After(&quot;element&quot;, &quot;\\u003Cp\u003EThis is a test\\u003C/p\u003E&quot;);',
+    assert_equal 'Element.insert(&quot;element&quot;, { after: &quot;\\u003Cp\u003EThis is a test\\u003C/p\u003E&quot; });',
       @generator.insert_html(:after, 'element', '&lt;p&gt;This is a test&lt;/p&gt;')
   end
   
@@ -362,8 +366,8 @@ class JavaScriptGeneratorTest &lt; PrototypeHelperBaseTest
     @generator.replace_html('baz', '&lt;p&gt;This is a test&lt;/p&gt;')
     
     assert_equal &lt;&lt;-EOS.chomp, @generator.to_s
-new Insertion.Top(&quot;element&quot;, &quot;\\u003Cp\\u003EThis is a test\\u003C/p\\u003E&quot;);
-new Insertion.Bottom(&quot;element&quot;, &quot;\\u003Cp\\u003EThis is a test\\u003C/p\\u003E&quot;);
+Element.insert(&quot;element&quot;, { top: &quot;\\u003Cp\\u003EThis is a test\\u003C/p\\u003E&quot; });
+Element.insert(&quot;element&quot;, { bottom: &quot;\\u003Cp\\u003EThis is a test\\u003C/p\\u003E&quot; });
 [&quot;foo&quot;, &quot;bar&quot;].each(Element.remove);
 Element.update(&quot;baz&quot;, &quot;\\u003Cp\\u003EThis is a test\\u003C/p\\u003E&quot;);
     EOS
@@ -425,6 +429,8 @@ Element.update(&quot;baz&quot;, &quot;\\u003Cp\\u003EThis is a test\\u003C/p\\u003E&quot;);
   def test_sortable
     assert_equal %(Sortable.create(&quot;blah&quot;, {onUpdate:function(){new Ajax.Request('http://www.example.com/order', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize(&quot;blah&quot;)})}});), 
       @generator.sortable('blah', :url =&gt; { :action =&gt; &quot;order&quot; })
+    assert_equal %(Sortable.create(&quot;blah&quot;, {onUpdate:function(){new Ajax.Request('http://www.example.com/order', {asynchronous:false, evalScripts:true, parameters:Sortable.serialize(&quot;blah&quot;)})}});),
+      @generator.sortable('blah', :url =&gt; { :action =&gt; &quot;order&quot; }, :type =&gt; :synchronous)
   end
   
   def test_draggable
@@ -435,6 +441,8 @@ Element.update(&quot;baz&quot;, &quot;\\u003Cp\\u003EThis is a test\\u003C/p\\u003E&quot;);
   def test_drop_receiving
     assert_equal %(Droppables.add(&quot;blah&quot;, {onDrop:function(element){new Ajax.Request('http://www.example.com/order', {asynchronous:true, evalScripts:true, parameters:'id=' + encodeURIComponent(element.id)})}});), 
       @generator.drop_receiving('blah', :url =&gt; { :action =&gt; &quot;order&quot; })
+    assert_equal %(Droppables.add(&quot;blah&quot;, {onDrop:function(element){new Ajax.Request('http://www.example.com/order', {asynchronous:false, evalScripts:true, parameters:'id=' + encodeURIComponent(element.id)})}});),
+      @generator.drop_receiving('blah', :url =&gt; { :action =&gt; &quot;order&quot; }, :type =&gt; :synchronous)
   end
 
   def test_collection_first_and_last</diff>
      <filename>vendor/rails/actionpack/test/template/prototype_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -187,6 +187,7 @@ class TextHelperTest &lt; ActionView::TestCase
               http://www.mail-archive.com/rails@lists.rubyonrails.org/
               http://www.amazon.com/Testing-Equal-Sign-In-Path/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1198861734&amp;sr=8-1
               http://en.wikipedia.org/wiki/Sprite_(computer_graphics)
+              http://en.wikipedia.org/wiki/Texas_hold'em
             )
 
     urls.each do |url|</diff>
      <filename>vendor/rails/actionpack/test/template/text_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -284,6 +284,7 @@ class UrlHelperTest &lt; ActionView::TestCase
     assert_dom_equal &quot;&lt;a href=\&quot;&amp;#109;&amp;#97;&amp;#105;&amp;#108;&amp;#116;&amp;#111;&amp;#58;%6d%65@%64%6f%6d%61%69%6e.%63%6f%6d\&quot;&gt;My email&lt;/a&gt;&quot;, mail_to(&quot;me@domain.com&quot;, &quot;My email&quot;, :encode =&gt; &quot;hex&quot;, :replace_at =&gt; &quot;(at)&quot;)
     assert_dom_equal &quot;&lt;a href=\&quot;&amp;#109;&amp;#97;&amp;#105;&amp;#108;&amp;#116;&amp;#111;&amp;#58;%6d%65@%64%6f%6d%61%69%6e.%63%6f%6d\&quot;&gt;&amp;#109;&amp;#101;&amp;#40;&amp;#97;&amp;#116;&amp;#41;&amp;#100;&amp;#111;&amp;#109;&amp;#97;&amp;#105;&amp;#110;&amp;#40;&amp;#100;&amp;#111;&amp;#116;&amp;#41;&amp;#99;&amp;#111;&amp;#109;&lt;/a&gt;&quot;, mail_to(&quot;me@domain.com&quot;, nil, :encode =&gt; &quot;hex&quot;, :replace_at =&gt; &quot;(at)&quot;, :replace_dot =&gt; &quot;(dot)&quot;)
     assert_dom_equal &quot;&lt;script type=\&quot;text/javascript\&quot;&gt;eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%22%3e%4d%79%20%65%6d%61%69%6c%3c%2f%61%3e%27%29%3b'))&lt;/script&gt;&quot;, mail_to(&quot;me@domain.com&quot;, &quot;My email&quot;, :encode =&gt; &quot;javascript&quot;, :replace_at =&gt; &quot;(at)&quot;, :replace_dot =&gt; &quot;(dot)&quot;)
+    assert_dom_equal &quot;&lt;script type=\&quot;text/javascript\&quot;&gt;eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%22%3e%6d%65%28%61%74%29%64%6f%6d%61%69%6e%28%64%6f%74%29%63%6f%6d%3c%2f%61%3e%27%29%3b'))&lt;/script&gt;&quot;, mail_to(&quot;me@domain.com&quot;, nil, :encode =&gt; &quot;javascript&quot;, :replace_at =&gt; &quot;(at)&quot;, :replace_dot =&gt; &quot;(dot)&quot;)
   end
   
   def protect_against_forgery?
@@ -305,6 +306,10 @@ class UrlHelperWithControllerTest &lt; ActionView::TestCase
       render :inline =&gt; &quot;&lt;%= show_named_route_#{params[:kind]} %&gt;&quot;
     end
 
+    def nil_url_for
+      render :inline =&gt; '&lt;%= url_for(nil) %&gt;'
+    end
+
     def rescue_action(e) raise e end
   end
 
@@ -321,7 +326,7 @@ class UrlHelperWithControllerTest &lt; ActionView::TestCase
     assert_equal '/url_helper_with_controller/show_url_for', @response.body
   end
 
-  def test_named_route_shows_host_and_path
+  def test_named_route_url_shows_host_and_path
     with_url_helper_routing do
       get :show_named_route, :kind =&gt; 'url'
       assert_equal 'http://test.host/url_helper_with_controller/show_named_route', @response.body
@@ -335,6 +340,11 @@ class UrlHelperWithControllerTest &lt; ActionView::TestCase
     end
   end
 
+  def test_url_for_nil_returns_current_path
+    get :nil_url_for
+    assert_equal '/url_helper_with_controller/nil_url_for', @response.body
+  end
+
   protected
     def with_url_helper_routing
       with_routing do |set|</diff>
      <filename>vendor/rails/actionpack/test/template/url_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,37 @@
+*2.1.1 (September 4th, 2008)*
+
+* Set config.active_record.timestamped_migrations = false to have migrations with numeric prefix instead of UTC timestamp. #446. [Andrew Stone, Nik Wakelin]
+
+* Fixed that create database statements would always include &quot;DEFAULT NULL&quot; (Nick Sieger) [#334]
+
+* change_column_default preserves the not-null constraint.  #617 [Tarmo T&#228;nav]
+
+* Add :tokenizer option to validates_length_of to specify how to split up the attribute string. #507. [David Lowenfels] Example :
+
+  # Ensure essay contains at least 100 words.
+  validates_length_of :essay, :minimum =&gt; 100, :too_short =&gt; &quot;Your essay must be at least %d words.&quot;), :tokenizer =&gt; lambda {|str| str.scan(/\w+/) }
+
+* Always treat integer :limit as byte length.  #420 [Tarmo T&#228;nav]
+
+* Partial updates don't update lock_version if nothing changed.  #426 [Daniel Morrison]
+
+* Fix column collision with named_scope and :joins.  #46 [Duncan Beevers, Mark Catley]
+
+* db:migrate:down and :up update schema_migrations.  #369 [Michael Raidel, RaceCondition]
+
+* PostgreSQL: support :conditions =&gt; [':foo::integer', { :foo =&gt; 1 }] without treating the ::integer typecast as a bind variable.  [Tarmo T&#228;nav]
+
+* MySQL: rename_column preserves column defaults.  #466 [Diego Algorta]
+
+* Add :from option to calculations.  #397 [Ben Munat]
+
+* Add :validate option to associations to enable/disable the automatic validation of associated models. Resolves #301. [Jan De Poorter]
+
+* PostgreSQL: use 'INSERT ... RETURNING id' for 8.2 and later.  [Jeremy Kemper]
+
+* Added SQL escaping for :limit and :offset in MySQL [Jonathan Wiess]
+
+
 *2.1.0 (May 31st, 2008)*
 
 * Add ActiveRecord::Base.sti_name that checks ActiveRecord::Base#store_full_sti_class? and returns either the full or demodulized name. [rick]</diff>
      <filename>vendor/rails/activerecord/CHANGELOG</filename>
    </modified>
    <modified>
      <filename>vendor/rails/activerecord/README</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,7 @@ require 'rake/rdoctask'
 require 'rake/packagetask'
 require 'rake/gempackagetask'
 require 'rake/contrib/sshpublisher'
+require 'rake/contrib/rubyforgepublisher'
 
 require File.join(File.dirname(__FILE__), 'lib', 'active_record', 'version')
 require File.expand_path(File.dirname(__FILE__)) + &quot;/test/config&quot;
@@ -141,7 +142,7 @@ Rake::RDocTask.new { |rdoc|
   rdoc.title    = &quot;Active Record -- Object-relation mapping put on rails&quot;
   rdoc.options &lt;&lt; '--line-numbers' &lt;&lt; '--inline-source' &lt;&lt; '-A cattr_accessor=object'
   rdoc.options &lt;&lt; '--charset' &lt;&lt; 'utf-8'
-  rdoc.template = &quot;#{ENV['template']}.rb&quot; if ENV['template']
+  rdoc.template = ENV['template'] ? &quot;#{ENV['template']}.rb&quot; : '../doc/template/horo'
   rdoc.rdoc_files.include('README', 'RUNNING_UNIT_TESTS', 'CHANGELOG')
   rdoc.rdoc_files.include('lib/**/*.rb')
   rdoc.rdoc_files.exclude('lib/active_record/vendor/*')
@@ -171,7 +172,7 @@ spec = Gem::Specification.new do |s|
     s.files = s.files + Dir.glob( &quot;#{dir}/**/*&quot; ).delete_if { |item| item.include?( &quot;\.svn&quot; ) }
   end
 
-  s.add_dependency('activesupport', '= 2.1.0' + PKG_BUILD)
+  s.add_dependency('activesupport', '= 2.1.1' + PKG_BUILD)
 
   s.files.delete FIXTURES_ROOT + &quot;/fixture_database.sqlite&quot;
   s.files.delete FIXTURES_ROOT + &quot;/fixture_database_2.sqlite&quot;
@@ -225,13 +226,13 @@ end
 
 desc &quot;Publish the beta gem&quot;
 task :pgem =&gt; [:package] do
-  Rake::SshFilePublisher.new(&quot;davidhh@wrath.rubyonrails.org&quot;, &quot;public_html/gems/gems&quot;, &quot;pkg&quot;, &quot;#{PKG_FILE_NAME}.gem&quot;).upload
-  `ssh davidhh@wrath.rubyonrails.org './gemupdate.sh'`
+  Rake::SshFilePublisher.new(&quot;david@greed.loudthinking.com&quot;, &quot;/u/sites/gems/gems&quot;, &quot;pkg&quot;, &quot;#{PKG_FILE_NAME}.gem&quot;).upload
+  `ssh david@greed.loudthinking.com '/u/sites/gems/gemupdate.sh'`
 end
 
 desc &quot;Publish the API documentation&quot;
 task :pdoc =&gt; [:rdoc] do
-  Rake::SshDirPublisher.new(&quot;davidhh@wrath.rubyonrails.org&quot;, &quot;public_html/ar&quot;, &quot;doc&quot;).upload
+  Rake::SshDirPublisher.new(&quot;wrath.rubyonrails.org&quot;, &quot;public_html/ar&quot;, &quot;doc&quot;).upload
 end
 
 desc &quot;Publish the release files to RubyForge.&quot;</diff>
      <filename>vendor/rails/activerecord/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -24,16 +24,14 @@
 $:.unshift(File.dirname(__FILE__)) unless
   $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
 
-unless defined? ActiveSupport
-  active_support_path = File.dirname(__FILE__) + &quot;/../../activesupport/lib&quot;
-  if File.exist?(active_support_path)
-    $:.unshift active_support_path
-    require 'active_support'
-  else
-    require 'rubygems'
-    gem 'activesupport'
-    require 'active_support'
-  end
+active_support_path = File.dirname(__FILE__) + &quot;/../../activesupport/lib&quot;
+if File.exist?(active_support_path)
+  $:.unshift active_support_path
+  require 'active_support'
+else
+  require 'rubygems'
+  gem 'activesupport'
+  require 'active_support'
 end
 
 require 'active_record/base'</diff>
      <filename>vendor/rails/activerecord/lib/active_record.rb</filename>
    </modified>
    <modified>
      <diff>@@ -51,9 +51,7 @@ module ActiveRecord
       
       def add_preloaded_record_to_collection(parent_records, reflection_name, associated_record)
         parent_records.each do |parent_record|
-          association_proxy = parent_record.send(reflection_name)
-          association_proxy.loaded
-          association_proxy.target = associated_record
+          parent_record.send(&quot;set_#{reflection_name}_target&quot;, associated_record)
         end
       end
 
@@ -103,17 +101,17 @@ module ActiveRecord
         associated_records = reflection.klass.find(:all, :conditions =&gt; [conditions, ids],
         :include =&gt; options[:include],
         :joins =&gt; &quot;INNER JOIN #{connection.quote_table_name options[:join_table]} as t0 ON #{reflection.klass.quoted_table_name}.#{reflection.klass.primary_key} = t0.#{reflection.association_foreign_key}&quot;,
-        :select =&gt; &quot;#{options[:select] || table_name+'.*'}, t0.#{reflection.primary_key_name} as _parent_record_id&quot;,
+        :select =&gt; &quot;#{options[:select] || table_name+'.*'}, t0.#{reflection.primary_key_name} as the_parent_record_id&quot;,
         :order =&gt; options[:order])
 
-        set_association_collection_records(id_to_record_map, reflection.name, associated_records, '_parent_record_id')
+        set_association_collection_records(id_to_record_map, reflection.name, associated_records, 'the_parent_record_id')
       end
 
       def preload_has_one_association(records, reflection, preload_options={})
         id_to_record_map, ids = construct_id_map(records)        
         options = reflection.options
+        records.each {|record| record.send(&quot;set_#{reflection.name}_target&quot;, nil)}
         if options[:through]
-          records.each {|record| record.send(reflection.name) &amp;&amp; record.send(reflection.name).loaded}
           through_records = preload_through_records(records, reflection, options[:through])
           through_reflection = reflections[options[:through]]
           through_primary_key = through_reflection.primary_key_name
@@ -126,8 +124,6 @@ module ActiveRecord
             end
           end
         else
-          records.each {|record| record.send(&quot;set_#{reflection.name}_target&quot;, nil)}
-
           set_association_single_records(id_to_record_map, reflection.name, find_associated_records(ids, reflection, preload_options), reflection.primary_key_name)
         end
       end
@@ -188,7 +184,6 @@ module ActiveRecord
         through_records
       end
 
-      # FIXME: quoting
       def preload_belongs_to_association(records, reflection, preload_options={})
         options = reflection.options
         primary_key_name = reflection.primary_key_name
@@ -227,9 +222,19 @@ module ActiveRecord
 
           table_name = klass.quoted_table_name
           primary_key = klass.primary_key
-          conditions = &quot;#{table_name}.#{primary_key} IN (?)&quot;
+          conditions = &quot;#{table_name}.#{connection.quote_column_name(primary_key)} IN (?)&quot;
           conditions &lt;&lt; append_conditions(options, preload_options)
-          associated_records = klass.find(:all, :conditions =&gt; [conditions, id_map.keys.uniq],
+          column_type = klass.columns.detect{|c| c.name == primary_key}.type
+          ids = id_map.keys.uniq.map do |id|
+            if column_type == :integer
+              id.to_i
+            elsif column_type == :float
+              id.to_f
+            else
+              id
+            end
+          end
+          associated_records = klass.find(:all, :conditions =&gt; [conditions, ids],
                                           :include =&gt; options[:include],
                                           :select =&gt; options[:select],
                                           :joins =&gt; options[:joins],
@@ -243,7 +248,7 @@ module ActiveRecord
         table_name = reflection.klass.quoted_table_name
 
         if interface = reflection.options[:as]
-          conditions = &quot;#{reflection.klass.quoted_table_name}.#{connection.quote_column_name &quot;#{interface}_id&quot;} IN (?) and #{reflection.klass.quoted_table_name}.#{connection.quote_column_name &quot;#{interface}_type&quot;} = '#{self.base_class.name.demodulize}'&quot;
+          conditions = &quot;#{reflection.klass.quoted_table_name}.#{connection.quote_column_name &quot;#{interface}_id&quot;} IN (?) and #{reflection.klass.quoted_table_name}.#{connection.quote_column_name &quot;#{interface}_type&quot;} = '#{self.base_class.sti_name}'&quot;
         else
           foreign_key = reflection.primary_key_name
           conditions = &quot;#{reflection.klass.quoted_table_name}.#{foreign_key} IN (?)&quot;</diff>
      <filename>vendor/rails/activerecord/lib/active_record/association_preload.rb</filename>
    </modified>
    <modified>
      <diff>@@ -690,6 +690,7 @@ module ActiveRecord
       #   association is a polymorphic +belongs_to+.
       # * &lt;tt&gt;:uniq&lt;/tt&gt; - If true, duplicates will be omitted from the collection. Useful in conjunction with &lt;tt&gt;:through&lt;/tt&gt;.
       # * &lt;tt&gt;:readonly&lt;/tt&gt; - If true, all the associated objects are readonly through the association.
+      # * &lt;tt&gt;:validate&lt;/tt&gt; - If false, don't validate the associated objects when saving the parent object. true by default.
       #
       # Option examples:
       #   has_many :comments, :order =&gt; &quot;posted_on&quot;
@@ -710,6 +711,7 @@ module ActiveRecord
 
         configure_dependency_for_has_many(reflection)
 
+        add_multiple_associated_validation_callbacks(reflection.name) unless options[:validate] == false
         add_multiple_associated_save_callbacks(reflection.name)
         add_association_callbacks(reflection.name, reflection.options)
 
@@ -769,6 +771,7 @@ module ActiveRecord
       # * &lt;tt&gt;:source_type&lt;/tt&gt; - Specifies type of the source association used by &lt;tt&gt;has_one :through&lt;/tt&gt; queries where the source
       #   association is a polymorphic +belongs_to+.      
       # * &lt;tt&gt;:readonly&lt;/tt&gt; - If true, the associated object is readonly through the association.
+      # * &lt;tt&gt;:validate&lt;/tt&gt; - If false, don't validate the associated object when saving the parent object. +false+ by default.
       #
       # Option examples:
       #   has_one :credit_card, :dependent =&gt; :destroy  # destroys the associated credit card
@@ -799,7 +802,7 @@ module ActiveRecord
           end
           after_save method_name
 
-          add_single_associated_save_callbacks(reflection.name) 
+          add_single_associated_validation_callbacks(reflection.name) if options[:validate] == true
           association_accessor_methods(reflection, HasOneAssociation)
           association_constructor_method(:build,  reflection, HasOneAssociation)
           association_constructor_method(:create, reflection, HasOneAssociation)
@@ -857,6 +860,7 @@ module ActiveRecord
       #   Note: If you've enabled the counter cache, then you may want to add the counter cache attribute
       #   to the +attr_readonly+ list in the associated classes (e.g. &lt;tt&gt;class Post; attr_readonly :comments_count; end&lt;/tt&gt;).
       # * &lt;tt&gt;:readonly&lt;/tt&gt; - If true, the associated object is readonly through the association.
+      # * &lt;tt&gt;:validate&lt;/tt&gt; - If false, don't validate the associated objects when saving the parent object. +false+ by default.
       #
       # Option examples:
       #   belongs_to :firm, :foreign_key =&gt; &quot;client_of&quot;
@@ -937,6 +941,8 @@ module ActiveRecord
           )
         end
 
+        add_single_associated_validation_callbacks(reflection.name) if options[:validate] == true
+
         configure_dependency_for_belongs_to(reflection)
       end
 
@@ -1025,6 +1031,7 @@ module ActiveRecord
       # * &lt;tt&gt;:select&lt;/tt&gt; - By default, this is &lt;tt&gt;*&lt;/tt&gt; as in &lt;tt&gt;SELECT * FROM&lt;/tt&gt;, but can be changed if, for example, you want to do a join
       #   but not include the joined columns. Do not forget to include the primary and foreign keys, otherwise it will raise an error.
       # * &lt;tt&gt;:readonly&lt;/tt&gt; - If true, all the associated objects are readonly through the association.
+      # * &lt;tt&gt;:validate&lt;/tt&gt; - If false, don't validate the associated objects when saving the parent object. +true+ by default.
       #
       # Option examples:
       #   has_and_belongs_to_many :projects
@@ -1037,6 +1044,7 @@ module ActiveRecord
       def has_and_belongs_to_many(association_id, options = {}, &amp;extension)
         reflection = create_has_and_belongs_to_many_reflection(association_id, options, &amp;extension)
 
+        add_multiple_associated_validation_callbacks(reflection.name) unless options[:validate] == false
         add_multiple_associated_save_callbacks(reflection.name)
         collection_accessor_methods(reflection, HasAndBelongsToManyAssociation)
 
@@ -1103,10 +1111,9 @@ module ActiveRecord
               association.create_through_record(new_value)
               self.send(reflection.name, new_value)
             else
-              association.replace(new_value)              
+              association.replace(new_value)
+              instance_variable_set(ivar, new_value.nil? ? nil : association)
             end
-
-            instance_variable_set(ivar, new_value.nil? ? nil : association)
           end
 
           define_method(&quot;set_#{reflection.name}_target&quot;) do |target|
@@ -1157,7 +1164,7 @@ module ActiveRecord
           end
         end
         
-        def add_single_associated_save_callbacks(association_name)
+        def add_single_associated_validation_callbacks(association_name)
           method_name = &quot;validate_associated_records_for_#{association_name}&quot;.to_sym
           define_method(method_name) do
             association = instance_variable_get(&quot;@#{association_name}&quot;)
@@ -1169,7 +1176,7 @@ module ActiveRecord
           validate method_name
         end
         
-        def add_multiple_associated_save_callbacks(association_name)
+        def add_multiple_associated_validation_callbacks(association_name)
           method_name = &quot;validate_associated_records_for_#{association_name}&quot;.to_sym
           ivar = &quot;@#{association_name}&quot;
 
@@ -1190,6 +1197,10 @@ module ActiveRecord
           end
 
           validate method_name
+        end
+
+        def add_multiple_associated_save_callbacks(association_name)
+          ivar = &quot;@#{association_name}&quot;
 
           method_name = &quot;before_save_associated_records_for_#{association_name}&quot;.to_sym
           define_method(method_name) do
@@ -1211,7 +1222,6 @@ module ActiveRecord
             else
               []
             end
-
             records_to_save.each { |record| association.send(:insert_record, record) } unless records_to_save.blank?
 
             # reconstruct the SQL queries now that we know the owner's id
@@ -1343,7 +1353,8 @@ module ActiveRecord
             :uniq,
             :finder_sql, :counter_sql,
             :before_add, :after_add, :before_remove, :after_remove,
-            :extend, :readonly
+            :extend, :readonly,
+            :validate
           )
 
           options[:extend] = create_extension_modules(association_id, extension, options[:extend])
@@ -1353,7 +1364,7 @@ module ActiveRecord
 
         def create_has_one_reflection(association_id, options)
           options.assert_valid_keys(
-            :class_name, :foreign_key, :remote, :select, :conditions, :order, :include, :dependent, :counter_cache, :extend, :as, :readonly
+            :class_name, :foreign_key, :remote, :select, :conditions, :order, :include, :dependent, :counter_cache, :extend, :as, :readonly, :validate
           )
 
           create_reflection(:has_one, association_id, options, self)
@@ -1361,7 +1372,7 @@ module ActiveRecord
         
         def create_has_one_through_reflection(association_id, options)
           options.assert_valid_keys(
-            :class_name, :foreign_key, :remote, :select, :conditions, :order, :include, :dependent, :counter_cache, :extend, :as, :through, :source, :source_type
+            :class_name, :foreign_key, :remote, :select, :conditions, :order, :include, :dependent, :counter_cache, :extend, :as, :through, :source, :source_type, :validate
           )
           create_reflection(:has_one, association_id, options, self)
         end
@@ -1369,7 +1380,7 @@ module ActiveRecord
         def create_belongs_to_reflection(association_id, options)
           options.assert_valid_keys(
             :class_name, :foreign_key, :foreign_type, :remote, :select, :conditions, :include, :dependent,
-            :counter_cache, :extend, :polymorphic, :readonly
+            :counter_cache, :extend, :polymorphic, :readonly, :validate
           )
 
           reflection = create_reflection(:belongs_to, association_id, options, self)
@@ -1388,7 +1399,8 @@ module ActiveRecord
             :uniq,
             :finder_sql, :delete_sql, :insert_sql,
             :before_add, :after_add, :before_remove, :after_remove,
-            :extend, :readonly
+            :extend, :readonly,
+            :validate
           )
 
           options[:extend] = create_extension_modules(association_id, extension, options[:extend])
@@ -1465,10 +1477,15 @@ module ActiveRecord
             join_dependency.joins_for_table_name(table)
           }.flatten.compact.uniq
 
+          order = options[:order]
+          if scoped_order = (scope &amp;&amp; scope[:order])
+            order = order ? &quot;#{order}, #{scoped_order}&quot; : scoped_order
+          end
+
           is_distinct = !options[:joins].blank? || include_eager_conditions?(options, tables_from_conditions) || include_eager_order?(options, tables_from_order)
           sql = &quot;SELECT &quot;
           if is_distinct
-            sql &lt;&lt; connection.distinct(&quot;#{connection.quote_table_name table_name}.#{primary_key}&quot;, options[:order])
+            sql &lt;&lt; connection.distinct(&quot;#{connection.quote_table_name table_name}.#{primary_key}&quot;, order)
           else
             sql &lt;&lt; primary_key
           end
@@ -1482,8 +1499,8 @@ module ActiveRecord
           add_conditions!(sql, options[:conditions], scope)
           add_group!(sql, options[:group], scope)
 
-          if options[:order] &amp;&amp; is_distinct
-            connection.add_order_by_for_association_limiting!(sql, options)
+          if order &amp;&amp; is_distinct
+            connection.add_order_by_for_association_limiting!(sql, :order =&gt; order)
           else
             add_order!(sql, options[:order], scope)
           end
@@ -1502,19 +1519,19 @@ module ActiveRecord
               else            all &lt;&lt; cond
             end
           end
-          conditions.join(' ').scan(/([\.\w]+).?\./).flatten
+          conditions.join(' ').scan(/([\.a-zA-Z_]+).?\./).flatten
         end
 
         def order_tables(options)
-          order = options[:order]
+          order = [options[:order], scope(:find, :order) ].join(&quot;, &quot;)
           return [] unless order &amp;&amp; order.is_a?(String)
-          order.scan(/([\.\w]+).?\./).flatten
+          order.scan(/([\.a-zA-Z_]+).?\./).flatten
         end
 
         def selects_tables(options)
           select = options[:select]
           return [] unless select &amp;&amp; select.is_a?(String)
-          select.scan(/&quot;?([\.\w]+)&quot;?.?\./).flatten
+          select.scan(/&quot;?([\.a-zA-Z_]+)&quot;?.?\./).flatten
         end
 
         # Checks if the conditions reference a table other than the current model table
@@ -1638,7 +1655,9 @@ module ActiveRecord
           end
 
           def join_for_table_name(table_name)
-            @joins.select{|j|j.aliased_table_name == table_name.gsub(/^\&quot;(.*)\&quot;$/){$1} }.first rescue nil
+            join = (@joins.select{|j|j.aliased_table_name == table_name.gsub(/^\&quot;(.*)\&quot;$/){$1} }.first) rescue nil
+            return join unless join.nil?
+            @joins.select{|j|j.is_a?(JoinAssociation) &amp;&amp; j.aliased_join_table_name == table_name.gsub(/^\&quot;(.*)\&quot;$/){$1} }.first rescue nil
           end
 
           def joins_for_table_name(table_name)
@@ -1714,6 +1733,7 @@ module ActiveRecord
                   collection.target.push(association)
                 when :has_one
                   return if record.id.to_s != join.parent.record_id(row).to_s
+                  return if record.instance_variable_defined?(&quot;@#{join.reflection.name}&quot;)
                   association = join.instantiate(row) unless row[join.aliased_primary_key].nil?
                   record.send(&quot;set_#{join.reflection.name}_target&quot;, association)
                 when :belongs_to
@@ -1795,7 +1815,7 @@ module ActiveRecord
                 @aliased_join_table_name = aliased_table_name_for(reflection.options[:join_table], &quot;_join&quot;)
               end
         
-              if reflection.macro == :has_many &amp;&amp; reflection.options[:through]
+              if [:has_many, :has_one].include?(reflection.macro) &amp;&amp; reflection.options[:through]
                 @aliased_join_table_name = aliased_table_name_for(reflection.through_reflection.klass.table_name, &quot;_join&quot;)
               end
             end
@@ -1819,7 +1839,7 @@ module ActiveRecord
                      ]
                 when :has_many, :has_one
                   case
-                    when reflection.macro == :has_many &amp;&amp; reflection.options[:through]
+                    when reflection.options[:through]
                       through_conditions = through_reflection.options[:conditions] ? &quot;AND #{interpolate_sql(sanitize_sql(through_reflection.options[:conditions]))}&quot; : ''
 
                       jt_foreign_key = jt_as_extra = jt_source_extra = jt_sti_extra = nil
@@ -1855,7 +1875,7 @@ module ActiveRecord
                           jt_sti_extra = &quot; AND %s.%s = %s&quot; % [
                             connection.quote_table_name(aliased_join_table_name),
                             connection.quote_column_name(through_reflection.active_record.inheritance_column),
-                            through_reflection.klass.quote_value(through_reflection.klass.name.demodulize)]
+                            through_reflection.klass.quote_value(through_reflection.klass.sti_name)]
                         end
                       when :belongs_to
                         first_key = primary_key
@@ -1920,10 +1940,8 @@ module ActiveRecord
                 else
                   &quot;&quot;
               end || ''
-              join &lt;&lt; %(AND %s.%s = %s ) % [
-                connection.quote_table_name(aliased_table_name),
-                connection.quote_column_name(klass.inheritance_column),
-                klass.quote_value(klass.name.demodulize)] unless klass.descends_from_active_record?
+              join &lt;&lt; %(AND %s) % [
+                klass.send(:type_condition, aliased_table_name)] unless klass.descends_from_active_record?
 
               [through_reflection, reflection].each do |ref|
                 join &lt;&lt; &quot;AND #{interpolate_sql(sanitize_sql(ref.options[:conditions]))} &quot; if ref &amp;&amp; ref.options[:conditions]</diff>
      <filename>vendor/rails/activerecord/lib/active_record/associations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -78,11 +78,14 @@ module ActiveRecord
         @loaded = false
       end
 
-      def build(attributes = {})
+      def build(attributes = {}, &amp;block)
         if attributes.is_a?(Array)
-          attributes.collect { |attr| build(attr) }
+          attributes.collect { |attr| build(attr, &amp;block) }
         else
-          build_record(attributes) { |record| set_belongs_to_association_for(record) }
+          build_record(attributes) do |record|
+            block.call(record) if block_given?
+            set_belongs_to_association_for(record)
+          end
         end
       end
 
@@ -187,7 +190,7 @@ module ActiveRecord
         if @owner.new_record? || (loaded? &amp;&amp; !@reflection.options[:uniq])
           @target.size
         elsif !loaded? &amp;&amp; !@reflection.options[:uniq] &amp;&amp; @target.is_a?(Array)
-          unsaved_records = Array(@target.detect { |r| r.new_record? })
+          unsaved_records = @target.select { |r| r.new_record? }
           unsaved_records.size + count_records
         else
           count_records
@@ -335,7 +338,7 @@ module ActiveRecord
           callback(:before_add, record)
           yield(record) if block_given?
           @target ||= [] unless loaded?
-          @target &lt;&lt; record
+          @target &lt;&lt; record unless @reflection.options[:uniq] &amp;&amp; @target.include?(record)
           callback(:after_add, record)
           record
         end</diff>
      <filename>vendor/rails/activerecord/lib/active_record/associations/association_collection.rb</filename>
    </modified>
    <modified>
      <diff>@@ -69,8 +69,8 @@ module ActiveRecord
         @target
       end
 
-      def respond_to?(symbol, include_priv = false)
-        proxy_respond_to?(symbol, include_priv) || (load_target &amp;&amp; @target.respond_to?(symbol, include_priv))
+      def respond_to?(*args)
+        proxy_respond_to?(*args) || (load_target &amp;&amp; @target.respond_to?(*args))
       end
 
       # Explicitly proxy === because the instance method removal above
@@ -131,10 +131,6 @@ module ActiveRecord
           records.map { |record| record.quoted_id }.join(',')
         end
 
-        def interpolate_sql_options!(options, *keys)
-          keys.each { |key| options[key] &amp;&amp;= interpolate_sql(options[key]) }
-        end
-
         def interpolate_sql(sql, record = nil)
           @owner.send(:interpolate_sql, sql, record)
         end</diff>
      <filename>vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb</filename>
    </modified>
    <modified>
      <diff>@@ -70,10 +70,8 @@ module ActiveRecord
         end
 
         def construct_sql
-          interpolate_sql_options!(@reflection.options, :finder_sql)
-
           if @reflection.options[:finder_sql]
-            @finder_sql = @reflection.options[:finder_sql]
+            @finder_sql = interpolate_sql(@reflection.options[:finder_sql])
           else
             @finder_sql = &quot;#{@owner.connection.quote_table_name @reflection.options[:join_table]}.#{@reflection.primary_key_name} = #{@owner.quoted_id} &quot;
             @finder_sql &lt;&lt; &quot; AND (#{conditions})&quot; if conditions
@@ -87,6 +85,7 @@ module ActiveRecord
                         :joins =&gt; @join_sql,
                         :readonly =&gt; false,
                         :order =&gt; @reflection.options[:order],
+                        :include =&gt; @reflection.options[:include],
                         :limit =&gt; @reflection.options[:limit] } }
         end
 </diff>
      <filename>vendor/rails/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,16 @@ module ActiveRecord
             @finder_sql + &quot; AND (#{sanitize_sql(options[:conditions])})&quot;
           options[:include] ||= @reflection.options[:include]
 
-          @reflection.klass.count(column_name, options)
+          value = @reflection.klass.count(column_name, options)
+
+          limit  = @reflection.options[:limit]
+          offset = @reflection.options[:offset]
+
+          if limit || offset
+            [ [value - offset.to_i, 0].max, limit.to_i ].min
+          else
+            value
+          end
         end
       end
 
@@ -27,8 +36,11 @@ module ActiveRecord
           else
             @reflection.klass.count(:conditions =&gt; @counter_sql, :include =&gt; @reflection.options[:include])
           end
-          
-          @target = [] and loaded if count == 0
+
+          # If there's nothing in the database and @target has no new records
+          # we are certain the current target is an empty array. This is a
+          # documented side-effect of the method that may avoid an extra SELECT.
+          @target ||= [] and loaded if count == 0
           
           if @reflection.options[:limit]
             count = [ @reflection.options[:limit], count ].min
@@ -100,7 +112,7 @@ module ActiveRecord
           create_scoping = {}
           set_belongs_to_association_for(create_scoping)
           {
-            :find =&gt; { :conditions =&gt; @finder_sql, :readonly =&gt; false, :order =&gt; @reflection.options[:order], :limit =&gt; @reflection.options[:limit] },
+            :find =&gt; { :conditions =&gt; @finder_sql, :readonly =&gt; false, :order =&gt; @reflection.options[:order], :limit =&gt; @reflection.options[:limit], :include =&gt; @reflection.options[:include]},
             :create =&gt; create_scoping
           }
         end</diff>
      <filename>vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb</filename>
    </modified>
    <modified>
      <diff>@@ -237,7 +237,7 @@ module ActiveRecord
         end
         
         def build_sti_condition
-          &quot;#{@reflection.through_reflection.quoted_table_name}.#{@reflection.through_reflection.klass.inheritance_column} = #{@reflection.klass.quote_value(@reflection.through_reflection.klass.sti_name)}&quot;
+          @reflection.through_reflection.klass.send(:type_condition)
         end
 
         alias_method :sql_conditions, :conditions</diff>
      <filename>vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,8 +21,8 @@ module ActiveRecord
       def replace(obj, dont_save = false)
         load_target
 
-        unless @target.nil?
-          if dependent? &amp;&amp; !dont_save &amp;&amp; @target != obj
+        unless @target.nil? || @target == obj
+          if dependent? &amp;&amp; !dont_save
             @target.destroy unless @target.new_record?
             @owner.clear_association_cache
           else</diff>
      <filename>vendor/rails/activerecord/lib/active_record/associations/has_one_association.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,6 +22,10 @@ module ActiveRecord
     
       def find_target
         super.first
+      end
+
+      def reset_target!
+        @target = nil
       end        
     end        
   end</diff>
      <filename>vendor/rails/activerecord/lib/active_record/associations/has_one_through_association.rb</filename>
    </modified>
    <modified>
      <diff>@@ -372,7 +372,7 @@ module ActiveRecord #:nodoc:
     def self.reset_subclasses #:nodoc:
       nonreloadables = []
       subclasses.each do |klass|
-        unless Dependencies.autoloaded? klass
+        unless ActiveSupport::Dependencies.autoloaded? klass
           nonreloadables &lt;&lt; klass
           next
         end
@@ -439,6 +439,10 @@ module ActiveRecord #:nodoc:
     cattr_accessor :schema_format , :instance_writer =&gt; false
     @@schema_format = :ruby
 
+    # Specify whether or not to use timestamps for migration numbers
+    cattr_accessor :timestamped_migrations , :instance_writer =&gt; false
+    @@timestamped_migrations = true
+
     # Determine whether to store the full constant name including namespace when using STI
     superclass_delegating_accessor :store_full_sti_class
     self.store_full_sti_class = false
@@ -828,7 +832,7 @@ module ActiveRecord #:nodoc:
       def update_counters(id, counters)
         updates = counters.inject([]) { |list, (counter_name, increment)|
           sign = increment &lt; 0 ? &quot;-&quot; : &quot;+&quot;
-          list &lt;&lt; &quot;#{connection.quote_column_name(counter_name)} = #{connection.quote_column_name(counter_name)} #{sign} #{increment.abs}&quot;
+          list &lt;&lt; &quot;#{connection.quote_column_name(counter_name)} = COALESCE(#{connection.quote_column_name(counter_name)}, 0) #{sign} #{increment.abs}&quot;
         }.join(&quot;, &quot;)
         update_all(updates, &quot;#{connection.quote_column_name(primary_key)} = #{quote_value(id)}&quot;)
       end
@@ -1465,7 +1469,7 @@ module ActiveRecord #:nodoc:
 
         def construct_finder_sql(options)
           scope = scope(:find)
-          sql  = &quot;SELECT #{options[:select] || (scope &amp;&amp; scope[:select]) || (options[:joins] &amp;&amp; quoted_table_name + '.*') || '*'} &quot;
+          sql  = &quot;SELECT #{options[:select] || (scope &amp;&amp; scope[:select]) || ((options[:joins] || (scope &amp;&amp; scope[:joins])) &amp;&amp; quoted_table_name + '.*') || '*'} &quot;
           sql &lt;&lt; &quot;FROM #{(scope &amp;&amp; scope[:from]) || options[:from] || quoted_table_name} &quot;
 
           add_joins!(sql, options, scope)
@@ -1577,10 +1581,11 @@ module ActiveRecord #:nodoc:
           sql &lt;&lt; &quot;WHERE #{merged_conditions} &quot; unless merged_conditions.blank?
         end
 
-        def type_condition
+        def type_condition(table_alias=nil)
+          quoted_table_alias = self.connection.quote_table_name(table_alias || table_name)
           quoted_inheritance_column = connection.quote_column_name(inheritance_column)
-          type_condition = subclasses.inject(&quot;#{quoted_table_name}.#{quoted_inheritance_column} = '#{sti_name}' &quot;) do |condition, subclass|
-            condition &lt;&lt; &quot;OR #{quoted_table_name}.#{quoted_inheritance_column} = '#{subclass.sti_name}' &quot;
+          type_condition = subclasses.inject(&quot;#{quoted_table_alias}.#{quoted_inheritance_column} = '#{sti_name}' &quot;) do |condition, subclass|
+            condition &lt;&lt; &quot;OR #{quoted_table_alias}.#{quoted_inheritance_column} = '#{subclass.sti_name}' &quot;
           end
 
           &quot; (#{type_condition}) &quot;
@@ -1717,7 +1722,7 @@ module ActiveRecord #:nodoc:
         def attribute_condition(argument)
           case argument
             when nil   then &quot;IS ?&quot;
-            when Array, ActiveRecord::Associations::AssociationCollection then &quot;IN (?)&quot;
+            when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::NamedScope::Scope then &quot;IN (?)&quot;
             when Range then &quot;BETWEEN ? AND ?&quot;
             else            &quot;= ?&quot;
           end
@@ -2053,9 +2058,10 @@ module ActiveRecord #:nodoc:
         end
 
         def replace_named_bind_variables(statement, bind_vars) #:nodoc:
-          statement.gsub(/:([a-zA-Z]\w*)/) do
-            match = $1.to_sym
-            if bind_vars.include?(match)
+          statement.gsub(/(:?):([a-zA-Z]\w*)/) do
+            if $1 == ':' # skip postgresql casts
+              $&amp; # return the whole match
+            elsif bind_vars.include?(match = $2.to_sym)
               quote_bound_value(bind_vars[match])
             else
               raise PreparedStatementInvalid, &quot;missing value for :#{match} in #{statement}&quot;
@@ -2064,13 +2070,18 @@ module ActiveRecord #:nodoc:
         end
 
         def expand_range_bind_variables(bind_vars) #:nodoc:
-          bind_vars.sum do |var|
+          expanded = []
+
+          bind_vars.each do |var|
             if var.is_a?(Range)
-              [var.first, var.last]
+              expanded &lt;&lt; var.first
+              expanded &lt;&lt; var.last
             else
-              [var]
+              expanded &lt;&lt; var
             end
           end
+
+          expanded
         end
 
         def quote_bound_value(value) #:nodoc:
@@ -2572,8 +2583,15 @@ module ActiveRecord #:nodoc:
         quoted = {}
         connection = self.class.connection
         attribute_names.each do |name|
-          if column = column_for_attribute(name)
-            quoted[name] = connection.quote(read_attribute(name), column) unless !include_primary_key &amp;&amp; column.primary
+          if (column = column_for_attribute(name)) &amp;&amp; (include_primary_key || !column.primary)
+            value = read_attribute(name)
+
+            # We need explicit to_yaml because quote() does not properly convert Time/Date fields to YAML.
+            if value &amp;&amp; self.class.serialized_attributes.has_key?(name) &amp;&amp; (value.acts_like?(:date) || value.acts_like?(:time))
+              value = value.to_yaml
+            end
+
+            quoted[name] = connection.quote(value, column)
           end
         end
         include_readonly_attributes ? quoted : remove_readonly_attributes(quoted)</diff>
      <filename>vendor/rails/activerecord/lib/active_record/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 module ActiveRecord
   module Calculations #:nodoc:
-    CALCULATIONS_OPTIONS = [:conditions, :joins, :order, :select, :group, :having, :distinct, :limit, :offset, :include]
+    CALCULATIONS_OPTIONS = [:conditions, :joins, :order, :select, :group, :having, :distinct, :limit, :offset, :include, :from]
     def self.included(base)
       base.extend(ClassMethods)
     end
@@ -27,6 +27,8 @@ module ActiveRecord
       # * &lt;tt&gt;:select&lt;/tt&gt;: By default, this is * as in SELECT * FROM, but can be changed if you, for example, want to do a join but not
       #   include the joined columns.
       # * &lt;tt&gt;:distinct&lt;/tt&gt;: Set this to true to make this a distinct calculation, such as SELECT COUNT(DISTINCT posts.id) ...
+      # * &lt;tt&gt;:from&lt;/tt&gt; - By default, this is the table name of the class, but can be changed to an alternate table name (or even the name
+      #   of a database view).
       #
       # Examples for counting all:
       #   Person.count         # returns the total count of all people
@@ -71,7 +73,7 @@ module ActiveRecord
       #
       #   Person.sum('age')
       def sum(column_name, options = {})
-        calculate(:sum, column_name, options) || 0
+        calculate(:sum, column_name, options)
       end
 
       # This calculates aggregate values in the given column.  Methods for count, sum, average, minimum, and maximum have been added as shortcuts.
@@ -178,13 +180,23 @@ module ActiveRecord
           sql = &quot;SELECT COUNT(*) AS #{aggregate_alias}&quot; if use_workaround
 
           sql &lt;&lt; &quot;, #{options[:group_field]} AS #{options[:group_alias]}&quot; if options[:group]
-          sql &lt;&lt; &quot; FROM (SELECT #{distinct}#{column_name}&quot; if use_workaround
-          sql &lt;&lt; &quot; FROM #{connection.quote_table_name(table_name)} &quot;
+          if options[:from]
+            sql &lt;&lt; &quot; FROM #{options[:from]} &quot;
+          else
+            sql &lt;&lt; &quot; FROM (SELECT #{distinct}#{column_name}&quot; if use_workaround
+            sql &lt;&lt; &quot; FROM #{connection.quote_table_name(table_name)} &quot;
+          end
+
+          joins = &quot;&quot;
+          add_joins!(joins, options, scope)
+
           if merged_includes.any?
-            join_dependency = ActiveRecord::Associations::ClassMethods::JoinDependency.new(self, merged_includes, options[:joins])
+            join_dependency = ActiveRecord::Associations::ClassMethods::JoinDependency.new(self, merged_includes, joins)
             sql &lt;&lt; join_dependency.join_associations.collect{|join| join.association_join }.join
           end
-          add_joins!(sql, options, scope)
+
+          sql &lt;&lt; joins unless joins.blank?
+
           add_conditions!(sql, options[:conditions], scope)
           add_limited_ids_condition!(sql, options, join_dependency) if join_dependency &amp;&amp; !using_limitable_reflections?(join_dependency.reflections) &amp;&amp; ((scope &amp;&amp; scope[:limit]) || options[:limit])
 
@@ -205,7 +217,7 @@ module ActiveRecord
 
           sql &lt;&lt; &quot; ORDER BY #{options[:order]} &quot;       if options[:order]
           add_limit!(sql, options, scope)
-          sql &lt;&lt; ')' if use_workaround
+          sql &lt;&lt; ') AS #{aggregate_alias}_subquery' if use_workaround
           sql
         end
 
@@ -266,6 +278,7 @@ module ActiveRecord
           operation = operation.to_s.downcase
           case operation
             when 'count' then value.to_i
+            when 'sum'   then value =~ /\./ ? value.to_f : value.to_i
             when 'avg'   then value &amp;&amp; value.to_f
             else column ? column.type_cast(value) : value
           end</diff>
      <filename>vendor/rails/activerecord/lib/active_record/calculations.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/activerecord/lib/active_record/callbacks.rb</filename>
    </modified>
    <modified>
      <diff>@@ -257,7 +257,10 @@ module ActiveRecord
 
       def to_sql
         column_sql = &quot;#{base.quote_column_name(name)} #{sql_type}&quot;
-        add_column_options!(column_sql, :null =&gt; null, :default =&gt; default) unless type.to_sym == :primary_key
+        column_options = {}
+        column_options[:null] = null unless null.nil?
+        column_options[:default] = default unless default.nil?
+        add_column_options!(column_sql, column_options) unless type.to_sym == :primary_key
         column_sql
       end
       alias to_s :to_sql
@@ -304,8 +307,7 @@ module ActiveRecord
       #
       # Available options are (none of these exists by default):
       # * &lt;tt&gt;:limit&lt;/tt&gt; -
-      #   Requests a maximum column length (&lt;tt&gt;:string&lt;/tt&gt;, &lt;tt&gt;:text&lt;/tt&gt;,
-      #   &lt;tt&gt;:binary&lt;/tt&gt; or &lt;tt&gt;:integer&lt;/tt&gt; columns only)
+      #   Requests a maximum column length. This is number of characters for &lt;tt&gt;:string&lt;/tt&gt; and &lt;tt&gt;:text&lt;/tt&gt; columns and number of bytes for :binary and :integer columns.
       # * &lt;tt&gt;:default&lt;/tt&gt; -
       #   The column's default value. Use nil for NULL.
       # * &lt;tt&gt;:null&lt;/tt&gt; -
@@ -442,9 +444,10 @@ module ActiveRecord
 
       # Appends &lt;tt&gt;:datetime&lt;/tt&gt; columns &lt;tt&gt;:created_at&lt;/tt&gt; and
       # &lt;tt&gt;:updated_at&lt;/tt&gt; to the table.
-      def timestamps
-        column(:created_at, :datetime)
-        column(:updated_at, :datetime)
+      def timestamps(*args)
+        options = args.extract_options!
+        column(:created_at, :datetime, options)
+        column(:updated_at, :datetime, options)
       end
 
       def references(*args)</diff>
      <filename>vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -331,15 +331,26 @@ module ActiveRecord
       end
 
       def assume_migrated_upto_version(version)
+        version = version.to_i
         sm_table = quote_table_name(ActiveRecord::Migrator.schema_migrations_table_name)
+
         migrated = select_values(&quot;SELECT version FROM #{sm_table}&quot;).map(&amp;:to_i)
         versions = Dir['db/migrate/[0-9]*_*.rb'].map do |filename|
           filename.split('/').last.split('_').first.to_i
         end
 
-        execute &quot;INSERT INTO #{sm_table} (version) VALUES ('#{version}')&quot; unless migrated.include?(version.to_i)
-        (versions - migrated).select { |v| v &lt; version.to_i }.each do |v|
-          execute &quot;INSERT INTO #{sm_table} (version) VALUES ('#{v}')&quot;
+        unless migrated.include?(version)
+          execute &quot;INSERT INTO #{sm_table} (version) VALUES ('#{version}')&quot;
+        end
+
+        inserted = Set.new
+        (versions - migrated).each do |v|
+          if inserted.include?(v)
+            raise &quot;Duplicate migration #{v}. Please renumber your migrations to resolve the conflict.&quot;
+          elsif v &lt; version
+            execute &quot;INSERT INTO #{sm_table} (version) VALUES ('#{v}')&quot;
+            inserted &lt;&lt; v
+          end
         end
       end
 
@@ -372,13 +383,9 @@ module ActiveRecord
 
       def add_column_options!(sql, options) #:nodoc:
         sql &lt;&lt; &quot; DEFAULT #{quote(options[:default], options[:column])}&quot; if options_include_default?(options)
-        # must explcitly check for :null to allow change_column to work on migrations
-        if options.has_key? :null
-          if options[:null] == false
-            sql &lt;&lt; &quot; NOT NULL&quot;
-          else
-            sql &lt;&lt; &quot; NULL&quot;
-          end
+        # must explicitly check for :null to allow change_column to work on migrations
+        if options[:null] == false
+          sql &lt;&lt; &quot; NOT NULL&quot;
         end
       end
 </diff>
      <filename>vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -50,10 +50,7 @@ module ActiveRecord
         rescue LoadError =&gt; cannot_require_mysql
           # Use the bundled Ruby/MySQL driver if no driver is already in place
           begin
-            ActiveRecord::Base.logger.info(
-              &quot;WARNING: You're using the Ruby-based MySQL library that ships with Rails. This library is not suited for production. &quot; +
-              &quot;Please install the C-based MySQL library instead (gem install mysql).&quot;
-            ) if ActiveRecord::Base.logger
+            ActiveSupport::Deprecation.warn &quot;You're using the Ruby-based MySQL library that ships with Rails. This library will be REMOVED FROM RAILS 2.2. Please switch to the offical mysql gem: `gem install mysql`&quot;, caller
 
             require 'active_record/vendor/mysql'
           rescue LoadError
@@ -113,7 +110,8 @@ module ActiveRecord
         end
 
         def extract_limit(sql_type)
-          if sql_type =~ /blob|text/i
+          case sql_type
+          when /blob|text/i
             case sql_type
             when /tiny/i
               255
@@ -124,6 +122,11 @@ module ActiveRecord
             else
               super # we could return 65535 here, but we leave it undecorated by default
             end
+          when /^bigint/i;    8
+          when /^int/i;       4
+          when /^mediumint/i; 3
+          when /^smallint/i;  2
+          when /^tinyint/i;   1
           else
             super
           end
@@ -193,10 +196,10 @@ module ActiveRecord
 
       def native_database_types #:nodoc:
         {
-          :primary_key =&gt; &quot;int(11) DEFAULT NULL auto_increment PRIMARY KEY&quot;,
+          :primary_key =&gt; &quot;int(11) DEFAULT NULL auto_increment PRIMARY KEY&quot;.freeze,
           :string      =&gt; { :name =&gt; &quot;varchar&quot;, :limit =&gt; 255 },
           :text        =&gt; { :name =&gt; &quot;text&quot; },
-          :integer     =&gt; { :name =&gt; &quot;int&quot;},
+          :integer     =&gt; { :name =&gt; &quot;int&quot;, :limit =&gt; 4 },
           :float       =&gt; { :name =&gt; &quot;float&quot; },
           :decimal     =&gt; { :name =&gt; &quot;decimal&quot; },
           :datetime    =&gt; { :name =&gt; &quot;datetime&quot; },
@@ -336,10 +339,11 @@ module ActiveRecord
 
       def add_limit_offset!(sql, options) #:nodoc:
         if limit = options[:limit]
+          limit = sanitize_limit(limit)
           unless offset = options[:offset]
             sql &lt;&lt; &quot; LIMIT #{limit}&quot;
           else
-            sql &lt;&lt; &quot; LIMIT #{offset}, #{limit}&quot;
+            sql &lt;&lt; &quot; LIMIT #{offset.to_i}, #{limit}&quot;
           end
         end
       end
@@ -439,18 +443,29 @@ module ActiveRecord
       end
 
       def change_column_default(table_name, column_name, default) #:nodoc:
-        current_type = select_one(&quot;SHOW COLUMNS FROM #{quote_table_name(table_name)} LIKE '#{column_name}'&quot;)[&quot;Type&quot;]
+        column = column_for(table_name, column_name)
+        change_column table_name, column_name, column.sql_type, :default =&gt; default
+      end
+
+      def change_column_null(table_name, column_name, null, default = nil)
+        column = column_for(table_name, column_name)
+
+        unless null || default.nil?
+          execute(&quot;UPDATE #{quote_table_name(table_name)} SET #{quote_column_name(column_name)}=#{quote(default)} WHERE #{quote_column_name(column_name)} IS NULL&quot;)
+        end
 
-        execute(&quot;ALTER TABLE #{quote_table_name(table_name)} CHANGE #{quote_column_name(column_name)} #{quote_column_name(column_name)} #{current_type} DEFAULT #{quote(default)}&quot;)
+        change_column table_name, column_name, column.sql_type, :null =&gt; null
       end
 
       def change_column(table_name, column_name, type, options = {}) #:nodoc:
+        column = column_for(table_name, column_name)
+
         unless options_include_default?(options)
-          if column = columns(table_name).find { |c| c.name == column_name.to_s }
-            options[:default] = column.default
-          else
-            raise &quot;No such column: #{table_name}.#{column_name}&quot;
-          end
+          options[:default] = column.default
+        end
+
+        unless options.has_key?(:null)
+          options[:null] = column.null
         end
 
         change_column_sql = &quot;ALTER TABLE #{quote_table_name(table_name)} CHANGE #{quote_column_name(column_name)} #{quote_column_name(column_name)} #{type_to_sql(type, options[:limit], options[:precision], options[:scale])}&quot;
@@ -459,8 +474,17 @@ module ActiveRecord
       end
 
       def rename_column(table_name, column_name, new_column_name) #:nodoc:
+        options = {}
+        if column = columns(table_name).find { |c| c.name == column_name.to_s }
+          options[:default] = column.default
+          options[:null] = column.null
+        else
+          raise ActiveRecordError, &quot;No such column: #{table_name}.#{column_name}&quot;
+        end
         current_type = select_one(&quot;SHOW COLUMNS FROM #{quote_table_name(table_name)} LIKE '#{column_name}'&quot;)[&quot;Type&quot;]
-        execute &quot;ALTER TABLE #{quote_table_name(table_name)} CHANGE #{quote_column_name(column_name)} #{quote_column_name(new_column_name)} #{current_type}&quot;
+        rename_column_sql = &quot;ALTER TABLE #{quote_table_name(table_name)} CHANGE #{quote_column_name(column_name)} #{quote_column_name(new_column_name)} #{current_type}&quot;
+        add_column_options!(rename_column_sql, options)
+        execute(rename_column_sql)
       end
 
       # Maps logical Rails types to MySQL-specific data types.
@@ -468,14 +492,12 @@ module ActiveRecord
         return super unless type.to_s == 'integer'
 
         case limit
-        when 0..3
-          &quot;smallint(#{limit})&quot;
-        when 4..8
-          &quot;int(#{limit})&quot;
-        when 9..20
-          &quot;bigint(#{limit})&quot;
-        else
-          'int(11)'
+        when 1; 'tinyint'
+        when 2; 'smallint'
+        when 3; 'mediumint'
+        when nil, 4, 11; 'int(11)'  # compatibility with MySQL default
+        when 5..8; 'bigint'
+        else raise(ActiveRecordError, &quot;No integer type has byte size #{limit}&quot;)
         end
       end
 
@@ -525,6 +547,13 @@ module ActiveRecord
         def version
           @version ||= @connection.server_info.scan(/^(\d+)\.(\d+)\.(\d+)/).flatten.map { |v| v.to_i }
         end
+
+        def column_for(table_name, column_name)
+          unless column = columns(table_name).find { |c| c.name == column_name.to_s }
+            raise &quot;No such column: #{table_name}.#{column_name}&quot;
+          end
+          column
+        end
     end
   end
 end</diff>
      <filename>vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,8 +23,8 @@ module ActiveRecord
       config = config.symbolize_keys
       host     = config[:host]
       port     = config[:port] || 5432
-      username = config[:username].to_s
-      password = config[:password].to_s
+      username = config[:username].to_s if config[:username]
+      password = config[:password].to_s if config[:password]
 
       if config.has_key?(:database)
         database = config[:database]
@@ -47,6 +47,14 @@ module ActiveRecord
       end
 
       private
+        def extract_limit(sql_type)
+          case sql_type
+          when /^bigint/i;    8
+          when /^smallint/i;  2
+          else super
+          end
+        end
+
         # Extracts the scale from PostgreSQL-specific data types.
         def extract_scale(sql_type)
           # Money type has a fixed scale of 2.
@@ -174,8 +182,8 @@ module ActiveRecord
         def self.extract_value_from_default(default)
           case default
             # Numeric types
-            when /\A-?\d+(\.\d*)?\z/
-              default
+            when /\A\(?(-?\d+(\.\d*)?\)?)\z/
+              $1
             # Character types
             when /\A'(.*)'::(?:character varying|bpchar|text)\z/m
               $1
@@ -319,6 +327,10 @@ module ActiveRecord
         has_support
       end
 
+      def supports_insert_with_returning?
+        postgresql_version &gt;= 80200
+      end
+
       # Returns the configured supported identifier length supported by PostgreSQL,
       # or report the default of 63 on PostgreSQL 7.x.
       def table_alias_length
@@ -360,7 +372,7 @@ module ActiveRecord
           # There are some incorrectly compiled postgres drivers out there
           # that don't define PGconn.escape.
           self.class.instance_eval do
-            undef_method(:quote_string)
+            remove_method(:quote_string)
           end
         end
         quote_string(s)
@@ -411,8 +423,34 @@ module ActiveRecord
 
       # Executes an INSERT query and returns the new record's ID
       def insert(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil)
+        # Extract the table from the insert sql. Yuck.
         table = sql.split(&quot; &quot;, 4)[2].gsub('&quot;', '')
-        super || pk &amp;&amp; last_insert_id(table, sequence_name || default_sequence_name(table, pk))
+
+        # Try an insert with 'returning id' if available (PG &gt;= 8.2)
+        if supports_insert_with_returning?
+          pk, sequence_name = *pk_and_sequence_for(table) unless pk
+          if pk
+            id = select_value(&quot;#{sql} RETURNING #{quote_column_name(pk)}&quot;)
+            clear_query_cache
+            return id
+          end
+        end
+
+        # Otherwise, insert then grab last_insert_id.
+        if insert_id = super
+          insert_id
+        else
+          # If neither pk nor sequence name is given, look them up.
+          unless pk || sequence_name
+            pk, sequence_name = *pk_and_sequence_for(table)
+          end
+
+          # If a pk is given, fallback to default sequence name.
+          # Don't fetch last insert id for a table without a pk.
+          if pk &amp;&amp; sequence_name ||= default_sequence_name(table, pk)
+            last_insert_id(table, sequence_name)
+          end
+        end
       end
 
       # create a 2D array representing the result set
@@ -492,13 +530,13 @@ module ActiveRecord
         option_string = options.symbolize_keys.sum do |key, value|
           case key
           when :owner
-            &quot; OWNER = '#{value}'&quot;
+            &quot; OWNER = \&quot;#{value}\&quot;&quot;
           when :template
-            &quot; TEMPLATE = #{value}&quot;
+            &quot; TEMPLATE = \&quot;#{value}\&quot;&quot;
           when :encoding
             &quot; ENCODING = '#{value}'&quot;
           when :tablespace
-            &quot; TABLESPACE = #{value}&quot;
+            &quot; TABLESPACE = \&quot;#{value}\&quot;&quot;
           when :connection_limit
             &quot; CONNECTION LIMIT = #{value}&quot;
           else
@@ -506,7 +544,7 @@ module ActiveRecord
           end
         end
 
-        execute &quot;CREATE DATABASE #{name}#{option_string}&quot;
+        execute &quot;CREATE DATABASE #{quote_table_name(name)}#{option_string}&quot;
       end
 
       # Drops a PostgreSQL database
@@ -514,7 +552,15 @@ module ActiveRecord
       # Example:
       #   drop_database 'matt_development'
       def drop_database(name) #:nodoc:
-        execute &quot;DROP DATABASE IF EXISTS #{name}&quot;
+        if postgresql_version &gt;= 80200
+          execute &quot;DROP DATABASE IF EXISTS #{quote_table_name(name)}&quot;
+        else
+          begin
+            execute &quot;DROP DATABASE #{quote_table_name(name)}&quot;
+          rescue ActiveRecord::StatementInvalid
+            @logger.warn &quot;#{name} database doesn't exist.&quot; if @logger
+          end
+        end
       end
 
 
@@ -676,7 +722,7 @@ module ActiveRecord
 
       # Renames a table.
       def rename_table(name, new_name)
-        execute &quot;ALTER TABLE #{name} RENAME TO #{new_name}&quot;
+        execute &quot;ALTER TABLE #{quote_table_name(name)} RENAME TO #{quote_table_name(new_name)}&quot;
       end
 
       # Adds a new column to the named table.
@@ -698,7 +744,8 @@ module ActiveRecord
 
         begin
           execute &quot;ALTER TABLE #{quoted_table_name} ALTER COLUMN #{quote_column_name(column_name)} TYPE #{type_to_sql(type, options[:limit], options[:precision], options[:scale])}&quot;
-        rescue ActiveRecord::StatementInvalid
+        rescue ActiveRecord::StatementInvalid =&gt; e
+          raise e if postgresql_version &gt; 80000
           # This is PostgreSQL 7.x, so we have to use a more arcane way of doing it.
           begin
             begin_db_transaction
@@ -743,15 +790,14 @@ module ActiveRecord
       def type_to_sql(type, limit = nil, precision = nil, scale = nil)
         return super unless type.to_s == 'integer'
 
-        if limit.nil? || limit == 4
-          'integer'
-        elsif limit &lt; 4
-          'smallint'
-        else
-          'bigint'
+        case limit
+          when 1..2;      'smallint'
+          when 3..4, nil; 'integer'
+          when 5..8;      'bigint'
+          else raise(ActiveRecordError, &quot;No integer type has byte size #{limit}. Use a numeric with precision 0 instead.&quot;)
         end
       end
-      
+
       # Returns a SELECT DISTINCT clause for a given set of columns and a given ORDER BY clause.
       #
       # PostgreSQL requires the ORDER BY columns in the select list for distinct queries, and</diff>
      <filename>vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -238,6 +238,15 @@ module ActiveRecord
         end
       end
 
+      def change_column_null(table_name, column_name, null, default = nil)
+        unless null || default.nil?
+          execute(&quot;UPDATE #{quote_table_name(table_name)} SET #{quote_column_name(column_name)}=#{quote(default)} WHERE #{quote_column_name(column_name)} IS NULL&quot;)
+        end
+        alter_table(table_name) do |definition|
+          definition[column_name].null = null
+        end
+      end
+
       def change_column(table_name, column_name, type, options = {}) #:nodoc:
         alter_table(table_name) do |definition|
           include_default = options_include_default?(options)
@@ -251,6 +260,9 @@ module ActiveRecord
       end
 
       def rename_column(table_name, column_name, new_column_name) #:nodoc:
+        unless columns(table_name).detect{|c| c.name == column_name.to_s }
+          raise ActiveRecord::ActiveRecordError, &quot;Missing column #{table_name}.#{column_name}&quot;
+        end
         alter_table(table_name, :rename =&gt; {column_name.to_s =&gt; new_column_name.to_s})
       end
 </diff>
      <filename>vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -123,7 +123,10 @@ module ActiveRecord
         attr = attr.to_s
 
         # The attribute already has an unsaved change.
-        unless changed_attributes.include?(attr)
+        if changed_attributes.include?(attr)
+          old = changed_attributes[attr]
+          changed_attributes.delete(attr) unless field_changed?(attr, old, value)
+        else
           old = clone_attribute_value(:read_attribute, attr)
           changed_attributes[attr] = old if field_changed?(attr, old, value)
         end
@@ -134,7 +137,9 @@ module ActiveRecord
 
       def update_with_dirty
         if partial_updates?
-          update_without_dirty(changed)
+          # Serialized attributes should always be written in case they've been
+          # changed in place.
+          update_without_dirty(changed | self.class.serialized_attributes.keys)
         else
           update_without_dirty
         end
@@ -142,9 +147,11 @@ module ActiveRecord
 
       def field_changed?(attr, old, value)
         if column = column_for_attribute(attr)
-          if column.type == :integer &amp;&amp; column.null &amp;&amp; old.nil?
+          if column.type == :integer &amp;&amp; column.null &amp;&amp; (old.nil? || old == 0)
             # For nullable integer columns, NULL gets stored in database for blank (i.e. '') values.
             # Hence we don't record it as a change if the value changes from nil to ''.
+            # If an old value of 0 is set to '' we want this to get changed to nil as otherwise it'll
+            # be typecast back to 0 (''.to_i =&gt; 0)
             value = nil if value.blank?
           else
             value = column.type_cast(value)</diff>
      <filename>vendor/rails/activerecord/lib/active_record/dirty.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/activerecord/lib/active_record/fixtures.rb</filename>
    </modified>
    <modified>
      <diff>@@ -68,6 +68,7 @@ module ActiveRecord
 
         def update_with_lock(attribute_names = @attributes.keys) #:nodoc:
           return update_without_lock(attribute_names) unless locking_enabled?
+          return 0 if attribute_names.empty?
 
           lock_col = self.class.locking_column
           previous_value = send(lock_col).to_i</diff>
      <filename>vendor/rails/activerecord/lib/active_record/locking/optimistic.rb</filename>
    </modified>
    <modified>
      <diff>@@ -238,6 +238,22 @@ module ActiveRecord
   # lower than the current schema version: when migrating up, those
   # never-applied &quot;interleaved&quot; migrations will be automatically applied, and
   # when migrating down, never-applied &quot;interleaved&quot; migrations will be skipped.
+  # 
+  # == Timestamped Migrations
+  #
+  # By default, Rails generates migrations that look like:
+  #
+  #    20080717013526_your_migration_name.rb
+  #
+  # The prefix is a generation timestamp (in UTC).
+  #
+  # If you'd prefer to use numeric prefixes, you can turn timestamped migrations
+  # off by setting:
+  #
+  #    config.active_record.timestamped_migrations = false
+  # 
+  # In environment.rb.
+  #
   class Migration
     @@verbose = true
     cattr_accessor :verbose
@@ -369,11 +385,17 @@ module ActiveRecord
         Base.table_name_prefix + 'schema_migrations' + Base.table_name_suffix
       end
 
+      def get_all_versions
+        Base.connection.select_values(&quot;SELECT version FROM #{schema_migrations_table_name}&quot;).map(&amp;:to_i).sort
+      end
+
       def current_version
-        version = Base.connection.select_values(
-          &quot;SELECT version FROM #{schema_migrations_table_name}&quot;
-        ).map(&amp;:to_i).max rescue nil
-        version || 0
+        sm_table = schema_migrations_table_name
+        if Base.connection.table_exists?(sm_table)
+          get_all_versions.max || 0
+        else
+          0
+        end
       end
 
       def proper_table_name(name)
@@ -389,7 +411,7 @@ module ActiveRecord
     end
 
     def current_version
-      self.class.current_version
+      migrated.last || 0
     end
     
     def current_migration
@@ -399,7 +421,10 @@ module ActiveRecord
     def run
       target = migrations.detect { |m| m.version == @target_version }
       raise UnknownMigrationVersionError.new(@target_version) if target.nil?
-      target.migrate(@direction)
+      unless (up? &amp;&amp; migrated.include?(target.version.to_i)) || (down? &amp;&amp; !migrated.include?(target.version.to_i))
+        target.migrate(@direction)
+        record_version_state_after_migrating(target.version)
+      end
     end
 
     def migrate
@@ -470,17 +495,19 @@ module ActiveRecord
     end
 
     def migrated
-      sm_table = self.class.schema_migrations_table_name
-      Base.connection.select_values(&quot;SELECT version FROM #{sm_table}&quot;).map(&amp;:to_i).sort
+      @migrated_versions ||= self.class.get_all_versions
     end
 
     private
       def record_version_state_after_migrating(version)
         sm_table = self.class.schema_migrations_table_name
 
+        @migrated_versions ||= []
         if down?
+          @migrated_versions.delete(version.to_i)
           Base.connection.update(&quot;DELETE FROM #{sm_table} WHERE version = '#{version}'&quot;)
         else
+          @migrated_versions.push(version.to_i).sort!
           Base.connection.insert(&quot;INSERT INTO #{sm_table} (version) VALUES ('#{version}')&quot;)
         end
       end</diff>
      <filename>vendor/rails/activerecord/lib/active_record/migration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -82,6 +82,7 @@ module ActiveRecord
       #   expected_options = { :conditions =&gt; { :colored =&gt; 'red' } }
       #   assert_equal expected_options, Shirt.colored('red').proxy_options
       def named_scope(name, options = {}, &amp;block)
+        name = name.to_sym
         scopes[name] = lambda do |parent_scope, *args|
           Scope.new(parent_scope, case options
             when Hash
@@ -102,7 +103,7 @@ module ActiveRecord
       attr_reader :proxy_scope, :proxy_options
 
       [].methods.each do |m|
-        unless m =~ /(^__|^nil\?|^send|^object_id$|class|extend|find|count|sum|average|maximum|minimum|paginate|first|last|empty?)/
+        unless m =~ /(^__|^nil\?|^send|^object_id$|class|extend|^find$|count|sum|average|maximum|minimum|paginate|first|last|empty\?|respond_to\?)/
           delegate m, :to =&gt; :proxy_found
         end
       end
@@ -139,6 +140,10 @@ module ActiveRecord
         @found ? @found.empty? : count.zero?
       end
 
+      def respond_to?(method, include_private = false)
+        super || @proxy_scope.respond_to?(method, include_private)
+      end
+
       protected
       def proxy_found
         @found || load_found</diff>
      <filename>vendor/rails/activerecord/lib/active_record/named_scope.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@ module ActiveRecord
       #   ActiveRecord::Base.observers = Cacher, GarbageCollector
       #
       # Note: Setting this does not instantiate the observers yet. +instantiate_observers+ is
-      # called during startup, and before each development request.  
+      # called during startup, and before each development request.
       def observers=(*observers)
         @observers = observers.flatten
       end
@@ -130,11 +130,11 @@ module ActiveRecord
   # Observers register themselves in the model class they observe, since it is the class that
   # notifies them of events when they occur. As a side-effect, when an observer is loaded its
   # corresponding model class is loaded.
-  # 
+  #
   # Up to (and including) Rails 2.0.2 observers were instantiated between plugins and
-  # application initializers. Now observers are loaded after application initializers, 
+  # application initializers. Now observers are loaded after application initializers,
   # so observed models can make use of extensions.
-  # 
+  #
   # If by any chance you are using observed models in the initialization you can still
   # load their observers by calling &lt;tt&gt;ModelObserver.instance&lt;/tt&gt; before. Observers are
   # singletons and that call instantiates and registers them.
@@ -189,7 +189,9 @@ module ActiveRecord
 
       def add_observer!(klass)
         klass.add_observer(self)
-        klass.class_eval 'def after_find() end' unless klass.respond_to?(:after_find)
+        if respond_to?(:after_find) &amp;&amp; !klass.method_defined?(:after_find)
+          klass.class_eval 'def after_find() end'
+        end
       end
   end
 end</diff>
      <filename>vendor/rails/activerecord/lib/active_record/observer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,11 +22,22 @@ module ActiveRecord
       end
     end
 
+    def assert_sql(*patterns_to_match)
+      $queries_executed = []
+      yield
+    ensure
+      failed_patterns = []
+      patterns_to_match.each do |pattern|
+        failed_patterns &lt;&lt; pattern unless $queries_executed.any?{ |sql| pattern === sql }
+      end
+      assert failed_patterns.empty?, &quot;Query pattern(s) #{failed_patterns.map(&amp;:inspect).join(', ')} not found.&quot;
+    end
+
     def assert_queries(num = 1)
-      $query_count = 0
+      $queries_executed = []
       yield
     ensure
-      assert_equal num, $query_count, &quot;#{$query_count} instead of #{num} queries were executed.&quot;
+      assert_equal num, $queries_executed.size, &quot;#{$queries_executed.size} instead of #{num} queries were executed.&quot;
     end
 
     def assert_no_queries(&amp;block)</diff>
      <filename>vendor/rails/activerecord/lib/active_record/test_case.rb</filename>
    </modified>
    <modified>
      <diff>@@ -480,8 +480,9 @@ module ActiveRecord
       #     validates_length_of :fax, :in =&gt; 7..32, :allow_nil =&gt; true
       #     validates_length_of :phone, :in =&gt; 7..32, :allow_blank =&gt; true
       #     validates_length_of :user_name, :within =&gt; 6..20, :too_long =&gt; &quot;pick a shorter name&quot;, :too_short =&gt; &quot;pick a longer name&quot;
-      #     validates_length_of :fav_bra_size, :minimum=&gt;1, :too_short=&gt;&quot;please enter at least %d character&quot;
-      #     validates_length_of :smurf_leader, :is=&gt;4, :message=&gt;&quot;papa is spelled with %d characters... don't play me.&quot;
+      #     validates_length_of :fav_bra_size, :minimum =&gt; 1, :too_short =&gt; &quot;please enter at least %d character&quot;
+      #     validates_length_of :smurf_leader, :is =&gt; 4, :message =&gt; &quot;papa is spelled with %d characters... don't play me.&quot;
+      #     validates_length_of :essay, :minimum =&gt; 100, :too_short =&gt; &quot;Your essay must be at least %d words.&quot;), :tokenizer =&gt; lambda {|str| str.scan(/\w+/) }
       #   end
       #
       # Configuration options:
@@ -492,7 +493,6 @@ module ActiveRecord
       # * &lt;tt&gt;:in&lt;/tt&gt; - A synonym(or alias) for &lt;tt&gt;:within&lt;/tt&gt;.
       # * &lt;tt&gt;:allow_nil&lt;/tt&gt; - Attribute may be +nil+; skip validation.
       # * &lt;tt&gt;:allow_blank&lt;/tt&gt; - Attribute may be blank; skip validation.
-      #
       # * &lt;tt&gt;:too_long&lt;/tt&gt; - The error message if the attribute goes over the maximum (default is: &quot;is too long (maximum is %d characters)&quot;).
       # * &lt;tt&gt;:too_short&lt;/tt&gt; - The error message if the attribute goes under the minimum (default is: &quot;is too short (min is %d characters)&quot;).
       # * &lt;tt&gt;:wrong_length&lt;/tt&gt; - The error message if using the &lt;tt&gt;:is&lt;/tt&gt; method and the attribute is the wrong size (default is: &quot;is the wrong length (should be %d characters)&quot;).
@@ -504,12 +504,16 @@ module ActiveRecord
       # * &lt;tt&gt;:unless&lt;/tt&gt; - Specifies a method, proc or string to call to determine if the validation should
       #   not occur (e.g. &lt;tt&gt;:unless =&gt; :skip_validation&lt;/tt&gt;, or &lt;tt&gt;:unless =&gt; Proc.new { |user| user.signup_step &lt;= 2 }&lt;/tt&gt;).  The
       #   method, proc or string should return or evaluate to a true or false value.
+      # * &lt;tt&gt;:tokenizer&lt;/tt&gt; - Specifies how to split up the attribute string. (e.g. &lt;tt&gt;:tokenizer =&gt; lambda {|str| str.scan(/\w+/)}&lt;/tt&gt; to
+      #   count words as in above example.)
+      #   Defaults to &lt;tt&gt;lambda{ |value| value.split(//) }&lt;/tt&gt; which counts individual characters.
       def validates_length_of(*attrs)
         # Merge given options with defaults.
         options = {
           :too_long     =&gt; ActiveRecord::Errors.default_error_messages[:too_long],
           :too_short    =&gt; ActiveRecord::Errors.default_error_messages[:too_short],
-          :wrong_length =&gt; ActiveRecord::Errors.default_error_messages[:wrong_length]
+          :wrong_length =&gt; ActiveRecord::Errors.default_error_messages[:wrong_length],
+          :tokenizer    =&gt; lambda {|value| value.split(//)}
         }.merge(DEFAULT_VALIDATION_OPTIONS)
         options.update(attrs.extract_options!.symbolize_keys)
 
@@ -536,7 +540,7 @@ module ActiveRecord
             too_long  = options[:too_long]  % option_value.end
 
             validates_each(attrs, options) do |record, attr, value|
-              value = value.split(//) if value.kind_of?(String)
+              value = options[:tokenizer].call(value) if value.kind_of?(String)
               if value.nil? or value.size &lt; option_value.begin
                 record.errors.add(attr, too_short)
               elsif value.size &gt; option_value.end
@@ -553,7 +557,7 @@ module ActiveRecord
             message = (options[:message] || options[message_options[option]]) % option_value
 
             validates_each(attrs, options) do |record, attr, value|
-              value = value.split(//) if value.kind_of?(String)
+              value = options[:tokenizer].call(value) if value.kind_of?(String)
               record.errors.add(attr, message) unless !value.nil? and value.size.method(validity_checks[option])[option_value]
             end
         end
@@ -614,14 +618,20 @@ module ActiveRecord
           # class (which has a database table to query from).
           finder_class = class_hierarchy.detect { |klass| !klass.abstract_class? }
 
-          if value.nil? || (configuration[:case_sensitive] || !finder_class.columns_hash[attr_name.to_s].text?)
+          is_text_column = finder_class.columns_hash[attr_name.to_s].text?
+
+          if !value.nil? &amp;&amp; is_text_column
+            value = value.to_s
+          end
+
+          if value.nil? || (configuration[:case_sensitive] || !is_text_column)
             condition_sql = &quot;#{record.class.quoted_table_name}.#{attr_name} #{attribute_condition(value)}&quot;
             condition_params = [value]
           else
             # sqlite has case sensitive SELECT query, while MySQL/Postgresql don't.
             # Hence, this is needed only for sqlite.
             condition_sql = &quot;LOWER(#{record.class.quoted_table_name}.#{attr_name}) #{attribute_condition(value)}&quot;
-            condition_params = [value.downcase]
+            condition_params = [value.chars.downcase]
           end
 
           if scope = configuration[:scope]
@@ -851,7 +861,7 @@ module ActiveRecord
             raw_value = raw_value.to_i
           else
            begin
-              raw_value = Kernel.Float(raw_value.to_s)
+              raw_value = Kernel.Float(raw_value)
             rescue ArgumentError, TypeError
               record.errors.add(attr_name, configuration[:message] || ActiveRecord::Errors.default_error_messages[:not_a_number])
               next</diff>
      <filename>vendor/rails/activerecord/lib/active_record/validations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ module ActiveRecord
   module VERSION #:nodoc:
     MAJOR = 2
     MINOR = 1
-    TINY  = 0
+    TINY  = 1
 
     STRING = [MAJOR, MINOR, TINY].join('.')
   end</diff>
      <filename>vendor/rails/activerecord/lib/active_record/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,8 +13,8 @@ class PostgresqlActiveSchemaTest &lt; Test::Unit::TestCase
   end
 
   def test_create_database_with_encoding
-    assert_equal &quot;CREATE DATABASE matt ENCODING = 'utf8'&quot;, create_database(:matt)
-    assert_equal &quot;CREATE DATABASE aimonetti ENCODING = 'latin1'&quot;, create_database(:aimonetti, :encoding =&gt; :latin1)
+    assert_equal %(CREATE DATABASE &quot;matt&quot; ENCODING = 'utf8'), create_database(:matt)
+    assert_equal %(CREATE DATABASE &quot;aimonetti&quot; ENCODING = 'latin1'), create_database(:aimonetti, :encoding =&gt; :latin1)
   end
 
   private</diff>
      <filename>vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb</filename>
    </modified>
    <modified>
      <diff>@@ -118,7 +118,7 @@ class AdapterTest &lt; ActiveRecord::TestCase
     sql_inject = &quot;1, 7 procedure help()&quot;
     if current_adapter?(:MysqlAdapter)
       assert_equal &quot; LIMIT 1,7&quot;, @connection.add_limit_offset!(&quot;&quot;, :limit=&gt;sql_inject)
-      assert_equal &quot; LIMIT 7, 1&quot;, @connection.add_limit_offset!(&quot;&quot;, :limit=&gt;sql_inject, :offset=&gt;7)
+      assert_equal &quot; LIMIT 7, 1&quot;, @connection.add_limit_offset!(&quot;&quot;, :limit=&gt; '1 ; DROP TABLE USERS', :offset=&gt;7)
     else
       assert_equal &quot; LIMIT 1,7&quot;, @connection.add_limit_offset!(&quot;&quot;, :limit=&gt;sql_inject)
       assert_equal &quot; LIMIT 1,7 OFFSET 7&quot;, @connection.add_limit_offset!(&quot;&quot;, :limit=&gt;sql_inject, :offset=&gt;7)</diff>
      <filename>vendor/rails/activerecord/test/cases/adapter_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -409,4 +409,23 @@ class BelongsToAssociationsTest &lt; ActiveRecord::TestCase
     sponsor.sponsorable = new_member
     assert_equal nil, sponsor.sponsorable_id
   end
+
+  def test_save_fails_for_invalid_belongs_to
+    assert log = AuditLog.create(:developer_id=&gt;0,:message=&gt;&quot;&quot;)
+
+    log.developer = Developer.new
+    assert !log.developer.valid?
+    assert !log.valid?
+    assert !log.save
+    assert_equal &quot;is invalid&quot;, log.errors.on(&quot;developer&quot;)
+  end
+
+  def test_save_succeeds_for_invalid_belongs_to_with_validate_false
+    assert log = AuditLog.create(:developer_id=&gt;0,:message=&gt;&quot;&quot;)
+
+    log.unvalidated_developer = Developer.new
+    assert !log.unvalidated_developer.valid?
+    assert log.valid?
+    assert log.save
+  end
 end</diff>
      <filename>vendor/rails/activerecord/test/cases/associations/belongs_to_associations_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,7 @@ require 'models/topic'
 require 'models/reply'
 
 class CascadedEagerLoadingTest &lt; ActiveRecord::TestCase
-  fixtures :authors, :mixins, :companies, :posts, :topics
+  fixtures :authors, :mixins, :companies, :posts, :topics, :accounts, :comments, :categorizations
 
   def test_eager_association_loading_with_cascaded_two_levels
     authors = Author.find(:all, :include=&gt;{:posts=&gt;:comments}, :order=&gt;&quot;authors.id&quot;)
@@ -68,6 +68,18 @@ class CascadedEagerLoadingTest &lt; ActiveRecord::TestCase
     end
   end
 
+  def test_eager_association_loading_with_has_many_sti_and_subclasses
+    silly = SillyReply.new(:title =&gt; &quot;gaga&quot;, :content =&gt; &quot;boo-boo&quot;, :parent_id =&gt; 1)
+    silly.parent_id = 1
+    assert silly.save
+
+    topics = Topic.find(:all, :include =&gt; :replies, :order =&gt; 'topics.id, replies_topics.id')
+    assert_no_queries do
+      assert_equal 2, topics[0].replies.size
+      assert_equal 0, topics[1].replies.size
+    end
+  end
+
   def test_eager_association_loading_with_belongs_to_sti
     replies = Reply.find(:all, :include =&gt; :topic, :order =&gt; 'topics.id')
     assert replies.include?(topics(:second))</diff>
      <filename>vendor/rails/activerecord/test/cases/associations/cascaded_eager_loading_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,11 +14,14 @@ require 'models/job'
 require 'models/subscriber'
 require 'models/subscription'
 require 'models/book'
+require 'models/developer'
+require 'models/project'
 
 class EagerAssociationTest &lt; ActiveRecord::TestCase
   fixtures :posts, :comments, :authors, :categories, :categories_posts,
             :companies, :accounts, :tags, :taggings, :people, :readers,
-            :owners, :pets, :author_favorites, :jobs, :references, :subscribers, :subscriptions, :books
+            :owners, :pets, :author_favorites, :jobs, :references, :subscribers, :subscriptions, :books,
+            :developers, :projects, :developers_projects
 
   def test_loading_with_one_association
     posts = Post.find(:all, :include =&gt; :comments)
@@ -35,6 +38,12 @@ class EagerAssociationTest &lt; ActiveRecord::TestCase
     assert_equal Post.find(1).last_comment, post.last_comment
   end
 
+  def test_loading_with_one_association_with_non_preload
+    posts = Post.find(:all, :include =&gt; :last_comment, :order =&gt; 'comments.id DESC')
+    post = posts.find { |p| p.id == 1 }
+    assert_equal Post.find(1).last_comment, post.last_comment
+  end
+
   def test_loading_conditions_with_or
     posts = authors(:david).posts.find(:all, :include =&gt; :comments, :conditions =&gt; &quot;comments.body like 'Normal%' OR comments.#{QUOTED_TYPE} = 'SpecialComment'&quot;)
     assert_nil posts.detect { |p| p.author_id != authors(:david).id },
@@ -556,6 +565,13 @@ class EagerAssociationTest &lt; ActiveRecord::TestCase
     assert_nothing_raised { Post.find(:all, :include =&gt; 'comments') }
   end
 
+  def test_eager_with_floating_point_numbers
+    assert_queries(2) do
+      # Before changes, the floating point numbers will be interpreted as table names and will cause this to run in one query
+      Comment.find :all, :conditions =&gt; &quot;123.456 = 123.456&quot;, :include =&gt; :post
+    end
+  end
+
   def test_preconfigured_includes_with_belongs_to
     author = posts(:welcome).author_with_posts
     assert_no_queries {assert_equal 5, author.posts.size}
@@ -609,4 +625,12 @@ class EagerAssociationTest &lt; ActiveRecord::TestCase
       Comment.find :all, :include =&gt; :post
     end
   end
+
+  def test_conditions_on_join_table_with_include_and_limit
+    assert_equal 3, Developer.find(:all, :include =&gt; 'projects', :conditions =&gt; 'developers_projects.access_level = 1', :limit =&gt; 5).size
+  end
+
+  def test_order_on_join_table_with_include_and_limit
+    assert_equal 5, Developer.find(:all, :include =&gt; 'projects', :order =&gt; 'developers_projects.joined_on DESC', :limit =&gt; 5).size
+  end
 end</diff>
      <filename>vendor/rails/activerecord/test/cases/associations/eager_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -70,7 +70,7 @@ end
 
 class HasAndBelongsToManyAssociationsTest &lt; ActiveRecord::TestCase
   fixtures :accounts, :companies, :categories, :posts, :categories_posts, :developers, :projects, :developers_projects,
-           :parrots, :pirates, :treasures, :price_estimates
+           :parrots, :pirates, :treasures, :price_estimates, :tags, :taggings
 
   def test_has_and_belongs_to_many
     david = Developer.find(1)
@@ -299,6 +299,17 @@ class HasAndBelongsToManyAssociationsTest &lt; ActiveRecord::TestCase
     assert_equal 3, projects(:active_record, :reload).developers.size
   end
 
+  def test_uniq_option_prevents_duplicate_push
+    project = projects(:active_record)
+    project.developers &lt;&lt; developers(:jamis)
+    project.developers &lt;&lt; developers(:david)
+    assert_equal 3, project.developers.size
+
+    project.developers &lt;&lt; developers(:david)
+    project.developers &lt;&lt; developers(:jamis)
+    assert_equal 3, project.developers.size
+  end
+
   def test_deleting
     david = Developer.find(1)
     active_record = Project.find(1)
@@ -439,6 +450,13 @@ class HasAndBelongsToManyAssociationsTest &lt; ActiveRecord::TestCase
     assert_equal developers(:david), active_record.developers_with_finder_sql.find(developers(:david).id), &quot;Ruby find&quot;
   end
 
+  def test_find_in_association_with_custom_finder_sql_and_multiple_interpolations
+    # interpolate once:
+    assert_equal [developers(:david), developers(:jamis), developers(:poor_jamis)], projects(:active_record).developers_with_finder_sql, &quot;first interpolation&quot;
+    # interpolate again, for a different project id
+    assert_equal [developers(:david)], projects(:action_controller).developers_with_finder_sql, &quot;second interpolation&quot;
+  end
+
   def test_find_in_association_with_custom_finder_sql_and_string_id
     assert_equal developers(:david), projects(:active_record).developers_with_finder_sql.find(developers(:david).id.to_s), &quot;SQL find&quot;
   end
@@ -629,8 +647,7 @@ class HasAndBelongsToManyAssociationsTest &lt; ActiveRecord::TestCase
     developer.save
     developer.reload
     assert_equal 2, developer.projects.length
-    assert_equal projects(:active_record), developer.projects[0]
-    assert_equal projects(:action_controller), developer.projects[1]
+    assert_equal [projects(:active_record), projects(:action_controller)].map(&amp;:id).sort, developer.project_ids.sort
   end
 
   def test_assign_ids_ignoring_blanks
@@ -639,8 +656,7 @@ class HasAndBelongsToManyAssociationsTest &lt; ActiveRecord::TestCase
     developer.save
     developer.reload
     assert_equal 2, developer.projects.length
-    assert_equal projects(:active_record), developer.projects[0]
-    assert_equal projects(:action_controller), developer.projects[1]
+    assert_equal [projects(:active_record), projects(:action_controller)].map(&amp;:id).sort, developer.project_ids.sort
   end
 
   def test_select_limited_ids_list
@@ -681,4 +697,10 @@ class HasAndBelongsToManyAssociationsTest &lt; ActiveRecord::TestCase
     assert_equal developer, project.developers.find(:first)
     assert_equal project, developer.projects.find(:first)
   end
+
+  def test_dynamic_find_should_respect_association_include
+    # SQL error in sort clause if :include is not included
+    # due to Unknown column 'authors.id'
+    assert Category.find(1).posts_with_authors_sorted_by_author_id.find_by_title('Welcome to the weblog')
+  end
 end</diff>
      <filename>vendor/rails/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,7 @@ require 'models/reader'
 class HasManyAssociationsTest &lt; ActiveRecord::TestCase
   fixtures :accounts, :categories, :companies, :developers, :projects,
            :developers_projects, :topics, :authors, :comments, :author_addresses,
-           :people, :posts
+           :people, :posts, :readers
 
   def setup
     Client.destroyed_client_ids.clear
@@ -37,15 +37,21 @@ class HasManyAssociationsTest &lt; ActiveRecord::TestCase
   end
 
   def test_counting_with_single_conditions
-    assert_equal 2, Firm.find(:first).plain_clients.count(:conditions =&gt; '1=1')
+    assert_equal 1, Firm.find(:first).plain_clients.count(:conditions =&gt; ['name=?', &quot;Microsoft&quot;])
   end
 
   def test_counting_with_single_hash
-    assert_equal 2, Firm.find(:first).plain_clients.count(:conditions =&gt; '1=1')
+    assert_equal 1, Firm.find(:first).plain_clients.count(:conditions =&gt; {:name =&gt; &quot;Microsoft&quot;})
   end
 
   def test_counting_with_column_name_and_hash
-    assert_equal 2, Firm.find(:first).plain_clients.count(:all, :conditions =&gt; '1=1')
+    assert_equal 2, Firm.find(:first).plain_clients.count(:name)
+  end
+
+  def test_counting_with_association_limit
+    firm = companies(:first_firm)
+    assert_equal firm.limited_clients.length, firm.limited_clients.size
+    assert_equal firm.limited_clients.length, firm.limited_clients.count
   end
 
   def test_finding
@@ -342,6 +348,34 @@ class HasManyAssociationsTest &lt; ActiveRecord::TestCase
     assert new_firm.new_record?
   end
 
+  def test_invalid_adding_with_validate_false
+    firm = Firm.find(:first)
+    client = Client.new
+    firm.unvalidated_clients_of_firm &lt;&lt; client
+
+    assert firm.valid?
+    assert !client.valid?
+    assert firm.save
+    assert client.new_record?
+  end
+
+  def test_valid_adding_with_validate_false
+    no_of_clients = Client.count
+
+    firm = Firm.find(:first)
+    client = Client.new(&quot;name&quot; =&gt; &quot;Apple&quot;)
+
+    assert firm.valid?
+    assert client.valid?
+    assert client.new_record?
+
+    firm.unvalidated_clients_of_firm &lt;&lt; client
+
+    assert firm.save
+    assert !client.new_record?
+    assert_equal no_of_clients+1, Client.count
+  end
+
   def test_build
     company = companies(:first_firm)
     new_client = assert_no_queries { company.clients_of_firm.build(&quot;name&quot; =&gt; &quot;Another Client&quot;) }
@@ -356,6 +390,25 @@ class HasManyAssociationsTest &lt; ActiveRecord::TestCase
     assert_equal 2, company.clients_of_firm(true).size
   end
 
+  def test_collection_size_after_building
+    company = companies(:first_firm)  # company already has one client
+    company.clients_of_firm.build(&quot;name&quot; =&gt; &quot;Another Client&quot;)
+    company.clients_of_firm.build(&quot;name&quot; =&gt; &quot;Yet Another Client&quot;)
+    assert_equal 3, company.clients_of_firm.size
+  end
+
+  def test_collection_size_twice_for_regressions
+    post = posts(:thinking)
+    assert_equal 0, post.readers.size
+    # This test needs a post that has no readers, we assert it to ensure it holds,
+    # but need to reload the post because the very call to #size hides the bug.
+    post.reload
+    post.readers.build
+    size1 = post.readers.size
+    size2 = post.readers.size
+    assert_equal size1, size2
+  end
+
   def test_build_many
     company = companies(:first_firm)
     new_clients = assert_no_queries { company.clients_of_firm.build([{&quot;name&quot; =&gt; &quot;Another Client&quot;}, {&quot;name&quot; =&gt; &quot;Another Client II&quot;}]) }
@@ -386,6 +439,37 @@ class HasManyAssociationsTest &lt; ActiveRecord::TestCase
     assert_equal 2, first_topic.replies.to_ary.size
   end
 
+  def test_build_via_block
+    company = companies(:first_firm)
+    new_client = assert_no_queries { company.clients_of_firm.build {|client| client.name = &quot;Another Client&quot; } }
+    assert !company.clients_of_firm.loaded?
+
+    assert_equal &quot;Another Client&quot;, new_client.name
+    assert new_client.new_record?
+    assert_equal new_client, company.clients_of_firm.last
+    company.name += '-changed'
+    assert_queries(2) { assert company.save }
+    assert !new_client.new_record?
+    assert_equal 2, company.clients_of_firm(true).size
+  end
+
+  def test_build_many_via_block
+    company = companies(:first_firm)
+    new_clients = assert_no_queries do
+      company.clients_of_firm.build([{&quot;name&quot; =&gt; &quot;Another Client&quot;}, {&quot;name&quot; =&gt; &quot;Another Client II&quot;}]) do |client|
+        client.name = &quot;changed&quot;
+      end
+    end
+
+    assert_equal 2, new_clients.size
+    assert_equal &quot;changed&quot;, new_clients.first.name
+    assert_equal &quot;changed&quot;, new_clients.last.name
+
+    company.name += '-changed'
+    assert_queries(3) { assert company.save }
+    assert_equal 3, company.clients_of_firm(true).size
+  end
+
   def test_create_without_loading_association
     first_firm  = companies(:first_firm)
     Firm.column_names
@@ -929,4 +1013,22 @@ class HasManyAssociationsTest &lt; ActiveRecord::TestCase
     assert firm.clients.loaded?
   end
 
+  def test_joins_with_namespaced_model_should_use_correct_type
+    old = ActiveRecord::Base.store_full_sti_class
+    ActiveRecord::Base.store_full_sti_class = true
+
+    firm = Namespaced::Firm.create({ :name =&gt; 'Some Company' })
+    firm.clients.create({ :name =&gt; 'Some Client' })
+
+    stats = Namespaced::Firm.find(firm.id, {
+      :select =&gt; &quot;#{Namespaced::Firm.table_name}.id, COUNT(#{Namespaced::Client.table_name}.id) AS num_clients&quot;,
+      :joins  =&gt; :clients,
+      :group  =&gt; &quot;#{Namespaced::Firm.table_name}.id&quot;
+    })
+    assert_equal 1, stats.num_clients.to_i
+
+  ensure
+    ActiveRecord::Base.store_full_sti_class = old
+  end
+
 end</diff>
      <filename>vendor/rails/activerecord/test/cases/associations/has_many_associations_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -187,4 +187,14 @@ class HasManyThroughAssociationsTest &lt; ActiveRecord::TestCase
     post.people_with_callbacks.clear
     assert_equal (%w(Michael David Julian Roger) * 2).sort, log.last(8).collect(&amp;:last).sort
   end
+
+  def test_dynamic_find_should_respect_association_include
+    # SQL error in sort clause if :include is not included
+    # due to Unknown column 'comments.id'
+    assert Person.find(1).posts_with_comments_sorted_by_comment_id.find_by_title('Welcome to the weblog')
+  end
+
+  def test_count_with_include_should_alias_join_table
+    assert_equal 2, people(:michael).posts.count(:include =&gt; :readers)
+  end
 end</diff>
      <filename>vendor/rails/activerecord/test/cases/associations/has_many_through_associations_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -72,6 +72,16 @@ class HasOneAssociationsTest &lt; ActiveRecord::TestCase
     assert_raises(ActiveRecord::RecordNotFound) { Account.find(old_account_id) }
   end
 
+  def test_natural_assignment_to_already_associated_record
+    company = companies(:first_firm)
+    account = accounts(:signals37)
+    assert_equal company.account, account
+    company.account = account
+    company.reload
+    account.reload
+    assert_equal company.account, account
+  end
+
   def test_assignment_without_replacement
     apple = Firm.create(&quot;name&quot; =&gt; &quot;Apple&quot;)
     citibank = Account.create(&quot;credit_limit&quot; =&gt; 10)
@@ -275,6 +285,18 @@ class HasOneAssociationsTest &lt; ActiveRecord::TestCase
     assert_equal &quot;is invalid&quot;, firm.errors.on(&quot;account&quot;)
   end
 
+
+  def test_save_succeeds_for_invalid_has_one_with_validate_false
+    firm = Firm.find(:first)
+    assert firm.valid?
+
+    firm.unvalidated_account = Account.new
+
+    assert !firm.unvalidated_account.valid?
+    assert firm.valid?
+    assert firm.save
+  end
+
   def test_assignment_before_either_saved
     firm = Firm.new(&quot;name&quot; =&gt; &quot;GlobalMegaCorp&quot;)
     firm.account = a = Account.new(&quot;credit_limit&quot; =&gt; 1000)</diff>
      <filename>vendor/rails/activerecord/test/cases/associations/has_one_associations_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -44,19 +44,23 @@ class HasOneThroughAssociationsTest &lt; ActiveRecord::TestCase
   def test_has_one_through_polymorphic
     assert_equal clubs(:moustache_club), @member.sponsor_club
   end
-  
+
   def has_one_through_to_has_many
     assert_equal 2, @member.fellow_members.size
   end
-  
+
   def test_has_one_through_eager_loading
-    members = Member.find(:all, :include =&gt; :club, :conditions =&gt; [&quot;name = ?&quot;, &quot;Groucho Marx&quot;])
+    members = assert_queries(3) do #base table, through table, clubs table
+      Member.find(:all, :include =&gt; :club, :conditions =&gt; [&quot;name = ?&quot;, &quot;Groucho Marx&quot;])
+    end
     assert_equal 1, members.size
     assert_not_nil assert_no_queries {members[0].club}
   end
-  
+
   def test_has_one_through_eager_loading_through_polymorphic
-    members = Member.find(:all, :include =&gt; :sponsor_club, :conditions =&gt; [&quot;name = ?&quot;, &quot;Groucho Marx&quot;])
+    members = assert_queries(3) do #base table, through table, clubs table
+      Member.find(:all, :include =&gt; :sponsor_club, :conditions =&gt; [&quot;name = ?&quot;, &quot;Groucho Marx&quot;])
+    end
     assert_equal 1, members.size
     assert_not_nil assert_no_queries {members[0].sponsor_club}    
   end
@@ -71,4 +75,39 @@ class HasOneThroughAssociationsTest &lt; ActiveRecord::TestCase
     assert_not_nil assert_no_queries {clubs[0].sponsored_member}
   end
 
+  def test_has_one_through_nonpreload_eagerloading
+    members = assert_queries(1) do
+      Member.find(:all, :include =&gt; :club, :conditions =&gt; [&quot;members.name = ?&quot;, &quot;Groucho Marx&quot;], :order =&gt; 'clubs.name') #force fallback
+    end
+    assert_equal 1, members.size
+    assert_not_nil assert_no_queries {members[0].club}
+  end
+
+  def test_has_one_through_nonpreload_eager_loading_through_polymorphic
+    members = assert_queries(1) do
+      Member.find(:all, :include =&gt; :sponsor_club, :conditions =&gt; [&quot;members.name = ?&quot;, &quot;Groucho Marx&quot;], :order =&gt; 'clubs.name') #force fallback
+    end
+    assert_equal 1, members.size
+    assert_not_nil assert_no_queries {members[0].sponsor_club}
+  end
+
+  def test_has_one_through_nonpreload_eager_loading_through_polymorphic_with_more_than_one_through_record
+    Sponsor.new(:sponsor_club =&gt; clubs(:crazy_club), :sponsorable =&gt; members(:groucho)).save!
+    members = assert_queries(1) do
+      Member.find(:all, :include =&gt; :sponsor_club, :conditions =&gt; [&quot;members.name = ?&quot;, &quot;Groucho Marx&quot;], :order =&gt; 'clubs.name DESC') #force fallback
+    end
+    assert_equal 1, members.size
+    assert_not_nil assert_no_queries { members[0].sponsor_club }
+    assert_equal clubs(:crazy_club), members[0].sponsor_club
+  end
+
+  def test_uninitialized_has_one_through_should_return_nil_for_unsaved_record
+    assert_nil Member.new.club
+  end
+
+  def test_assigning_association_correctly_assigns_target
+    new_member = Member.create(:name =&gt; &quot;Chris&quot;)
+    new_member.club = new_club = Club.create(:name =&gt; &quot;LRUG&quot;)
+    assert_equal new_club, new_member.club.target
+  end
 end</diff>
      <filename>vendor/rails/activerecord/test/cases/associations/has_one_through_associations_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -694,6 +694,13 @@ class AssociationsJoinModelTest &lt; ActiveRecord::TestCase
     assert ! david.categories.include?(category)
   end
 
+  def test_has_many_through_goes_through_all_sti_classes
+    sub_sti_post = SubStiPost.create!(:title =&gt; 'test', :body =&gt; 'test', :author_id =&gt; 1)
+    new_comment = sub_sti_post.comments.create(:body =&gt; 'test')
+
+    assert_equal [9, 10, new_comment.id], authors(:david).sti_post_comments.map(&amp;:id).sort
+  end
+
   private
     # create dynamic Post models to allow different dependency options
     def find_post_with_dependency(post_id, association, association_name, dependency)</diff>
      <filename>vendor/rails/activerecord/test/cases/associations/join_model_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,7 +27,7 @@ require 'models/sponsor'
 
 class AssociationsTest &lt; ActiveRecord::TestCase
   fixtures :accounts, :companies, :developers, :projects, :developers_projects,
-           :computers
+           :computers, :people, :readers
 
   def test_include_with_order_works
     assert_nothing_raised {Account.find(:first, :order =&gt; 'id', :include =&gt; :firm)}
@@ -45,7 +45,7 @@ class AssociationsTest &lt; ActiveRecord::TestCase
     assert_equal [], person.readers.find(:all)
     person.save!
     reader = Reader.create! :person =&gt; person, :post =&gt; Post.new(:title =&gt; &quot;foo&quot;, :body =&gt; &quot;bar&quot;)
-    assert_equal [reader], person.readers.find(:all)
+    assert person.readers.find(reader.id)
   end
 
   def test_force_reload</diff>
      <filename>vendor/rails/activerecord/test/cases/associations_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -137,7 +137,7 @@ class AttributeMethodsTest &lt; ActiveRecord::TestCase
       end
     end
   end
-  
+
   def test_time_attributes_are_retrieved_in_current_time_zone
     in_time_zone &quot;Pacific Time (US &amp; Canada)&quot; do
       utc_time = Time.utc(2008, 1, 1)
@@ -145,7 +145,7 @@ class AttributeMethodsTest &lt; ActiveRecord::TestCase
       record[:written_on] = utc_time
       assert_equal utc_time, record.written_on # record.written on is equal to (i.e., simultaneous with) utc_time
       assert_kind_of ActiveSupport::TimeWithZone, record.written_on # but is a TimeWithZone
-      assert_equal TimeZone[&quot;Pacific Time (US &amp; Canada)&quot;], record.written_on.time_zone # and is in the current Time.zone
+      assert_equal ActiveSupport::TimeZone[&quot;Pacific Time (US &amp; Canada)&quot;], record.written_on.time_zone # and is in the current Time.zone
       assert_equal Time.utc(2007, 12, 31, 16), record.written_on.time # and represents time values adjusted accordingly
     end
   end
@@ -156,7 +156,7 @@ class AttributeMethodsTest &lt; ActiveRecord::TestCase
       record   = @target.new
       record.written_on = utc_time
       assert_equal utc_time, record.written_on
-      assert_equal TimeZone[&quot;Pacific Time (US &amp; Canada)&quot;], record.written_on.time_zone
+      assert_equal ActiveSupport::TimeZone[&quot;Pacific Time (US &amp; Canada)&quot;], record.written_on.time_zone
       assert_equal Time.utc(2007, 12, 31, 16), record.written_on.time
     end
   end
@@ -168,7 +168,7 @@ class AttributeMethodsTest &lt; ActiveRecord::TestCase
       record   = @target.new
       record.written_on = cst_time
       assert_equal utc_time, record.written_on
-      assert_equal TimeZone[&quot;Pacific Time (US &amp; Canada)&quot;], record.written_on.time_zone
+      assert_equal ActiveSupport::TimeZone[&quot;Pacific Time (US &amp; Canada)&quot;], record.written_on.time_zone
       assert_equal Time.utc(2007, 12, 31, 16), record.written_on.time
     end
   end
@@ -181,12 +181,12 @@ class AttributeMethodsTest &lt; ActiveRecord::TestCase
         record   = @target.new
         record.written_on = time_string
         assert_equal Time.zone.parse(time_string), record.written_on
-        assert_equal TimeZone[&quot;Pacific Time (US &amp; Canada)&quot;], record.written_on.time_zone
+        assert_equal ActiveSupport::TimeZone[&quot;Pacific Time (US &amp; Canada)&quot;], record.written_on.time_zone
         assert_equal Time.utc(2007, 12, 31, 16), record.written_on.time
       end
     end
   end
-  
+
   def test_setting_time_zone_aware_attribute_to_blank_string_returns_nil
     in_time_zone &quot;Pacific Time (US &amp; Canada)&quot; do
       record   = @target.new
@@ -202,7 +202,7 @@ class AttributeMethodsTest &lt; ActiveRecord::TestCase
         record   = @target.new
         record.written_on = time_string
         assert_equal Time.zone.parse(time_string), record.written_on
-        assert_equal TimeZone[timezone_offset], record.written_on.time_zone
+        assert_equal ActiveSupport::TimeZone[timezone_offset], record.written_on.time_zone
         assert_equal Time.utc(2008, 1, 1), record.written_on.time
       end
     end
@@ -214,7 +214,7 @@ class AttributeMethodsTest &lt; ActiveRecord::TestCase
       record   = @target.new
       record.written_on = utc_time.in_time_zone
       assert_equal utc_time, record.written_on
-      assert_equal TimeZone[&quot;Pacific Time (US &amp; Canada)&quot;], record.written_on.time_zone
+      assert_equal ActiveSupport::TimeZone[&quot;Pacific Time (US &amp; Canada)&quot;], record.written_on.time_zone
       assert_equal Time.utc(2007, 12, 31, 16), record.written_on.time
     end
   end
@@ -223,12 +223,12 @@ class AttributeMethodsTest &lt; ActiveRecord::TestCase
   def time_related_columns_on_topic
     Topic.columns.select{|c| [:time, :date, :datetime, :timestamp].include?(c.type)}.map(&amp;:name)
   end
-  
+
   def in_time_zone(zone)
     old_zone  = Time.zone
     old_tz    = ActiveRecord::Base.time_zone_aware_attributes
 
-    Time.zone = zone ? TimeZone[zone] : nil
+    Time.zone = zone ? ActiveSupport::TimeZone[zone] : nil
     ActiveRecord::Base.time_zone_aware_attributes = !zone.nil?
     yield
   ensure</diff>
      <filename>vendor/rails/activerecord/test/cases/attribute_methods_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,7 @@ require 'models/warehouse_thing'
 require 'rexml/document'
 
 class Category &lt; ActiveRecord::Base; end
+class Categorization &lt; ActiveRecord::Base; end
 class Smarts &lt; ActiveRecord::Base; end
 class CreditCard &lt; ActiveRecord::Base
   class PinNumber &lt; ActiveRecord::Base
@@ -75,7 +76,7 @@ class TopicWithProtectedContentAndAccessibleAuthorName &lt; ActiveRecord::Base
 end
 
 class BasicsTest &lt; ActiveRecord::TestCase
-  fixtures :topics, :companies, :developers, :projects, :computers, :accounts, :minimalistics, 'warehouse-things', :authors
+  fixtures :topics, :companies, :developers, :projects, :computers, :accounts, :minimalistics, 'warehouse-things', :authors, :categorizations, :categories
 
   def test_table_exists
     assert !NonExistentTable.table_exists?
@@ -130,22 +131,22 @@ class BasicsTest &lt; ActiveRecord::TestCase
 
   def test_read_attributes_before_type_cast
     category = Category.new({:name=&gt;&quot;Test categoty&quot;, :type =&gt; nil})
-    category_attrs = {&quot;name&quot;=&gt;&quot;Test categoty&quot;, &quot;type&quot; =&gt; nil}
+    category_attrs = {&quot;name&quot;=&gt;&quot;Test categoty&quot;, &quot;type&quot; =&gt; nil, &quot;categorizations_count&quot; =&gt; nil}
     assert_equal category_attrs , category.attributes_before_type_cast
   end
-  
+
   if current_adapter?(:MysqlAdapter)
     def test_read_attributes_before_type_cast_on_boolean
       bool = Booleantest.create({ &quot;value&quot; =&gt; false })
       assert_equal 0, bool.attributes_before_type_cast[&quot;value&quot;]
     end
   end
-  
+
   def test_read_attributes_before_type_cast_on_datetime
     developer = Developer.find(:first)
     assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast[&quot;created_at&quot;]
   end
-  
+
   def test_hash_content
     topic = Topic.new
     topic.content = { &quot;one&quot; =&gt; 1, &quot;two&quot; =&gt; 2 }
@@ -251,7 +252,7 @@ class BasicsTest &lt; ActiveRecord::TestCase
     topic = Topic.create(&quot;title&quot; =&gt; &quot;New Topic&quot;)
     topicReloaded = Topic.find(topic.id)
     assert_equal(topic, topicReloaded)
-  end  
+  end
 
   def test_create_through_factory_with_block
     topic = Topic.create(&quot;title&quot; =&gt; &quot;New Topic&quot;) do |t|
@@ -576,7 +577,7 @@ class BasicsTest &lt; ActiveRecord::TestCase
   def test_destroy_all
     original_count = Topic.count
     topics_by_mary = Topic.count(:conditions =&gt; mary = &quot;author_name = 'Mary'&quot;)
-    
+
     Topic.destroy_all mary
     assert_equal original_count - topics_by_mary, Topic.count
   end
@@ -614,6 +615,22 @@ class BasicsTest &lt; ActiveRecord::TestCase
     assert_equal -2, Topic.find(2).replies_count
   end
 
+  def test_update_counter
+    category = categories(:general)
+    assert_nil category.categorizations_count
+    assert_equal 2, category.categorizations.count
+
+    Category.update_counters(category.id, &quot;categorizations_count&quot; =&gt; category.categorizations.count)
+    category.reload
+    assert_not_nil category.categorizations_count
+    assert_equal 2, category.categorizations_count
+
+    Category.update_counters(category.id, &quot;categorizations_count&quot; =&gt; category.categorizations.count)
+    category.reload
+    assert_not_nil category.categorizations_count
+    assert_equal 4, category.categorizations_count
+  end
+
   def test_update_all
     assert_equal Topic.count, Topic.update_all(&quot;content = 'bulk updated!'&quot;)
     assert_equal &quot;bulk updated!&quot;, Topic.find(1).content
@@ -665,7 +682,7 @@ class BasicsTest &lt; ActiveRecord::TestCase
 
   def test_delete_all
     assert Topic.count &gt; 0
-    
+
     assert_equal Topic.count, Topic.delete_all
   end
 
@@ -970,7 +987,7 @@ class BasicsTest &lt; ActiveRecord::TestCase
     topic.attributes = attributes
     assert_equal Time.local(2004, 6, 24, 16, 24, 0), topic.written_on
   end
-  
+
   def test_multiparameter_attributes_on_time_with_old_date
     attributes = {
       &quot;written_on(1i)&quot; =&gt; &quot;1850&quot;, &quot;written_on(2i)&quot; =&gt; &quot;6&quot;, &quot;written_on(3i)&quot; =&gt; &quot;24&quot;,
@@ -998,7 +1015,7 @@ class BasicsTest &lt; ActiveRecord::TestCase
   def test_multiparameter_attributes_on_time_with_time_zone_aware_attributes
     ActiveRecord::Base.time_zone_aware_attributes = true
     ActiveRecord::Base.default_timezone = :utc
-    Time.zone = TimeZone[-28800]
+    Time.zone = ActiveSupport::TimeZone[-28800]
     attributes = {
       &quot;written_on(1i)&quot; =&gt; &quot;2004&quot;, &quot;written_on(2i)&quot; =&gt; &quot;6&quot;, &quot;written_on(3i)&quot; =&gt; &quot;24&quot;,
       &quot;written_on(4i)&quot; =&gt; &quot;16&quot;, &quot;written_on(5i)&quot; =&gt; &quot;24&quot;, &quot;written_on(6i)&quot; =&gt; &quot;00&quot;
@@ -1016,7 +1033,7 @@ class BasicsTest &lt; ActiveRecord::TestCase
 
   def test_multiparameter_attributes_on_time_with_time_zone_aware_attributes_false
     ActiveRecord::Base.time_zone_aware_attributes = false
-    Time.zone = TimeZone[-28800]
+    Time.zone = ActiveSupport::TimeZone[-28800]
     attributes = {
       &quot;written_on(1i)&quot; =&gt; &quot;2004&quot;, &quot;written_on(2i)&quot; =&gt; &quot;6&quot;, &quot;written_on(3i)&quot; =&gt; &quot;24&quot;,
       &quot;written_on(4i)&quot; =&gt; &quot;16&quot;, &quot;written_on(5i)&quot; =&gt; &quot;24&quot;, &quot;written_on(6i)&quot; =&gt; &quot;00&quot;
@@ -1032,7 +1049,7 @@ class BasicsTest &lt; ActiveRecord::TestCase
   def test_multiparameter_attributes_on_time_with_skip_time_zone_conversion_for_attributes
     ActiveRecord::Base.time_zone_aware_attributes = true
     ActiveRecord::Base.default_timezone = :utc
-    Time.zone = TimeZone[-28800]
+    Time.zone = ActiveSupport::TimeZone[-28800]
     Topic.skip_time_zone_conversion_for_attributes = [:written_on]
     attributes = {
       &quot;written_on(1i)&quot; =&gt; &quot;2004&quot;, &quot;written_on(2i)&quot; =&gt; &quot;6&quot;, &quot;written_on(3i)&quot; =&gt; &quot;24&quot;,
@@ -1336,6 +1353,12 @@ class BasicsTest &lt; ActiveRecord::TestCase
     assert_equal(myobj, topic.content)
   end
 
+  def test_serialized_time_attribute
+    myobj = Time.local(2008,1,1,1,0)
+    topic = Topic.create(&quot;content&quot; =&gt; myobj).reload
+    assert_equal(myobj, topic.content)
+  end
+
   def test_nil_serialized_attribute_with_class_constraint
     myobj = MyObject.new('value1', 'value2')
     topic = Topic.new
@@ -1647,7 +1670,7 @@ class BasicsTest &lt; ActiveRecord::TestCase
     last  = Developer.find :last
     assert_equal last, Developer.find(:first, :order =&gt; 'id desc')
   end
-  
+
   def test_last
     assert_equal Developer.find(:first, :order =&gt; 'id desc'), Developer.last
   end
@@ -1655,7 +1678,7 @@ class BasicsTest &lt; ActiveRecord::TestCase
   def test_all_with_conditions
     assert_equal Developer.find(:all, :order =&gt; 'id desc'), Developer.all(:order =&gt; 'id desc')
   end
-  
+
   def test_find_ordered_last
     last  = Developer.find :last, :order =&gt; 'developers.salary ASC'
     assert_equal last, Developer.find(:all, :order =&gt; 'developers.salary ASC').last
@@ -1670,14 +1693,14 @@ class BasicsTest &lt; ActiveRecord::TestCase
     last  = Developer.find :last, :order =&gt; 'developers.name, developers.salary DESC'
     assert_equal last, Developer.find(:all, :order =&gt; 'developers.name, developers.salary DESC').last
   end
-  
+
   def test_find_scoped_ordered_last
     last_developer = Developer.with_scope(:find =&gt; { :order =&gt; 'developers.salary ASC' }) do
       Developer.find(:last)
     end
     assert_equal last_developer, Developer.find(:all, :order =&gt; 'developers.salary ASC').last
   end
-  
+
   def test_abstract_class
     assert !ActiveRecord::Base.abstract_class?
     assert LoosePerson.abstract_class?</diff>
      <filename>vendor/rails/activerecord/test/cases/base_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
 require &quot;cases/helper&quot;
 require 'models/company'
 require 'models/topic'
+require 'models/edge'
 
 Company.has_many :accounts
 
@@ -99,6 +100,12 @@ class CalculationsTest &lt; ActiveRecord::TestCase
 
   def test_should_return_zero_if_sum_conditions_return_nothing
     assert_equal 0, Account.sum(:credit_limit, :conditions =&gt; '1 = 2')
+    assert_equal 0, companies(:rails_core).companies.sum(:id, :conditions =&gt; '1 = 2')
+  end
+
+  def test_sum_should_return_valid_values_for_decimals
+    NumericData.create(:bank_balance =&gt; 19.83)
+    assert_equal 19.83, NumericData.sum(:bank_balance)
   end
 
   def test_should_group_by_summed_field_with_conditions
@@ -266,6 +273,51 @@ class CalculationsTest &lt; ActiveRecord::TestCase
   end
 
   def test_should_sum_expression
-    assert_equal &quot;636&quot;, Account.sum(&quot;2 * credit_limit&quot;)
+    assert_equal 636, Account.sum(&quot;2 * credit_limit&quot;)
+  end
+
+  def test_count_with_from_option
+    assert_equal Company.count(:all), Company.count(:all, :from =&gt; 'companies')
+    assert_equal Account.count(:all, :conditions =&gt; &quot;credit_limit = 50&quot;),
+        Account.count(:all, :from =&gt; 'accounts', :conditions =&gt; &quot;credit_limit = 50&quot;)
+    assert_equal Company.count(:type, :conditions =&gt; {:type =&gt; &quot;Firm&quot;}),
+        Company.count(:type, :conditions =&gt; {:type =&gt; &quot;Firm&quot;}, :from =&gt; 'companies')
+  end
+
+  def test_sum_with_from_option
+    assert_equal Account.sum(:credit_limit), Account.sum(:credit_limit, :from =&gt; 'accounts')
+    assert_equal Account.sum(:credit_limit, :conditions =&gt; &quot;credit_limit &gt; 50&quot;),
+        Account.sum(:credit_limit, :from =&gt; 'accounts', :conditions =&gt; &quot;credit_limit &gt; 50&quot;)
+  end
+
+  def test_average_with_from_option
+    assert_equal Account.average(:credit_limit), Account.average(:credit_limit, :from =&gt; 'accounts')
+    assert_equal Account.average(:credit_limit, :conditions =&gt; &quot;credit_limit &gt; 50&quot;),
+        Account.average(:credit_limit, :from =&gt; 'accounts', :conditions =&gt; &quot;credit_limit &gt; 50&quot;)
+  end
+
+  def test_minimum_with_from_option
+    assert_equal Account.minimum(:credit_limit), Account.minimum(:credit_limit, :from =&gt; 'accounts')
+    assert_equal Account.minimum(:credit_limit, :conditions =&gt; &quot;credit_limit &gt; 50&quot;),
+        Account.minimum(:credit_limit, :from =&gt; 'accounts', :conditions =&gt; &quot;credit_limit &gt; 50&quot;)
+  end
+
+  def test_maximum_with_from_option
+    assert_equal Account.maximum(:credit_limit), Account.maximum(:credit_limit, :from =&gt; 'accounts')
+    assert_equal Account.maximum(:credit_limit, :conditions =&gt; &quot;credit_limit &gt; 50&quot;),
+        Account.maximum(:credit_limit, :from =&gt; 'accounts', :conditions =&gt; &quot;credit_limit &gt; 50&quot;)
   end
+
+  def test_from_option_with_specified_index
+    if Edge.connection.adapter_name == 'MySQL'
+      assert_equal Edge.count(:all), Edge.count(:all, :from =&gt; 'edges USE INDEX(unique_edge_index)')
+      assert_equal Edge.count(:all, :conditions =&gt; 'sink_id &lt; 5'),
+          Edge.count(:all, :from =&gt; 'edges USE INDEX(unique_edge_index)', :conditions =&gt; 'sink_id &lt; 5')
+    end
+  end
+
+  def test_from_option_with_table_different_than_class
+    assert_equal Account.count(:all), Company.count(:all, :from =&gt; 'accounts')
+  end
+
 end</diff>
      <filename>vendor/rails/activerecord/test/cases/calculations_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@ require 'models/entrant'
 class DefaultTest &lt; ActiveRecord::TestCase
   def test_nil_defaults_for_not_null_columns
     column_defaults =
-      if current_adapter?(:MysqlAdapter) &amp;&amp; Mysql.client_version &lt; 50051
+      if current_adapter?(:MysqlAdapter) &amp;&amp; (Mysql.client_version &lt; 50051 || (50100..50122).include?(Mysql.client_version))
         { 'id' =&gt; nil, 'name' =&gt; '',  'course_id' =&gt; nil }
       else
         { 'id' =&gt; nil, 'name' =&gt; nil, 'course_id' =&gt; nil }</diff>
      <filename>vendor/rails/activerecord/test/cases/defaults_test.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/activerecord/test/cases/deprecated_finder_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,7 @@ require 'cases/helper'
 require 'models/topic'    # For booleans
 require 'models/pirate'   # For timestamps
 require 'models/parrot'
+require 'models/person'   # For optimistic locking
 
 class Pirate # Just reopening it, not defining it
   attr_accessor :detected_changes_in_after_update # Boolean for if changes are detected
@@ -54,6 +55,33 @@ class DirtyTest &lt; ActiveRecord::TestCase
     end
   end
 
+  def test_zero_to_blank_marked_as_changed
+    pirate = Pirate.new
+    pirate.catchphrase = &quot;Yarrrr, me hearties&quot;
+    pirate.parrot_id = 1
+    pirate.save
+
+    # check the change from 1 to ''
+    pirate = Pirate.find_by_catchphrase(&quot;Yarrrr, me hearties&quot;)
+    pirate.parrot_id = ''
+    assert pirate.parrot_id_changed?
+    assert_equal([1, nil], pirate.parrot_id_change)
+    pirate.save
+
+    # check the change from nil to 0
+    pirate = Pirate.find_by_catchphrase(&quot;Yarrrr, me hearties&quot;)
+    pirate.parrot_id = 0
+    assert pirate.parrot_id_changed?
+    assert_equal([nil, 0], pirate.parrot_id_change)
+    pirate.save
+
+    # check the change from 0 to ''
+    pirate = Pirate.find_by_catchphrase(&quot;Yarrrr, me hearties&quot;)
+    pirate.parrot_id = ''
+    assert pirate.parrot_id_changed?
+    assert_equal([0, nil], pirate.parrot_id_change)
+  end
+
   def test_object_should_be_changed_if_any_attribute_is_changed
     pirate = Pirate.new
     assert !pirate.changed?
@@ -125,6 +153,24 @@ class DirtyTest &lt; ActiveRecord::TestCase
     end
   end
 
+  def test_partial_update_with_optimistic_locking
+    person = Person.new(:first_name =&gt; 'foo')
+    old_lock_version = 1
+
+    with_partial_updates Person, false do
+      assert_queries(2) { 2.times { person.save! } }
+      Person.update_all({ :first_name =&gt; 'baz' }, :id =&gt; person.id)
+    end
+
+    with_partial_updates Person, true do
+      assert_queries(0) { 2.times { person.save! } }
+      assert_equal old_lock_version, person.reload.lock_version
+
+      assert_queries(1) { person.first_name = 'bar'; person.save! }
+      assert_not_equal old_lock_version, person.reload.lock_version
+    end
+  end
+
   def test_changed_attributes_should_be_preserved_if_save_failure
     pirate = Pirate.new
     pirate.parrot_id = 1
@@ -145,6 +191,54 @@ class DirtyTest &lt; ActiveRecord::TestCase
     assert !pirate.changed?
   end
 
+  def test_reverted_changes_are_not_dirty
+    phrase = &quot;shiver me timbers&quot;
+    pirate = Pirate.create!(:catchphrase =&gt; phrase)
+    pirate.catchphrase = &quot;*hic*&quot;
+    assert pirate.changed?
+    pirate.catchphrase = phrase
+    assert !pirate.changed?
+  end
+
+  def test_reverted_changes_are_not_dirty_after_multiple_changes
+    phrase = &quot;shiver me timbers&quot;
+    pirate = Pirate.create!(:catchphrase =&gt; phrase)
+    10.times do |i|
+      pirate.catchphrase = &quot;*hic*&quot; * i
+      assert pirate.changed?
+    end
+    assert pirate.changed?
+    pirate.catchphrase = phrase
+    assert !pirate.changed?
+  end
+
+
+  def test_reverted_changes_are_not_dirty_going_from_nil_to_value_and_back
+    pirate = Pirate.create!(:catchphrase =&gt; &quot;Yar!&quot;)
+
+    pirate.parrot_id = 1
+    assert pirate.changed?
+    assert pirate.parrot_id_changed?
+    assert !pirate.catchphrase_changed?
+
+    pirate.parrot_id = nil
+    assert !pirate.changed?
+    assert !pirate.parrot_id_changed?
+    assert !pirate.catchphrase_changed?
+  end
+
+  def test_save_should_store_serialized_attributes_even_with_partial_updates
+    with_partial_updates(Topic) do
+      topic = Topic.create!(:content =&gt; {:a =&gt; &quot;a&quot;})
+      topic.content[:b] = &quot;b&quot;
+      #assert topic.changed? # Known bug, will fail
+      topic.save!
+      assert_equal &quot;b&quot;, topic.content[:b]
+      topic.reload
+      assert_equal &quot;b&quot;, topic.content[:b]
+    end
+  end
+
   private
     def with_partial_updates(klass, on = true)
       old = klass.partial_updates?</diff>
      <filename>vendor/rails/activerecord/test/cases/dirty_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 require &quot;cases/helper&quot;
 require 'models/author'
+require 'models/categorization'
 require 'models/comment'
 require 'models/company'
 require 'models/topic'
@@ -394,6 +395,12 @@ class FinderTest &lt; ActiveRecord::TestCase
     assert_equal '1,1,1', bind('?', os)
   end
 
+  def test_named_bind_with_postgresql_type_casts
+    l = Proc.new { bind(&quot;:a::integer '2009-01-01'::date&quot;, :a =&gt; '10') }
+    assert_nothing_raised(&amp;l)
+    assert_equal &quot;#{ActiveRecord::Base.quote_value('10')}::integer '2009-01-01'::date&quot;, l.call
+  end
+
   def test_string_sanitation
     assert_not_equal &quot;#{ActiveRecord::Base.connection.quoted_string_prefix}'something ' 1=1'&quot;, ActiveRecord::Base.sanitize(&quot;something ' 1=1&quot;)
     assert_equal &quot;#{ActiveRecord::Base.connection.quoted_string_prefix}'something; select table'&quot;, ActiveRecord::Base.sanitize(&quot;something; select table&quot;)</diff>
      <filename>vendor/rails/activerecord/test/cases/finder_test.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/activerecord/test/cases/fixtures_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -32,13 +32,13 @@ end
 ActiveRecord::Base.connection.class.class_eval do
   IGNORED_SQL = [/^PRAGMA/, /^SELECT currval/, /^SELECT CAST/, /^SELECT @@IDENTITY/, /^SELECT @@ROWCOUNT/]
 
-  def execute_with_counting(sql, name = nil, &amp;block)
-    $query_count ||= 0
-    $query_count  += 1 unless IGNORED_SQL.any? { |r| sql =~ r }
-    execute_without_counting(sql, name, &amp;block)
+  def execute_with_query_record(sql, name = nil, &amp;block)
+    $queries_executed ||= []
+    $queries_executed &lt;&lt; sql unless IGNORED_SQL.any? { |r| sql =~ r }
+    execute_without_query_record(sql, name, &amp;block)
   end
 
-  alias_method_chain :execute, :counting
+  alias_method_chain :execute, :query_record
 end
 
 # Make with_scope public for tests</diff>
      <filename>vendor/rails/activerecord/test/cases/helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -191,6 +191,13 @@ class InheritanceTest &lt; ActiveRecord::TestCase
     assert_not_nil account.instance_variable_get(&quot;@firm&quot;), &quot;nil proves eager load failed&quot;
   end
 
+  def test_eager_load_belongs_to_primary_key_quoting
+    con = Account.connection
+    assert_sql(/\(#{con.quote_table_name('companies')}.#{con.quote_column_name('id')} IN \(1\)\)/) do
+      Account.find(1, :include =&gt; :firm)
+    end
+  end
+
   def test_alt_eager_loading
     switch_to_alt_inheritance_column
     test_eager_load_belongs_to_something_inherited
@@ -223,11 +230,11 @@ class InheritanceComputeTypeTest &lt; ActiveRecord::TestCase
   fixtures :companies
 
   def setup
-    Dependencies.log_activity = true
+    ActiveSupport::Dependencies.log_activity = true
   end
 
   def teardown
-    Dependencies.log_activity = false
+    ActiveSupport::Dependencies.log_activity = false
     self.class.const_remove :FirmOnTheFly rescue nil
     Firm.const_remove :FirmOnTheFly rescue nil
   end</diff>
      <filename>vendor/rails/activerecord/test/cases/inheritance_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,7 @@ require &quot;cases/helper&quot;
 require 'models/topic'
 require 'models/developer'
 require 'models/reply'
+require 'models/minimalistic'
 
 class Topic; def after_find() end end
 class Developer; def after_find() end end
@@ -44,6 +45,14 @@ class TopicObserver &lt; ActiveRecord::Observer
   end
 end
 
+class MinimalisticObserver &lt; ActiveRecord::Observer
+  attr_reader :minimalistic
+
+  def after_find(minimalistic)
+    @minimalistic = minimalistic
+  end
+end
+
 class MultiObserver &lt; ActiveRecord::Observer
   attr_reader :record
 
@@ -65,7 +74,7 @@ class MultiObserver &lt; ActiveRecord::Observer
 end
 
 class LifecycleTest &lt; ActiveRecord::TestCase
-  fixtures :topics, :developers
+  fixtures :topics, :developers, :minimalistics
 
   def test_before_destroy
     original_count = Topic.count
@@ -134,6 +143,50 @@ class LifecycleTest &lt; ActiveRecord::TestCase
     assert_equal developer.name, multi_observer.record.name
   end
 
+  def test_after_find_can_be_observed_when_its_not_defined_on_the_model
+    observer = MinimalisticObserver.instance
+    assert_equal Minimalistic, MinimalisticObserver.observed_class
+
+    minimalistic = Minimalistic.find(1)
+    assert_equal minimalistic, observer.minimalistic
+  end
+
+  def test_after_find_can_be_observed_when_its_defined_on_the_model
+    observer = TopicObserver.instance
+    assert_equal Topic, TopicObserver.observed_class
+
+    topic = Topic.find(1)
+    assert_equal topic, observer.topic
+  end
+
+  def test_after_find_is_not_created_if_its_not_used
+    # use a fresh class so an observer can't have defined an
+    # after_find on it
+    model_class = Class.new(ActiveRecord::Base)
+    observer_class = Class.new(ActiveRecord::Observer)
+    observer_class.observe(model_class)
+
+    observer = observer_class.instance
+
+    assert !model_class.method_defined?(:after_find)
+  end
+
+  def test_after_find_is_not_clobbered_if_it_already_exists
+    # use a fresh observer class so we can instantiate it (Observer is
+    # a Singleton)
+    model_class = Class.new(ActiveRecord::Base) do
+      def after_find; end
+    end
+    original_method = model_class.instance_method(:after_find)
+    observer_class = Class.new(ActiveRecord::Observer) do
+      def after_find; end
+    end
+    observer_class.observe(model_class)
+
+    observer = observer_class.instance
+    assert_equal original_method, model_class.instance_method(:after_find)
+  end
+
   def test_invalid_observer
     assert_raise(ArgumentError) { Topic.observers = Object.new; Topic.instantiate_observers }
   end</diff>
      <filename>vendor/rails/activerecord/test/cases/lifecycle_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -29,10 +29,12 @@ class OptimisticLockingTest &lt; ActiveRecord::TestCase
     assert_equal 0, p1.lock_version
     assert_equal 0, p2.lock_version
 
+    p1.first_name = 'stu'
     p1.save!
     assert_equal 1, p1.lock_version
     assert_equal 0, p2.lock_version
 
+    p2.first_name = 'sue'
     assert_raises(ActiveRecord::StaleObjectError) { p2.save! }
   end
 
@@ -42,11 +44,14 @@ class OptimisticLockingTest &lt; ActiveRecord::TestCase
     assert_equal 0, p1.lock_version
     assert_equal 0, p2.lock_version
 
+    p1.first_name = 'stu'
     p1.save!
     assert_equal 1, p1.lock_version
     assert_equal 0, p2.lock_version
 
+    p2.first_name = 'sue'
     assert_raises(ActiveRecord::StaleObjectError) { p2.save! }
+    p2.first_name = 'sue2'
     assert_raises(ActiveRecord::StaleObjectError) { p2.save! }
   end
 
@@ -54,15 +59,18 @@ class OptimisticLockingTest &lt; ActiveRecord::TestCase
     p1 = Person.new(:first_name =&gt; 'anika')
     assert_equal 0, p1.lock_version
 
+    p1.first_name = 'anika2'
     p1.save!
     p2 = Person.find(p1.id)
     assert_equal 0, p1.lock_version
     assert_equal 0, p2.lock_version
 
+    p1.first_name = 'anika3'
     p1.save!
     assert_equal 1, p1.lock_version
     assert_equal 0, p2.lock_version
 
+    p2.first_name = 'sue'
     assert_raises(ActiveRecord::StaleObjectError) { p2.save! }
   end
 
@@ -81,10 +89,12 @@ class OptimisticLockingTest &lt; ActiveRecord::TestCase
     assert_equal 0, t1.version
     assert_equal 0, t2.version
 
+    t1.tps_report_number = 700
     t1.save!
     assert_equal 1, t1.version
     assert_equal 0, t2.version
 
+    t2.tps_report_number = 800
     assert_raises(ActiveRecord::StaleObjectError) { t2.save! }
   end
 
@@ -93,6 +103,7 @@ class OptimisticLockingTest &lt; ActiveRecord::TestCase
     assert_equal 0, p1.lock_version
     assert_equal p1.lock_version, Person.new(p1.attributes).lock_version
 
+    p1.first_name = 'bianca2'
     p1.save!
     assert_equal 1, p1.lock_version
     assert_equal p1.lock_version, Person.new(p1.attributes).lock_version
@@ -146,6 +157,15 @@ class OptimisticLockingTest &lt; ActiveRecord::TestCase
     assert ref.save
   end
 
+  # Useful for partial updates, don't only update the lock_version if there
+  # is nothing else being updated.
+  def test_update_without_attributes_does_not_only_update_lock_version
+    assert_nothing_raised do
+      p1 = Person.new(:first_name =&gt; 'anika')
+      p1.send(:update_with_lock, [])
+    end
+  end
+
   private
 
     def add_counter_column_to(model)</diff>
      <filename>vendor/rails/activerecord/test/cases/locking_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ require 'models/post'
 require 'models/category'
 
 class MethodScopingTest &lt; ActiveRecord::TestCase
-  fixtures :developers, :projects, :comments, :posts
+  fixtures :developers, :projects, :comments, :posts, :developers_projects
 
   def test_set_conditions
     Developer.with_scope(:find =&gt; { :conditions =&gt; 'just a test...' }) do
@@ -87,6 +87,16 @@ class MethodScopingTest &lt; ActiveRecord::TestCase
     assert_equal 1, scoped_developers.size
   end
 
+  def test_scoped_find_joins
+    scoped_developers = Developer.with_scope(:find =&gt; { :joins =&gt; 'JOIN developers_projects ON id = developer_id' } ) do
+      Developer.find(:all, :conditions =&gt; 'developers_projects.project_id = 2')
+    end
+    assert scoped_developers.include?(developers(:david))
+    assert !scoped_developers.include?(developers(:jamis))
+    assert_equal 1, scoped_developers.size
+    assert_equal developers(:david).attributes, scoped_developers.first.attributes
+  end
+
   def test_scoped_count_include
     # with the include, will retrieve only developers for the given project
     Developer.with_scope(:find =&gt; { :include =&gt; :projects }) do</diff>
      <filename>vendor/rails/activerecord/test/cases/method_scoping_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@ require 'bigdecimal/util'
 
 require 'models/person'
 require 'models/topic'
+require 'models/developer'
 
 require MIGRATIONS_ROOT + &quot;/valid/1_people_have_last_names&quot;
 require MIGRATIONS_ROOT + &quot;/valid/2_we_need_reminders&quot;
@@ -153,9 +154,10 @@ if ActiveRecord::Base.connection.supports_migrations?
 
           t.column :default_int, :integer
 
-          t.column :one_int,   :integer, :limit =&gt; 1
-          t.column :four_int,  :integer, :limit =&gt; 4
-          t.column :eight_int, :integer, :limit =&gt; 8
+          t.column :one_int,    :integer, :limit =&gt; 1
+          t.column :four_int,   :integer, :limit =&gt; 4
+          t.column :eight_int,  :integer, :limit =&gt; 8
+          t.column :eleven_int, :integer, :limit =&gt; 11
         end
       end
 
@@ -167,12 +169,20 @@ if ActiveRecord::Base.connection.supports_migrations?
       one     = columns.detect { |c| c.name == &quot;one_int&quot;     }
       four    = columns.detect { |c| c.name == &quot;four_int&quot;    }
       eight   = columns.detect { |c| c.name == &quot;eight_int&quot;   }
+      eleven  = columns.detect { |c| c.name == &quot;eleven_int&quot;   }
 
       if current_adapter?(:PostgreSQLAdapter)
         assert_equal 'integer', default.sql_type
         assert_equal 'smallint', one.sql_type
         assert_equal 'integer', four.sql_type
         assert_equal 'bigint', eight.sql_type
+        assert_equal 'integer', eleven.sql_type
+      elsif current_adapter?(:MysqlAdapter)
+        assert_match 'int(11)', default.sql_type
+        assert_match 'tinyint', one.sql_type
+        assert_match 'int', four.sql_type
+        assert_match 'bigint', eight.sql_type
+        assert_match 'int(11)', eleven.sql_type
       elsif current_adapter?(:OracleAdapter)
         assert_equal 'NUMBER(38)', default.sql_type
         assert_equal 'NUMBER(1)', one.sql_type
@@ -227,6 +237,39 @@ if ActiveRecord::Base.connection.supports_migrations?
       end
     end
 
+    def test_create_table_with_timestamps_should_create_datetime_columns
+      table_name = :testings
+
+      Person.connection.create_table table_name do |t|
+        t.timestamps
+      end
+      created_columns = Person.connection.columns(table_name)
+
+      created_at_column = created_columns.detect {|c| c.name == 'created_at' }
+      updated_at_column = created_columns.detect {|c| c.name == 'updated_at' }
+
+      assert created_at_column.null
+      assert updated_at_column.null
+    ensure
+      Person.connection.drop_table table_name rescue nil
+    end
+
+    def test_create_table_with_timestamps_should_create_datetime_columns_with_options
+      table_name = :testings
+
+      Person.connection.create_table table_name do |t|
+        t.timestamps :null =&gt; false
+      end
+      created_columns = Person.connection.columns(table_name)
+
+      created_at_column = created_columns.detect {|c| c.name == 'created_at' }
+      updated_at_column = created_columns.detect {|c| c.name == 'updated_at' }
+
+      assert !created_at_column.null
+      assert !updated_at_column.null
+    ensure
+      Person.connection.drop_table table_name rescue nil
+    end
 
     # SQL Server, Sybase, and SQLite3 will not allow you to add a NOT NULL
     # column to a table without a default value.
@@ -399,10 +442,7 @@ if ActiveRecord::Base.connection.supports_migrations?
 
         ActiveRecord::Migration.add_column :people, :intelligence_quotient, :tinyint
         Person.reset_column_information
-        Person.create :intelligence_quotient =&gt; 300
-        jonnyg = Person.find(:first)
-        assert_equal 127, jonnyg.intelligence_quotient
-        jonnyg.destroy
+        assert_match /tinyint/, Person.columns_hash['intelligence_quotient'].sql_type
       ensure
         ActiveRecord::Migration.remove_column :people, :intelligence_quotient rescue nil
       end
@@ -483,6 +523,37 @@ if ActiveRecord::Base.connection.supports_migrations?
       end
     end
 
+    def test_rename_column_preserves_default_value_not_null
+      begin
+        default_before = Developer.connection.columns(&quot;developers&quot;).find { |c| c.name == &quot;salary&quot; }.default
+        assert_equal 70000, default_before
+        Developer.connection.rename_column &quot;developers&quot;, &quot;salary&quot;, &quot;anual_salary&quot;
+        Developer.reset_column_information
+        assert Developer.column_names.include?(&quot;anual_salary&quot;)
+        default_after = Developer.connection.columns(&quot;developers&quot;).find { |c| c.name == &quot;anual_salary&quot; }.default
+        assert_equal 70000, default_after
+      ensure
+        Developer.connection.rename_column &quot;developers&quot;, &quot;anual_salary&quot;, &quot;salary&quot;
+        Developer.reset_column_information
+      end
+    end
+
+    def test_rename_nonexistent_column
+      ActiveRecord::Base.connection.create_table(:hats) do |table|
+        table.column :hat_name, :string, :default =&gt; nil
+      end
+      exception = if current_adapter?(:PostgreSQLAdapter)
+        ActiveRecord::StatementInvalid
+      else
+        ActiveRecord::ActiveRecordError
+      end
+      assert_raises(exception) do
+        Person.connection.rename_column &quot;hats&quot;, &quot;nonexistent&quot;, &quot;should_fail&quot;
+      end
+    ensure
+      ActiveRecord::Base.connection.drop_table(:hats)
+    end
+
     def test_rename_column_with_sql_reserved_word
       begin
         assert_nothing_raised { Person.connection.rename_column &quot;people&quot;, &quot;first_name&quot;, &quot;group&quot; }
@@ -662,6 +733,55 @@ if ActiveRecord::Base.connection.supports_migrations?
       Person.connection.drop_table :testings rescue nil
     end
 
+    def test_keeping_default_and_notnull_constaint_on_change
+      Person.connection.create_table :testings do |t|
+        t.column :title, :string
+      end
+      person_klass = Class.new(Person)
+      person_klass.set_table_name 'testings'
+
+      person_klass.connection.add_column &quot;testings&quot;, &quot;wealth&quot;, :integer, :null =&gt; false, :default =&gt; 99
+      person_klass.reset_column_information
+      assert_equal 99, person_klass.columns_hash[&quot;wealth&quot;].default
+      assert_equal false, person_klass.columns_hash[&quot;wealth&quot;].null
+      assert_nothing_raised {person_klass.connection.execute(&quot;insert into testings (title) values ('tester')&quot;)}
+
+      # change column default to see that column doesn't lose its not null definition
+      person_klass.connection.change_column_default &quot;testings&quot;, &quot;wealth&quot;, 100
+      person_klass.reset_column_information
+      assert_equal 100, person_klass.columns_hash[&quot;wealth&quot;].default
+      assert_equal false, person_klass.columns_hash[&quot;wealth&quot;].null
+
+      # rename column to see that column doesn't lose its not null and/or default definition
+      person_klass.connection.rename_column &quot;testings&quot;, &quot;wealth&quot;, &quot;money&quot;
+      person_klass.reset_column_information
+      assert_nil person_klass.columns_hash[&quot;wealth&quot;]
+      assert_equal 100, person_klass.columns_hash[&quot;money&quot;].default
+      assert_equal false, person_klass.columns_hash[&quot;money&quot;].null
+
+      # change column
+      person_klass.connection.change_column &quot;testings&quot;, &quot;money&quot;, :integer, :null =&gt; false, :default =&gt; 1000
+      person_klass.reset_column_information
+      assert_equal 1000, person_klass.columns_hash[&quot;money&quot;].default
+      assert_equal false, person_klass.columns_hash[&quot;money&quot;].null
+
+      # change column, make it nullable and clear default
+      person_klass.connection.change_column &quot;testings&quot;, &quot;money&quot;, :integer, :null =&gt; true, :default =&gt; nil
+      person_klass.reset_column_information
+      assert_nil person_klass.columns_hash[&quot;money&quot;].default
+      assert_equal true, person_klass.columns_hash[&quot;money&quot;].null
+
+      # change_column_null, make it not nullable and set null values to a default value
+      person_klass.connection.execute('UPDATE testings SET money = NULL')
+      person_klass.connection.change_column_null &quot;testings&quot;, &quot;money&quot;, false, 2000
+      person_klass.reset_column_information
+      assert_nil person_klass.columns_hash[&quot;money&quot;].default
+      assert_equal false, person_klass.columns_hash[&quot;money&quot;].null
+      assert_equal [2000], Person.connection.select_values(&quot;SELECT money FROM testings&quot;).map { |s| s.to_i }.sort
+    ensure
+      Person.connection.drop_table :testings rescue nil
+    end
+
     def test_change_column_default_to_null
       Person.connection.change_column_default &quot;people&quot;, &quot;first_name&quot;, nil
       Person.reset_column_information
@@ -799,6 +919,21 @@ if ActiveRecord::Base.connection.supports_migrations?
       assert !Reminder.table_exists?
     end
 
+    def test_migrator_double_up
+      assert_equal(0, ActiveRecord::Migrator.current_version)
+      ActiveRecord::Migrator.run(:up, MIGRATIONS_ROOT + &quot;/valid&quot;, 1)
+      assert_nothing_raised { ActiveRecord::Migrator.run(:up, MIGRATIONS_ROOT + &quot;/valid&quot;, 1) }
+      assert_equal(1, ActiveRecord::Migrator.current_version)
+    end
+
+    def test_migrator_double_down
+      assert_equal(0, ActiveRecord::Migrator.current_version)
+      ActiveRecord::Migrator.run(:up, MIGRATIONS_ROOT + &quot;/valid&quot;, 1)
+      ActiveRecord::Migrator.run(:down, MIGRATIONS_ROOT + &quot;/valid&quot;, 1)
+      assert_nothing_raised { ActiveRecord::Migrator.run(:down, MIGRATIONS_ROOT + &quot;/valid&quot;, 1) }
+      assert_equal(0, ActiveRecord::Migrator.current_version)
+    end
+
     def test_finds_migrations
       migrations = ActiveRecord::Migrator.new(:up, MIGRATIONS_ROOT + &quot;/valid&quot;).migrations
       [['1', 'people_have_last_names'],
@@ -888,16 +1023,6 @@ if ActiveRecord::Base.connection.supports_migrations?
       ActiveRecord::Migrator.rollback(MIGRATIONS_ROOT + &quot;/valid&quot;)
       assert_equal(0, ActiveRecord::Migrator.current_version)
     end
-    
-    def test_migrator_run
-      assert_equal(0, ActiveRecord::Migrator.current_version)
-      ActiveRecord::Migrator.run(:up, MIGRATIONS_ROOT + &quot;/valid&quot;, 3)
-      assert_equal(0, ActiveRecord::Migrator.current_version)
-
-      assert_equal(0, ActiveRecord::Migrator.current_version)
-      ActiveRecord::Migrator.run(:down, MIGRATIONS_ROOT + &quot;/valid&quot;, 3)
-      assert_equal(0, ActiveRecord::Migrator.current_version)
-    end
 
     def test_schema_migrations_table_name
       ActiveRecord::Base.table_name_prefix = &quot;prefix_&quot;
@@ -1077,8 +1202,8 @@ if ActiveRecord::Base.connection.supports_migrations?
 
       def test_timestamps_creates_updated_at_and_created_at
         with_new_table do |t|
-          t.expects(:column).with(:created_at, :datetime)
-          t.expects(:column).with(:updated_at, :datetime)
+          t.expects(:column).with(:created_at, :datetime, kind_of(Hash))
+          t.expects(:column).with(:updated_at, :datetime, kind_of(Hash))
           t.timestamps
         end
       end
@@ -1206,10 +1331,10 @@ if ActiveRecord::Base.connection.supports_migrations?
       end
 
       def integer_column
-        if current_adapter?(:SQLite3Adapter) || current_adapter?(:SQLiteAdapter) || current_adapter?(:PostgreSQLAdapter)
-          &quot;integer&quot;
-        else
+        if current_adapter?(:MysqlAdapter)
           'int(11)'
+        else
+          'integer'
         end
       end
 </diff>
      <filename>vendor/rails/activerecord/test/cases/migration_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -51,7 +51,7 @@ class MultipleDbTest &lt; ActiveRecord::TestCase
   def test_course_connection_should_survive_dependency_reload
     assert Course.connection
 
-    Dependencies.clear
+    ActiveSupport::Dependencies.clear
     Object.send(:remove_const, :Course)
     require_dependency 'models/course'
 </diff>
      <filename>vendor/rails/activerecord/test/cases/multiple_db_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,9 +4,10 @@ require 'models/topic'
 require 'models/comment'
 require 'models/reply'
 require 'models/author'
+require 'models/developer'
 
 class NamedScopeTest &lt; ActiveRecord::TestCase
-  fixtures :posts, :authors, :topics, :comments
+  fixtures :posts, :authors, :topics, :comments, :author_addresses
 
   def test_implements_enumerable
     assert !Topic.find(:all).empty?
@@ -45,6 +46,17 @@ class NamedScopeTest &lt; ActiveRecord::TestCase
     assert_equal Topic.average(:replies_count), Topic.base.average(:replies_count)
   end
 
+  def test_scope_should_respond_to_own_methods_and_methods_of_the_proxy
+    assert Topic.approved.respond_to?(:proxy_found)
+    assert Topic.approved.respond_to?(:count)
+    assert Topic.approved.respond_to?(:length)
+  end
+
+  def test_respond_to_respects_include_private_parameter
+    assert !Topic.approved.respond_to?(:load_found)
+    assert Topic.approved.respond_to?(:load_found, true)
+  end
+
   def test_subclasses_inherit_scopes
     assert Topic.scopes.include?(:base)
 
@@ -59,6 +71,12 @@ class NamedScopeTest &lt; ActiveRecord::TestCase
     assert_equal Topic.count(:conditions =&gt; {:approved =&gt; true}), Topic.approved.count
   end
 
+  def test_scopes_with_string_name_can_be_composed
+    # NOTE that scopes defined with a string as a name worked on their own
+    # but when called on another scope the other scope was completely replaced
+    assert_equal Topic.replied.approved, Topic.replied.approved_as_string
+  end
+
   def test_scopes_are_composable
     assert_equal (approved = Topic.find(:all, :conditions =&gt; {:approved =&gt; true})), Topic.approved
     assert_equal (replied = Topic.find(:all, :conditions =&gt; 'replies_count &gt; 0')), Topic.replied
@@ -77,6 +95,25 @@ class NamedScopeTest &lt; ActiveRecord::TestCase
     assert_equal topics_written_before_the_second, Topic.written_before(topics(:second).written_on)
   end
 
+  def test_scopes_with_joins
+    address = author_addresses(:david_address)
+    posts_with_authors_at_address = Post.find(
+      :all, :joins =&gt; 'JOIN authors ON authors.id = posts.author_id',
+      :conditions =&gt; [ 'authors.author_address_id = ?', address.id ]
+    )
+    assert_equal posts_with_authors_at_address, Post.with_authors_at_address(address)
+  end
+
+  def test_scopes_with_joins_respects_custom_select
+    address = author_addresses(:david_address)
+    posts_with_authors_at_address_titles = Post.find(:all,
+      :select =&gt; 'title',
+      :joins =&gt; 'JOIN authors ON authors.id = posts.author_id',
+      :conditions =&gt; [ 'authors.author_address_id = ?', address.id ]
+    )
+    assert_equal posts_with_authors_at_address_titles, Post.with_authors_at_address(address).find(:all, :select =&gt; 'title')
+  end
+
   def test_extensions
     assert_equal 1, Topic.anonymous_extension.one
     assert_equal 2, Topic.named_extension.two
@@ -154,4 +191,16 @@ class NamedScopeTest &lt; ActiveRecord::TestCase
       topics.empty?  # use loaded (no query)
     end
   end
+
+  def test_find_all_should_behave_like_select
+    assert_equal Topic.base.select(&amp;:approved), Topic.base.find_all(&amp;:approved)
+  end
+
+  def test_rand_should_select_a_random_object_from_proxy
+    assert Topic.approved.rand.is_a?(Topic)
+  end
+
+  def test_should_use_where_in_query_for_named_scope
+    assert_equal Developer.find_all_by_name('Jamis'), Developer.find_all_by_id(Developer.jamises)
+  end
 end</diff>
      <filename>vendor/rails/activerecord/test/cases/named_scope_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -58,7 +58,7 @@ end
 uses_mocha 'QueryCacheExpiryTest' do
 
 class QueryCacheExpiryTest &lt; ActiveRecord::TestCase
-  fixtures :tasks
+  fixtures :tasks, :posts, :categories, :categories_posts
 
   def test_find
     Task.connection.expects(:clear_query_cache).times(1)
@@ -116,8 +116,9 @@ class QueryCacheExpiryTest &lt; ActiveRecord::TestCase
   def test_cache_is_expired_by_habtm_delete
     ActiveRecord::Base.connection.expects(:clear_query_cache).times(2)
     ActiveRecord::Base.cache do
-      c = Category.find(:first)
-      p = Post.find(:first)
+      c = Category.find(1)
+      p = Post.find(1)
+      assert p.categories.any?
       p.categories.delete_all
     end
   end</diff>
      <filename>vendor/rails/activerecord/test/cases/query_cache_test.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/activerecord/test/cases/readonly_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -160,9 +160,9 @@ class ReflectionTest &lt; ActiveRecord::TestCase
 
   def test_reflection_of_all_associations
     # FIXME these assertions bust a lot
-    assert_equal 20, Firm.reflect_on_all_associations.size
-    assert_equal 16, Firm.reflect_on_all_associations(:has_many).size
-    assert_equal 4, Firm.reflect_on_all_associations(:has_one).size
+    assert_equal 22, Firm.reflect_on_all_associations.size
+    assert_equal 17, Firm.reflect_on_all_associations(:has_many).size
+    assert_equal 5, Firm.reflect_on_all_associations(:has_one).size
     assert_equal 0, Firm.reflect_on_all_associations(:belongs_to).size
   end
 </diff>
      <filename>vendor/rails/activerecord/test/cases/reflection_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -72,6 +72,52 @@ class SchemaDumperTest &lt; ActiveRecord::TestCase
     assert_match %r{:null =&gt; false}, output
   end
 
+  def test_schema_dump_includes_limit_constraint_for_integer_columns
+    stream = StringIO.new
+
+    ActiveRecord::SchemaDumper.ignore_tables = [/^(?!integer_limits)/]
+    ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, stream)
+    output = stream.string
+
+    if current_adapter?(:PostgreSQLAdapter)
+      assert_match %r{c_int_1.*:limit =&gt; 2}, output
+      assert_match %r{c_int_2.*:limit =&gt; 2}, output
+
+      # int 3 is 4 bytes in postgresql
+      assert_match %r{c_int_3.*}, output
+      assert_no_match %r{c_int_3.*:limit}, output
+
+      assert_match %r{c_int_4.*}, output
+      assert_no_match %r{c_int_4.*:limit}, output
+    elsif current_adapter?(:MysqlAdapter)
+      assert_match %r{c_int_1.*:limit =&gt; 1}, output
+      assert_match %r{c_int_2.*:limit =&gt; 2}, output
+      assert_match %r{c_int_3.*:limit =&gt; 3}, output
+
+      assert_match %r{c_int_4.*}, output
+      assert_no_match %r{c_int_4.*:limit}, output
+    elsif current_adapter?(:SQLiteAdapter)
+      assert_match %r{c_int_1.*:limit =&gt; 1}, output
+      assert_match %r{c_int_2.*:limit =&gt; 2}, output
+      assert_match %r{c_int_3.*:limit =&gt; 3}, output
+      assert_match %r{c_int_4.*:limit =&gt; 4}, output
+    end
+    assert_match %r{c_int_without_limit.*}, output
+    assert_no_match %r{c_int_without_limit.*:limit}, output
+
+    if current_adapter?(:SQLiteAdapter)
+      assert_match %r{c_int_5.*:limit =&gt; 5}, output
+      assert_match %r{c_int_6.*:limit =&gt; 6}, output
+      assert_match %r{c_int_7.*:limit =&gt; 7}, output
+      assert_match %r{c_int_8.*:limit =&gt; 8}, output
+    else
+      assert_match %r{c_int_5.*:limit =&gt; 8}, output
+      assert_match %r{c_int_6.*:limit =&gt; 8}, output
+      assert_match %r{c_int_7.*:limit =&gt; 8}, output
+      assert_match %r{c_int_8.*:limit =&gt; 8}, output
+    end
+  end
+
   def test_schema_dump_with_string_ignored_table
     stream = StringIO.new
 </diff>
      <filename>vendor/rails/activerecord/test/cases/schema_dumper_test.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/activerecord/test/cases/unconnected_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -451,6 +451,18 @@ class ValidationsTest &lt; ActiveRecord::TestCase
     t2.title = nil
     assert t2.valid?, &quot;should validate with nil&quot;
     assert t2.save, &quot;should save with nil&quot;
+
+    with_kcode('UTF8') do
+      t_utf8 = Topic.new(&quot;title&quot; =&gt; &quot;&#1071; &#1090;&#1086;&#1078;&#1077; &#1091;&#1085;&#1080;&#1082;&#1072;&#1083;&#1100;&#1085;&#1099;&#1081;!&quot;)
+      assert t_utf8.save, &quot;Should save t_utf8 as unique&quot;
+
+      # If database hasn't UTF-8 character set, this test fails
+      if Topic.find(t_utf8, :select =&gt; 'LOWER(title) AS title').title == &quot;&#1103; &#1090;&#1086;&#1078;&#1077; &#1091;&#1085;&#1080;&#1082;&#1072;&#1083;&#1100;&#1085;&#1099;&#1081;!&quot;
+        t2_utf8 = Topic.new(&quot;title&quot; =&gt; &quot;&#1103; &#1090;&#1086;&#1078;&#1077; &#1059;&#1053;&#1048;&#1050;&#1040;&#1051;&#1068;&#1053;&#1067;&#1049;!&quot;)
+        assert !t2_utf8.valid?, &quot;Shouldn't be valid&quot;
+        assert !t2_utf8.save, &quot;Shouldn't save t2_utf8 as unique&quot;
+      end
+    end
   end
 
   def test_validate_case_sensitive_uniqueness
@@ -1059,6 +1071,18 @@ class ValidationsTest &lt; ActiveRecord::TestCase
     end
   end
 
+  def test_validates_length_of_with_block
+    Topic.validates_length_of :content, :minimum =&gt; 5, :too_short=&gt;&quot;Your essay must be at least %d words.&quot;, 
+                                        :tokenizer =&gt; lambda {|str| str.scan(/\w+/) }
+    t = Topic.create!(:content =&gt; &quot;this content should be long enough&quot;)
+    assert t.valid?
+
+    t.content = &quot;not long enough&quot;
+    assert !t.valid?
+    assert t.errors.on(:content)
+    assert_equal &quot;Your essay must be at least 5 words.&quot;, t.errors[:content]
+  end
+
   def test_validates_size_of_association_utf8
     with_kcode('UTF8') do
       assert_nothing_raised { Topic.validates_size_of :replies, :minimum =&gt; 1 }
@@ -1379,6 +1403,7 @@ class ValidatesNumericalityTest &lt; ActiveRecord::TestCase
   INTEGERS = [0, 10, -10] + INTEGER_STRINGS
   BIGDECIMAL = BIGDECIMAL_STRINGS.collect! { |bd| BigDecimal.new(bd) }
   JUNK = [&quot;not a number&quot;, &quot;42 not a number&quot;, &quot;0xdeadbeef&quot;, &quot;00-1&quot;, &quot;--3&quot;, &quot;+-3&quot;, &quot;+3-1&quot;, &quot;-+019.0&quot;, &quot;12.12.13.12&quot;, &quot;123\nnot a number&quot;]
+  INFINITY = [1.0/0.0]
 
   def setup
     Topic.instance_variable_set(&quot;@validate_callbacks&quot;, ActiveSupport::Callbacks::CallbackChain.new)
@@ -1390,27 +1415,27 @@ class ValidatesNumericalityTest &lt; ActiveRecord::TestCase
     Topic.validates_numericality_of :approved
 
     invalid!(NIL + BLANK + JUNK)
-    valid!(FLOATS + INTEGERS + BIGDECIMAL)
+    valid!(FLOATS + INTEGERS + BIGDECIMAL + INFINITY)
   end
 
   def test_validates_numericality_of_with_nil_allowed
     Topic.validates_numericality_of :approved, :allow_nil =&gt; true
 
     invalid!(BLANK + JUNK)
-    valid!(NIL + FLOATS + INTEGERS + BIGDECIMAL)
+    valid!(NIL + FLOATS + INTEGERS + BIGDECIMAL + INFINITY)
   end
 
   def test_validates_numericality_of_with_integer_only
     Topic.validates_numericality_of :approved, :only_integer =&gt; true
 
-    invalid!(NIL + BLANK + JUNK + FLOATS + BIGDECIMAL)
+    invalid!(NIL + BLANK + JUNK + FLOATS + BIGDECIMAL + INFINITY)
     valid!(INTEGERS)
   end
 
   def test_validates_numericality_of_with_integer_only_and_nil_allowed
     Topic.validates_numericality_of :approved, :only_integer =&gt; true, :allow_nil =&gt; true
 
-    invalid!(BLANK + JUNK + FLOATS + BIGDECIMAL)
+    invalid!(BLANK + JUNK + FLOATS + BIGDECIMAL + INFINITY)
     valid!(NIL + INTEGERS)
   end
 
@@ -1431,7 +1456,7 @@ class ValidatesNumericalityTest &lt; ActiveRecord::TestCase
   def test_validates_numericality_with_equal_to
     Topic.validates_numericality_of :approved, :equal_to =&gt; 10
 
-    invalid!([-10, 11], 'must be equal to 10')
+    invalid!([-10, 11] + INFINITY, 'must be equal to 10')
     valid!([10])
   end
 </diff>
      <filename>vendor/rails/activerecord/test/cases/validations_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
 class Author &lt; ActiveRecord::Base
   has_many :posts
   has_many :posts_with_comments, :include =&gt; :comments, :class_name =&gt; &quot;Post&quot;
+  has_many :posts_with_comments_sorted_by_comment_id, :include =&gt; :comments, :class_name =&gt; &quot;Post&quot;, :order =&gt; 'comments.id'
   has_many :posts_with_categories, :include =&gt; :categories, :class_name =&gt; &quot;Post&quot;
   has_many :posts_with_comments_and_categories, :include =&gt; [ :comments, :categories ], :order =&gt; &quot;posts.id&quot;, :class_name =&gt; &quot;Post&quot;
   has_many :posts_containing_the_letter_a, :class_name =&gt; &quot;Post&quot;
@@ -31,6 +32,9 @@ class Author &lt; ActiveRecord::Base
   has_many :special_posts
   has_many :special_post_comments, :through =&gt; :special_posts, :source =&gt; :comments
 
+  has_many :sti_posts, :class_name =&gt; 'StiPost'
+  has_many :sti_post_comments, :through =&gt; :sti_posts, :source =&gt; :comments
+
   has_many :special_nonexistant_posts, :class_name =&gt; &quot;SpecialPost&quot;, :conditions =&gt; &quot;posts.body = 'nonexistant'&quot;
   has_many :special_nonexistant_post_comments, :through =&gt; :special_nonexistant_posts, :source =&gt; :comments, :conditions =&gt; &quot;comments.post_id = 0&quot;
   has_many :nonexistant_comments, :through =&gt; :posts</diff>
      <filename>vendor/rails/activerecord/test/models/author.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,7 @@ class Category &lt; ActiveRecord::Base
   has_and_belongs_to_many :posts
   has_and_belongs_to_many :special_posts, :class_name =&gt; &quot;Post&quot;
   has_and_belongs_to_many :other_posts, :class_name =&gt; &quot;Post&quot;
+  has_and_belongs_to_many :posts_with_authors_sorted_by_author_id, :class_name =&gt; &quot;Post&quot;, :include =&gt; :authors, :order =&gt; &quot;authors.id&quot;
 
   has_and_belongs_to_many(:select_testing_posts,
                           :class_name =&gt; 'Post',</diff>
      <filename>vendor/rails/activerecord/test/models/category.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,13 @@ end
 module Namespaced
   class Company &lt; ::Company
   end
+
+  class Firm &lt; ::Company
+    has_many :clients, :class_name =&gt; 'Namespaced::Client'
+  end
+
+  class Client &lt; ::Company
+  end
 end
 
 class Firm &lt; Company
@@ -26,6 +33,7 @@ class Firm &lt; Company
       &quot;AND (#{QUOTED_TYPE} = 'Client' OR #{QUOTED_TYPE} = 'SpecialClient' OR #{QUOTED_TYPE} = 'VerySpecialClient' )&quot;
   has_many :clients_sorted_desc, :class_name =&gt; &quot;Client&quot;, :order =&gt; &quot;id DESC&quot;
   has_many :clients_of_firm, :foreign_key =&gt; &quot;client_of&quot;, :class_name =&gt; &quot;Client&quot;, :order =&gt; &quot;id&quot;
+  has_many :unvalidated_clients_of_firm, :foreign_key =&gt; &quot;client_of&quot;, :class_name =&gt; &quot;Client&quot;, :validate =&gt; false
   has_many :dependent_clients_of_firm, :foreign_key =&gt; &quot;client_of&quot;, :class_name =&gt; &quot;Client&quot;, :order =&gt; &quot;id&quot;, :dependent =&gt; :destroy
   has_many :exclusively_dependent_clients_of_firm, :foreign_key =&gt; &quot;client_of&quot;, :class_name =&gt; &quot;Client&quot;, :order =&gt; &quot;id&quot;, :dependent =&gt; :delete_all
   has_many :limited_clients, :class_name =&gt; &quot;Client&quot;, :order =&gt; &quot;id&quot;, :limit =&gt; 1
@@ -46,7 +54,8 @@ class Firm &lt; Company
   has_many :plain_clients, :class_name =&gt; 'Client'
   has_many :readonly_clients, :class_name =&gt; 'Client', :readonly =&gt; true
 
-  has_one :account, :foreign_key =&gt; &quot;firm_id&quot;, :dependent =&gt; :destroy
+  has_one :account, :foreign_key =&gt; &quot;firm_id&quot;, :dependent =&gt; :destroy, :validate =&gt; true
+  has_one :unvalidated_account, :foreign_key =&gt; &quot;firm_id&quot;, :class_name =&gt; 'Account', :validate =&gt; false
   has_one :account_with_select, :foreign_key =&gt; &quot;firm_id&quot;, :select =&gt; &quot;id, firm_id&quot;, :class_name=&gt;'Account'
   has_one :readonly_account, :foreign_key =&gt; &quot;firm_id&quot;, :class_name =&gt; &quot;Account&quot;, :readonly =&gt; true
 end</diff>
      <filename>vendor/rails/activerecord/test/models/company.rb</filename>
    </modified>
    <modified>
      <diff>@@ -43,6 +43,8 @@ class Developer &lt; ActiveRecord::Base
 
   has_many :audit_logs
 
+  named_scope :jamises, :conditions =&gt; {:name =&gt; 'Jamis'}
+
   validates_inclusion_of :salary, :in =&gt; 50000..200000
   validates_length_of    :name, :within =&gt; 3..20
 
@@ -56,7 +58,8 @@ class Developer &lt; ActiveRecord::Base
 end
 
 class AuditLog &lt; ActiveRecord::Base
-  belongs_to :developer
+  belongs_to :developer, :validate =&gt; true
+  belongs_to :unvalidated_developer, :class_name =&gt; 'Developer'
 end
 
 DeveloperSalary = Struct.new(:amount)</diff>
      <filename>vendor/rails/activerecord/test/models/developer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,5 +6,5 @@ class Person &lt; ActiveRecord::Base
   has_many :references
   has_many :jobs, :through =&gt; :references
   has_one :favourite_reference, :class_name =&gt; 'Reference', :conditions =&gt; ['favourite=?', true]
-
+  has_many :posts_with_comments_sorted_by_comment_id, :through =&gt; :readers, :source =&gt; :post, :include =&gt; :comments, :order =&gt; 'comments.id'
 end</diff>
      <filename>vendor/rails/activerecord/test/models/person.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,11 @@
 class Post &lt; ActiveRecord::Base
   named_scope :containing_the_letter_a, :conditions =&gt; &quot;body LIKE '%a%'&quot;
-  
+  named_scope :with_authors_at_address, lambda { |address| {
+      :conditions =&gt; [ 'authors.author_address_id = ?', address.id ],
+      :joins =&gt; 'JOIN authors ON authors.id = posts.author_id'
+    }
+  }
+
   belongs_to :author do
     def greeting
       &quot;hello&quot;</diff>
      <filename>vendor/rails/activerecord/test/models/post.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ class Project &lt; ActiveRecord::Base
   has_and_belongs_to_many :developers_named_david, :class_name =&gt; &quot;Developer&quot;, :conditions =&gt; &quot;name = 'David'&quot;, :uniq =&gt; true
   has_and_belongs_to_many :developers_named_david_with_hash_conditions, :class_name =&gt; &quot;Developer&quot;, :conditions =&gt; { :name =&gt; 'David' }, :uniq =&gt; true
   has_and_belongs_to_many :salaried_developers, :class_name =&gt; &quot;Developer&quot;, :conditions =&gt; &quot;salary &gt; 0&quot;
-  has_and_belongs_to_many :developers_with_finder_sql, :class_name =&gt; &quot;Developer&quot;, :finder_sql =&gt; 'SELECT t.*, j.* FROM developers_projects j, developers t WHERE t.id = j.developer_id AND j.project_id = #{id}'
+  has_and_belongs_to_many :developers_with_finder_sql, :class_name =&gt; &quot;Developer&quot;, :finder_sql =&gt; 'SELECT t.*, j.* FROM developers_projects j, developers t WHERE t.id = j.developer_id AND j.project_id = #{id} ORDER BY t.id'
   has_and_belongs_to_many :developers_by_sql, :class_name =&gt; &quot;Developer&quot;, :delete_sql =&gt; &quot;DELETE FROM developers_projects WHERE project_id = \#{id} AND developer_id = \#{record.id}&quot;
   has_and_belongs_to_many :developers_with_callbacks, :class_name =&gt; &quot;Developer&quot;, :before_add =&gt; Proc.new {|o, r| o.developers_log &lt;&lt; &quot;before_adding#{r.id || '&lt;new&gt;'}&quot;},
                             :after_add =&gt; Proc.new {|o, r| o.developers_log &lt;&lt; &quot;after_adding#{r.id || '&lt;new&gt;'}&quot;},</diff>
      <filename>vendor/rails/activerecord/test/models/project.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/activerecord/test/models/reply.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ class Topic &lt; ActiveRecord::Base
     { :conditions =&gt; ['written_on &lt; ?', time] }
   }
   named_scope :approved, :conditions =&gt; {:approved =&gt; true}
+  named_scope 'approved_as_string', :conditions =&gt; {:approved =&gt; true}
   named_scope :replied, :conditions =&gt; ['replies_count &gt; 0']
   named_scope :anonymous_extension do
     def one</diff>
      <filename>vendor/rails/activerecord/test/models/topic.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 ActiveRecord::Schema.define do
-  create_table :binary_fields, :force =&gt; true do |t|
+  create_table :binary_fields, :force =&gt; true, :options =&gt; 'CHARACTER SET latin1' do |t|
     t.binary :tiny_blob,   :limit =&gt; 255
     t.binary :normal_blob, :limit =&gt; 65535
     t.binary :medium_blob, :limit =&gt; 16777215
@@ -9,4 +9,4 @@ ActiveRecord::Schema.define do
     t.text   :medium_text, :limit =&gt; 16777215
     t.text   :long_text,   :limit =&gt; 2147483647
   end
-end
\ No newline at end of file
+end</diff>
      <filename>vendor/rails/activerecord/test/schema/mysql_specific_schema.rb</filename>
    </modified>
    <modified>
      <diff>@@ -66,6 +66,7 @@ ActiveRecord::Schema.define do
   create_table :categories, :force =&gt; true do |t|
     t.string :name, :null =&gt; false
     t.string :type
+    t.integer :categorizations_count
   end
 
   create_table :categories_posts, :force =&gt; true, :id =&gt; false do |t|
@@ -407,6 +408,13 @@ ActiveRecord::Schema.define do
     t.column :key, :string
   end
 
+  create_table :integer_limits, :force =&gt; true do |t|
+    t.integer :&quot;c_int_without_limit&quot;
+    (1..8).each do |i|
+      t.integer :&quot;c_int_#{i}&quot;, :limit =&gt; i
+    end
+  end
+
   except 'SQLite' do
     # fk_test_has_fk should be before fk_test_has_pk
     create_table :fk_test_has_fk, :force =&gt; true do |t|</diff>
      <filename>vendor/rails/activerecord/test/schema/schema.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,8 @@
+*2.1.1 (September 4th, 2008)*
+
+* Fixed Base#exists? to check status code as integer [#299 state:resolved] (Wes Oldenbeuving)
+
+
 *2.1.0 (May 31st, 2008)*
 
 * Fixed response logging to use length instead of the entire thing (seangeo) [#27]</diff>
      <filename>vendor/rails/activeresource/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,7 @@ require 'rake/rdoctask'
 require 'rake/packagetask'
 require 'rake/gempackagetask'
 require 'rake/contrib/sshpublisher'
+require 'rake/contrib/rubyforgepublisher'
 
 require File.join(File.dirname(__FILE__), 'lib', 'active_resource', 'version')
 
@@ -42,9 +43,10 @@ Rake::RDocTask.new { |rdoc|
   rdoc.title    = &quot;Active Resource -- Object-oriented REST services&quot;
   rdoc.options &lt;&lt; '--line-numbers' &lt;&lt; '--inline-source' &lt;&lt; '-A cattr_accessor=object'
   rdoc.options &lt;&lt; '--charset' &lt;&lt; 'utf-8'
-  rdoc.template = &quot;#{ENV['template']}.rb&quot; if ENV['template']
+  rdoc.template = ENV['template'] ? &quot;#{ENV['template']}.rb&quot; : '../doc/template/horo'
   rdoc.rdoc_files.include('README', 'CHANGELOG')
   rdoc.rdoc_files.include('lib/**/*.rb')
+  rdoc.rdoc_files.exclude('lib/activeresource.rb')
 }
 
 
@@ -64,7 +66,7 @@ spec = Gem::Specification.new do |s|
     s.files = s.files + Dir.glob( &quot;#{dir}/**/*&quot; ).delete_if { |item| item.include?( &quot;\.svn&quot; ) }
   end
   
-  s.add_dependency('activesupport', '= 2.1.0' + PKG_BUILD)
+  s.add_dependency('activesupport', '= 2.1.1' + PKG_BUILD)
 
   s.require_path = 'lib'
   s.autorequire = 'active_resource'
@@ -114,13 +116,13 @@ end
 
 desc &quot;Publish the beta gem&quot;
 task :pgem =&gt; [:package] do 
-  Rake::SshFilePublisher.new(&quot;davidhh@wrath.rubyonrails.org&quot;, &quot;public_html/gems/gems&quot;, &quot;pkg&quot;, &quot;#{PKG_FILE_NAME}.gem&quot;).upload
-  `ssh davidhh@wrath.rubyonrails.org './gemupdate.sh'`
+  Rake::SshFilePublisher.new(&quot;david@greed.loudthinking.com&quot;, &quot;/u/sites/gems/gems&quot;, &quot;pkg&quot;, &quot;#{PKG_FILE_NAME}.gem&quot;).upload
+  `ssh david@greed.loudthinking.com '/u/sites/gems/gemupdate.sh'`
 end
 
 desc &quot;Publish the API documentation&quot;
 task :pdoc =&gt; [:rdoc] do 
-  Rake::SshDirPublisher.new(&quot;davidhh@wrath.rubyonrails.org&quot;, &quot;public_html/ar&quot;, &quot;doc&quot;).upload
+  Rake::SshDirPublisher.new(&quot;wrath.rubyonrails.org&quot;, &quot;public_html/ar&quot;, &quot;doc&quot;).upload
 end
 
 desc &quot;Publish the release files to RubyForge.&quot;</diff>
      <filename>vendor/rails/activeresource/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -356,6 +356,9 @@ module ActiveResource
         # Replace :placeholders with '#{embedded options[:lookups]}'
         prefix_call = value.gsub(/:\w+/) { |key| &quot;\#{options[#{key}]}&quot; }
 
+        # Clear prefix parameters in case they have been cached
+        @prefix_parameters = nil
+
         # Redefine the new methods.
         code = &lt;&lt;-end_code
           def prefix_source() &quot;#{value}&quot; end
@@ -538,7 +541,7 @@ module ActiveResource
           prefix_options, query_options = split_options(options[:params])
           path = element_path(id, prefix_options, query_options)
           response = connection.head(path, headers)
-          response.code == 200
+          response.code.to_i == 200
         end
         # id &amp;&amp; !find_single(id, options).nil?
       rescue ActiveResource::ResourceNotFound
@@ -840,8 +843,13 @@ module ActiveResource
     #
     #   my_group.to_xml(:skip_instruct =&gt; true)
     #   # =&gt; &lt;subsidiary_group&gt; [...] &lt;/subsidiary_group&gt;
-    def to_xml(options={})
-      attributes.to_xml({:root =&gt; self.class.element_name}.merge(options))
+    def encode(options={})
+      case self.class.format
+        when ActiveResource::Formats[:xml]
+          self.class.format.encode(attributes, {:root =&gt; self.class.element_name}.merge(options))
+        else
+          self.class.format.encode(attributes, options)
+      end
     end
 
     # A method to reload the attributes of this object from the remote web service.
@@ -926,14 +934,14 @@ module ActiveResource
 
       # Update the resource on the remote service.
       def update
-        returning connection.put(element_path(prefix_options), to_xml, self.class.headers) do |response|
+        returning connection.put(element_path(prefix_options), encode, self.class.headers) do |response|
           load_attributes_from_response(response)
         end
       end
 
       # Create (i.e., save to the remote service) the new resource.
       def create
-        returning connection.post(collection_path, to_xml, self.class.headers) do |response|
+        returning connection.post(collection_path, encode, self.class.headers) do |response|
           self.id = id_from_response(response)
           load_attributes_from_response(response)
         end
@@ -988,7 +996,11 @@ module ActiveResource
           self.class.const_get(resource_name)
         end
       rescue NameError
-        resource = self.class.const_set(resource_name, Class.new(ActiveResource::Base))
+        if self.class.const_defined?(resource_name)
+          resource = self.class.const_get(resource_name)
+        else
+          resource = self.class.const_set(resource_name, Class.new(ActiveResource::Base))
+        end
         resource.prefix = self.class.prefix
         resource.site   = self.class.site
         resource</diff>
      <filename>vendor/rails/activeresource/lib/active_resource/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -63,6 +63,13 @@ module ActiveResource
   # This class is used by ActiveResource::Base to interface with REST
   # services.
   class Connection
+
+    HTTP_FORMAT_HEADER_NAMES = {  :get =&gt; 'Accept',
+      :put =&gt; 'Content-Type',
+      :post =&gt; 'Content-Type',
+      :delete =&gt; 'Accept'
+    }
+
     attr_reader :site, :user, :password, :timeout
     attr_accessor :format
 
@@ -106,25 +113,25 @@ module ActiveResource
     # Execute a GET request.
     # Used to get (find) resources.
     def get(path, headers = {})
-      format.decode(request(:get, path, build_request_headers(headers)).body)
+      format.decode(request(:get, path, build_request_headers(headers, :get)).body)
     end
 
     # Execute a DELETE request (see HTTP protocol documentation if unfamiliar).
     # Used to delete resources.
     def delete(path, headers = {})
-      request(:delete, path, build_request_headers(headers))
+      request(:delete, path, build_request_headers(headers, :delete))
     end
 
     # Execute a PUT request (see HTTP protocol documentation if unfamiliar).
     # Used to update resources.
     def put(path, body = '', headers = {})
-      request(:put, path, body.to_s, build_request_headers(headers))
+      request(:put, path, body.to_s, build_request_headers(headers, :put))
     end
 
     # Execute a POST request.
     # Used to create new resources.
     def post(path, body = '', headers = {})
-      request(:post, path, body.to_s, build_request_headers(headers))
+      request(:post, path, body.to_s, build_request_headers(headers, :post))
     end
 
     # Execute a HEAD request.
@@ -187,12 +194,12 @@ module ActiveResource
       end
 
       def default_header
-        @default_header ||= { 'Content-Type' =&gt; format.mime_type }
+        @default_header ||= {}
       end
 
       # Builds headers for request to remote service.
-      def build_request_headers(headers)
-        authorization_header.update(default_header).update(headers)
+      def build_request_headers(headers, http_method=nil)
+        authorization_header.update(default_header).update(headers).update(http_format_header(http_method))
       end
 
       # Sets authorization header
@@ -200,6 +207,10 @@ module ActiveResource
         (@user || @password ? { 'Authorization' =&gt; 'Basic ' + [&quot;#{@user}:#{ @password}&quot;].pack('m').delete(&quot;\r\n&quot;) } : {})
       end
 
+      def http_format_header(http_method)
+        {HTTP_FORMAT_HEADER_NAMES[http_method] =&gt; format.mime_type}
+      end
+
       def logger #:nodoc:
         ActiveResource::Base.logger
       end</diff>
      <filename>vendor/rails/activeresource/lib/active_resource/connection.rb</filename>
    </modified>
    <modified>
      <diff>@@ -30,7 +30,7 @@ module ActiveResource
   #   Person.get(:active)  # GET /people/active.xml
   #   # =&gt; [{:id =&gt; 1, :name =&gt; 'Ryan'}, {:id =&gt; 2, :name =&gt; 'Joe'}]
   #
-  module CustomMethods 
+  module CustomMethods
     def self.included(base)
       base.class_eval do
         extend ActiveResource::CustomMethods::ClassMethods
@@ -83,24 +83,25 @@ module ActiveResource
         &quot;#{prefix(prefix_options)}#{collection_name}/#{method_name}.#{format.extension}#{query_string(query_options)}&quot;
       end
     end
-    
+
     module InstanceMethods
       def get(method_name, options = {})
         connection.get(custom_method_element_url(method_name, options), self.class.headers)
       end
-      
-      def post(method_name, options = {}, body = '')
+
+      def post(method_name, options = {}, body = nil)
+        request_body = body.nil? ? encode : body
         if new?
-          connection.post(custom_method_new_element_url(method_name, options), (body.nil? ? to_xml : body), self.class.headers)
+          connection.post(custom_method_new_element_url(method_name, options), request_body, self.class.headers)
         else
-          connection.post(custom_method_element_url(method_name, options), body, self.class.headers)
+          connection.post(custom_method_element_url(method_name, options), request_body, self.class.headers)
         end
       end
-      
+
       def put(method_name, options = {}, body = '')
         connection.put(custom_method_element_url(method_name, options), body, self.class.headers)
       end
-      
+
       def delete(method_name, options = {})
         connection.delete(custom_method_element_url(method_name, options), self.class.headers)
       end
@@ -110,7 +111,7 @@ module ActiveResource
         def custom_method_element_url(method_name, options = {})
           &quot;#{self.class.prefix(prefix_options)}#{self.class.collection_name}/#{id}/#{method_name}.#{self.class.format.extension}#{self.class.send!(:query_string, options)}&quot;
         end
-      
+
         def custom_method_new_element_url(method_name, options = {})
           &quot;#{self.class.prefix(prefix_options)}#{self.class.collection_name}/new/#{method_name}.#{self.class.format.extension}#{self.class.send!(:query_string, options)}&quot;
         end</diff>
      <filename>vendor/rails/activeresource/lib/active_resource/custom_methods.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,22 +2,22 @@ module ActiveResource
   module Formats
     module JsonFormat
       extend self
-      
+
       def extension
         &quot;json&quot;
       end
-      
+
       def mime_type
         &quot;application/json&quot;
       end
-      
-      def encode(hash)
+
+      def encode(hash, options={})
         hash.to_json
       end
-      
+
       def decode(json)
         ActiveSupport::JSON.decode(json)
       end
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>vendor/rails/activeresource/lib/active_resource/formats/json_format.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,23 +2,23 @@ module ActiveResource
   module Formats
     module XmlFormat
       extend self
-      
+
       def extension
         &quot;xml&quot;
       end
-      
+
       def mime_type
         &quot;application/xml&quot;
       end
-      
-      def encode(hash)
-        hash.to_xml
+
+      def encode(hash, options={})
+        hash.to_xml(options)
       end
-      
+
       def decode(xml)
         from_xml_data(Hash.from_xml(xml))
       end
-      
+
       private
         # Manipulate from_xml Hash, because xml_simple is not exactly what we
         # want for Active Resource.
@@ -28,7 +28,7 @@ module ActiveResource
           else
             data
           end
-        end      
+        end
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>vendor/rails/activeresource/lib/active_resource/formats/xml_format.rb</filename>
    </modified>
    <modified>
      <diff>@@ -146,7 +146,7 @@ module ActiveResource
     attr_accessor :path, :method, :body, :headers
 
     def initialize(method, path, body = nil, headers = {})
-      @method, @path, @body, @headers = method, path, body, headers.reverse_merge('Content-Type' =&gt; 'application/xml')
+      @method, @path, @body, @headers = method, path, body, headers.merge(ActiveResource::Connection::HTTP_FORMAT_HEADER_NAMES[method] =&gt; 'application/xml')
     end
 
     def ==(other_request)</diff>
      <filename>vendor/rails/activeresource/lib/active_resource/http_mock.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ module ActiveResource
   module VERSION #:nodoc:
     MAJOR = 2
     MINOR = 1
-    TINY  = 0
+    TINY  = 1
 
     STRING = [MAJOR, MINOR, TINY].join('.')
   end</diff>
      <filename>vendor/rails/activeresource/lib/active_resource/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,14 +9,18 @@ require 'setter_trap'
 
 ActiveResource::Base.logger = Logger.new(&quot;#{File.dirname(__FILE__)}/debug.log&quot;)
 
+def uses_gem(gem_name, test_name, version = '&gt; 0')
+  require 'rubygems'
+  gem gem_name.to_s, version
+  require gem_name.to_s
+  yield
+rescue LoadError
+  $stderr.puts &quot;Skipping #{test_name} tests. `gem install #{gem_name}` and try again.&quot;
+end
+
 # Wrap tests that use Mocha and skip if unavailable.
-def uses_mocha(test_name)
-  unless Object.const_defined?(:Mocha)
-    require 'mocha'
-    require 'stubba'
+unless defined? uses_mocha
+  def uses_mocha(test_name, &amp;block)
+    uses_gem('mocha', test_name, '&gt;= 0.5.5', &amp;block)
   end
-  yield
-rescue LoadError =&gt; load_error
-  raise unless load_error.message =~ /mocha/i
-  $stderr.puts &quot;Skipping #{test_name} tests. `gem install mocha` and try again.&quot;
-end
\ No newline at end of file
+end</diff>
      <filename>vendor/rails/activeresource/test/abstract_unit.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,8 +10,7 @@ class CustomMethodsTest &lt; Test::Unit::TestCase
     @ryan  = { :name =&gt; 'Ryan' }.to_xml(:root =&gt; 'person')
     @addy  = { :id =&gt; 1, :street =&gt; '12345 Street' }.to_xml(:root =&gt; 'address')
     @addy_deep  = { :id =&gt; 1, :street =&gt; '12345 Street', :zip =&gt; &quot;27519&quot; }.to_xml(:root =&gt; 'address')
-    @default_request_headers = { 'Content-Type' =&gt; 'application/xml' }
-    
+
     ActiveResource::HttpMock.respond_to do |mock|
       mock.get    &quot;/people/1.xml&quot;,             {}, @matz
       mock.get    &quot;/people/1/shallow.xml&quot;, {}, @matz</diff>
      <filename>vendor/rails/activeresource/test/base/custom_methods_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 require 'abstract_unit'
 require &quot;fixtures/person&quot;
+require &quot;fixtures/customer&quot;
 require &quot;fixtures/street_address&quot;
 require &quot;fixtures/beast&quot;
 
@@ -15,6 +16,37 @@ class BaseTest &lt; Test::Unit::TestCase
     @people_david = [{ :id =&gt; 2, :name =&gt; 'David' }].to_xml(:root =&gt; 'people')
     @addresses = [{ :id =&gt; 1, :street =&gt; '12345 Street' }].to_xml(:root =&gt; 'addresses')
 
+    # - deep nested resource -
+    # - Luis (Customer)
+    #   - JK (Customer::Friend)
+    #     - Mateo (Customer::Friend::Brother)
+    #       - Edith (Customer::Friend::Brother::Child)
+    #       - Martha (Customer::Friend::Brother::Child)
+    #     - Felipe (Customer::Friend::Brother)
+    #       - Bryan (Customer::Friend::Brother::Child)
+    #       - Luke (Customer::Friend::Brother::Child)
+    #   - Eduardo (Customer::Friend)
+    #     - Sebas (Customer::Friend::Brother)
+    #       - Andres (Customer::Friend::Brother::Child)
+    #       - Jorge (Customer::Friend::Brother::Child)
+    #     - Elsa (Customer::Friend::Brother)
+    #       - Natacha (Customer::Friend::Brother::Child)
+    #     - Milena (Customer::Friend::Brother)
+    #
+    @luis = {:id =&gt; 1, :name =&gt; 'Luis',
+              :friends =&gt; [{:name =&gt; 'JK',
+                            :brothers =&gt; [{:name =&gt; 'Mateo',
+                                           :children =&gt; [{:name =&gt; 'Edith'},{:name =&gt; 'Martha'}]},
+                                          {:name =&gt; 'Felipe',
+                                           :children =&gt; [{:name =&gt; 'Bryan'},{:name =&gt; 'Luke'}]}]},
+                           {:name =&gt; 'Eduardo',
+                            :brothers =&gt; [{:name =&gt; 'Sebas',
+                                           :children =&gt; [{:name =&gt; 'Andres'},{:name =&gt; 'Jorge'}]},
+                                          {:name =&gt; 'Elsa',
+                                           :children =&gt; [{:name =&gt; 'Natacha'}]},
+                                          {:name =&gt; 'Milena',
+                                           :children =&gt; []}]}]}.to_xml(:root =&gt; 'customer')
+
     ActiveResource::HttpMock.respond_to do |mock|
       mock.get    &quot;/people/1.xml&quot;,                {}, @matz
       mock.get    &quot;/people/2.xml&quot;,                {}, @david
@@ -46,6 +78,8 @@ class BaseTest &lt; Test::Unit::TestCase
       mock.head   &quot;/people/1/addresses/2.xml&quot;,    {}, nil, 404
       mock.head   &quot;/people/2/addresses/1.xml&quot;,    {}, nil, 404
       mock.head   &quot;/people/Greg/addresses/1.xml&quot;, {}, nil, 200
+      # customer
+      mock.get    &quot;/customers/1.xml&quot;,             {}, @luis
     end
 
     Person.user = nil
@@ -450,7 +484,16 @@ class BaseTest &lt; Test::Unit::TestCase
       assert_equal &quot;the_prefixthe_param_value&quot;, person_class.prefix(:the_param =&gt; &quot;the_param_value&quot;)
     end
   end
-  
+
+  def test_set_prefix_twice_should_clear_params
+    SetterTrap.rollback_sets(Person) do |person_class|
+      person_class.prefix = &quot;the_prefix/:the_param1&quot;
+      assert_equal Set.new([:the_param1]), person_class.prefix_parameters
+      person_class.prefix = &quot;the_prefix/:the_param2&quot;
+      assert_equal Set.new([:the_param2]), person_class.prefix_parameters
+    end
+  end
+
   def test_set_prefix_with_default_value
     SetterTrap.rollback_sets(Person) do |person_class|
       person_class.set_prefix
@@ -776,7 +819,7 @@ class BaseTest &lt; Test::Unit::TestCase
   
   def test_to_xml
     matz = Person.find(1)
-    xml = matz.to_xml
+    xml = matz.encode
     assert xml.starts_with?('&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;')
     assert xml.include?('&lt;name&gt;Matz&lt;/name&gt;')
     assert xml.include?('&lt;id type=&quot;integer&quot;&gt;1&lt;/id&gt;')
@@ -788,4 +831,18 @@ class BaseTest &lt; Test::Unit::TestCase
     matz = Person.find(1)
     assert_equal '1', matz.to_param
   end
+
+  def test_parse_deep_nested_resources
+    luis = Customer.find(1)
+    assert_kind_of Customer, luis
+    luis.friends.each do |friend|
+      assert_kind_of Customer::Friend, friend
+      friend.brothers.each do |brother|
+        assert_kind_of Customer::Friend::Brother, brother
+        brother.children.each do |child|
+          assert_kind_of Customer::Friend::Brother::Child, child
+        end
+      end
+    end
+  end
 end</diff>
      <filename>vendor/rails/activeresource/test/base_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,14 +5,22 @@ class FormatTest &lt; Test::Unit::TestCase
   def setup
     @matz  = { :id =&gt; 1, :name =&gt; 'Matz' }
     @david = { :id =&gt; 2, :name =&gt; 'David' }
-    
+
     @programmers = [ @matz, @david ]
   end
-  
+
+  def test_http_format_header_name
+    header_name = ActiveResource::Connection::HTTP_FORMAT_HEADER_NAMES[:get]
+    assert_equal 'Accept', header_name
+
+    headers_names = [ActiveResource::Connection::HTTP_FORMAT_HEADER_NAMES[:put], ActiveResource::Connection::HTTP_FORMAT_HEADER_NAMES[:post]]
+    headers_names.each{|header_name| assert_equal 'Content-Type', header_name}
+  end
+
   def test_formats_on_single_element
     for format in [ :json, :xml ]
       using_format(Person, format) do
-        ActiveResource::HttpMock.respond_to.get &quot;/people/1.#{format}&quot;, {}, ActiveResource::Formats[format].encode(@david)
+        ActiveResource::HttpMock.respond_to.get &quot;/people/1.#{format}&quot;, {'Accept' =&gt; ActiveResource::Formats[format].mime_type}, ActiveResource::Formats[format].encode(@david)
         assert_equal @david[:name], Person.find(1).name
       end
     end
@@ -21,7 +29,7 @@ class FormatTest &lt; Test::Unit::TestCase
   def test_formats_on_collection
     for format in [ :json, :xml ]
       using_format(Person, format) do
-        ActiveResource::HttpMock.respond_to.get &quot;/people.#{format}&quot;, {}, ActiveResource::Formats[format].encode(@programmers)
+        ActiveResource::HttpMock.respond_to.get &quot;/people.#{format}&quot;, {'Accept' =&gt; ActiveResource::Formats[format].mime_type}, ActiveResource::Formats[format].encode(@programmers)
         remote_programmers = Person.find(:all)
         assert_equal 2, remote_programmers.size
         assert remote_programmers.select { |p| p.name == 'David' }
@@ -32,7 +40,7 @@ class FormatTest &lt; Test::Unit::TestCase
   def test_formats_on_custom_collection_method
     for format in [ :json, :xml ]
       using_format(Person, format) do
-        ActiveResource::HttpMock.respond_to.get &quot;/people/retrieve.#{format}?name=David&quot;, {}, ActiveResource::Formats[format].encode([@david])
+        ActiveResource::HttpMock.respond_to.get &quot;/people/retrieve.#{format}?name=David&quot;, {'Accept' =&gt; ActiveResource::Formats[format].mime_type}, ActiveResource::Formats[format].encode([@david])
         remote_programmers = Person.get(:retrieve, :name =&gt; 'David')
         assert_equal 1, remote_programmers.size
         assert_equal @david[:id], remote_programmers[0]['id']
@@ -40,13 +48,13 @@ class FormatTest &lt; Test::Unit::TestCase
       end
     end
   end
-  
+
   def test_formats_on_custom_element_method
     for format in [ :json, :xml ]
       using_format(Person, format) do
         ActiveResource::HttpMock.respond_to do |mock|
-          mock.get &quot;/people/2.#{format}&quot;, {}, ActiveResource::Formats[format].encode(@david)
-          mock.get &quot;/people/2/shallow.#{format}&quot;, {}, ActiveResource::Formats[format].encode(@david)
+          mock.get &quot;/people/2.#{format}&quot;, {'Accept' =&gt; ActiveResource::Formats[format].mime_type}, ActiveResource::Formats[format].encode(@david)
+          mock.get &quot;/people/2/shallow.#{format}&quot;, {'Accept' =&gt; ActiveResource::Formats[format].mime_type}, ActiveResource::Formats[format].encode(@david)
         end
         remote_programmer = Person.find(2).get(:shallow)
         assert_equal @david[:id], remote_programmer['id']
@@ -57,20 +65,24 @@ class FormatTest &lt; Test::Unit::TestCase
     for format in [ :json, :xml ]
       ryan = ActiveResource::Formats[format].encode({ :name =&gt; 'Ryan' })
       using_format(Person, format) do
-        ActiveResource::HttpMock.respond_to.post &quot;/people/new/register.#{format}&quot;, {}, ryan, 201, 'Location' =&gt; &quot;/people/5.#{format}&quot;
         remote_ryan = Person.new(:name =&gt; 'Ryan')
+        ActiveResource::HttpMock.respond_to.post &quot;/people.#{format}&quot;, {'Content-Type' =&gt; ActiveResource::Formats[format].mime_type}, ryan, 201, {'Location' =&gt; &quot;/people/5.#{format}&quot;}
+        remote_ryan.save
+
+        remote_ryan = Person.new(:name =&gt; 'Ryan')
+        ActiveResource::HttpMock.respond_to.post &quot;/people/new/register.#{format}&quot;, {'Content-Type' =&gt; ActiveResource::Formats[format].mime_type}, ryan, 201, {'Location' =&gt; &quot;/people/5.#{format}&quot;}
         assert_equal ActiveResource::Response.new(ryan, 201, {'Location' =&gt; &quot;/people/5.#{format}&quot;}), remote_ryan.post(:register)
       end
     end
   end
-  
+
   def test_setting_format_before_site
     resource = Class.new(ActiveResource::Base)
     resource.format = :json
     resource.site   = 'http://37s.sunrise.i:3000'
     assert_equal ActiveResource::Formats[:json], resource.connection.format
   end
-  
+
   private
     def using_format(klass, mime_type_reference)
       previous_format = klass.format</diff>
      <filename>vendor/rails/activeresource/test/format_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,16 @@
+*2.1.1 (September 4th, 2008)*
+
+* Fix Ruby's Time marshaling bug in pre-1.9 versions of Ruby: utc instances are now correctly unmarshaled with a utc zone instead of the system local zone [#900 state:resolved]:activesupport/CHANGELOG
+
+* TimeWithZone: when crossing DST boundary, treat Durations of days, months or years as variable-length, and all other values as absolute length. A time + 24.hours will advance exactly 24 hours, but a time + 1.day will advance 23-25 hours, depending on the day. Ensure consistent behavior across all advancing methods [Geoff Buesing]
+
+* Fix TimeWithZone unmarshaling: coerce unmarshaled Time instances to utc, because Ruby's marshaling of Time instances doesn't respect the zone [Geoff Buesing]
+
+* Added StringQuestioneer for doing things like StringQuestioneer.new(&quot;production&quot;).production? # =&gt; true and StringQuestioneer.new(&quot;production&quot;).development? # =&gt; false [DHH]
+
+* Fixed Date#end_of_quarter to not blow up on May 31st [#289 state:resolved] (Danger)
+
+
 *2.1.0 (May 31st, 2008)*
 
 * TimeZone#to_s shows offset as GMT instead of UTC, because GMT will be more familiar to end users (see time zone selects used by Windows OS, google.com and yahoo.com.) Reverts [8370] [Geoff Buesing]
@@ -166,7 +179,6 @@
 
 * Introduce ActiveSupport::TimeWithZone, for wrapping Time instances with a TimeZone. Introduce instance methods to Time for creating TimeWithZone instances, and class methods for managing a global time zone. [Geoff Buesing]
 
-&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r8815
 * Replace non-dst-aware TimeZone class with dst-aware class from tzinfo_timezone plugin. TimeZone#adjust and #unadjust are no longer available; tzinfo gem must now be present in order to perform time zone calculations, via #local_to_utc and #utc_to_local methods. [Geoff Buesing]
 
 * Extract ActiveSupport::Callbacks from Active Record, test case setup and teardown, and ActionController::Dispatcher.  #10727 [Josh Peek]</diff>
      <filename>vendor/rails/activesupport/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -43,6 +43,8 @@ require 'active_support/ordered_hash'
 require 'active_support/ordered_options'
 require 'active_support/option_merger'
 
+require 'active_support/string_inquirer'
+
 require 'active_support/values/time_zone'
 require 'active_support/duration'
 
@@ -53,3 +55,7 @@ require 'active_support/multibyte'
 require 'active_support/base64'
 
 require 'active_support/time_with_zone'
+
+Inflector = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Inflector', 'ActiveSupport::Inflector')
+Dependencies = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Dependencies', 'ActiveSupport::Dependencies')
+TimeZone = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('TimeZone', 'ActiveSupport::TimeZone')</diff>
      <filename>vendor/rails/activesupport/lib/active_support.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@ module ActiveSupport
 
     def self.expand_cache_key(key, namespace = nil)
       expanded_cache_key = namespace ? &quot;#{namespace}/&quot; : &quot;&quot;
-      
+
       if ENV[&quot;RAILS_CACHE_ID&quot;] || ENV[&quot;RAILS_APP_VERSION&quot;]
         expanded_cache_key &lt;&lt; &quot;#{ENV[&quot;RAILS_CACHE_ID&quot;] || ENV[&quot;RAILS_APP_VERSION&quot;]}/&quot; 
       end
@@ -31,6 +31,8 @@ module ActiveSupport
         key.collect { |element| expand_cache_key(element) }.to_param
       when key.respond_to?(:to_param)
         key.to_param
+      else
+        key.to_s
       end
 
       expanded_cache_key</diff>
      <filename>vendor/rails/activesupport/lib/active_support/cache.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,14 @@
 module ActiveSupport
   module Cache
     class CompressedMemCacheStore &lt; MemCacheStore
-      def read(name, options = {})
-        if value = super(name, options.merge(:raw =&gt; true))
+      def read(name, options = nil)
+        if value = super(name, (options || {}).merge(:raw =&gt; true))
           Marshal.load(ActiveSupport::Gzip.decompress(value))
         end
       end
 
-      def write(name, value, options = {})
-        super(name, ActiveSupport::Gzip.compress(Marshal.dump(value)), options.merge(:raw =&gt; true))
+      def write(name, value, options = nil)
+        super(name, ActiveSupport::Gzip.compress(Marshal.dump(value)), (options || {}).merge(:raw =&gt; true))
       end
     end
   end</diff>
      <filename>vendor/rails/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,32 @@ module ActiveSupport #:nodoc:
         def acts_like_date?
           true
         end
+
+        # Date memoizes some instance methods using metaprogramming to wrap
+        # the methods with one that caches the result in an instance variable.
+        # If a Date is frozen but the memoized method hasn't been called, the
+        # first call will result in a frozen object error since the memo
+        # instance variable is uninitialized.
+        #
+        # Work around by eagerly memoizing before freezing.
+        #
+        # Ruby 1.9 uses a preinitialized instance variable so it's unaffected.
+        # This hack is as close as we can get to feature detection:
+        begin
+          ::Date.today.freeze.jd
+        rescue =&gt; frozen_object_error
+          if frozen_object_error.message =~ /frozen/
+            def freeze #:nodoc:
+              self.class.private_instance_methods(false).each do |m|
+                if m.to_s =~ /\A__\d+__\Z/
+                  instance_variable_set(:&quot;@#{m}&quot;, [send(m)])
+                end
+              end
+
+              super
+            end
+          end
+        end
       end
     end
   end</diff>
      <filename>vendor/rails/activesupport/lib/active_support/core_ext/date/behavior.rb</filename>
    </modified>
    <modified>
      <diff>@@ -184,7 +184,7 @@ module ActiveSupport #:nodoc:
 
         # Returns a new Date/DateTime representing the end of the quarter (last day of march, june, september, december; DateTime objects will have time set to 23:59:59)
         def end_of_quarter
-          change(:month =&gt; [3, 6, 9, 12].detect { |m| m &gt;= self.month }).end_of_month
+          beginning_of_month.change(:month =&gt; [3, 6, 9, 12].detect { |m| m &gt;= self.month }).end_of_month
         end
         alias :at_end_of_quarter :end_of_quarter
 </diff>
      <filename>vendor/rails/activesupport/lib/active_support/core_ext/date/calculations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,13 +10,14 @@ module ActiveSupport #:nodoc:
       module Except
         # Returns a new hash without the given keys.
         def except(*keys)
-          rejected = Set.new(respond_to?(:convert_key) ? keys.map { |key| convert_key(key) } : keys)
-          reject { |key,| rejected.include?(key) }
+          clone.except!(*keys)
         end
 
         # Replaces the hash without only the given keys.
         def except!(*keys)
-          replace(except(*keys))
+          keys.map! { |key| convert_key(key) } if respond_to?(:convert_key)
+          keys.each { |key| delete(key) }
+          self
         end
       end
     end</diff>
      <filename>vendor/rails/activesupport/lib/active_support/core_ext/hash/except.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,7 +15,9 @@ module ActiveSupport #:nodoc:
         # Returns a new hash with only the given keys.
         def slice(*keys)
           allowed = Set.new(respond_to?(:convert_key) ? keys.map { |key| convert_key(key) } : keys)
-          reject { |key,| !allowed.include?(key) }
+          hash = {}
+          allowed.each { |k| hash[k] = self[k] if has_key?(k) }
+          hash
         end
 
         # Replaces the hash with only the given keys.</diff>
      <filename>vendor/rails/activesupport/lib/active_support/core_ext/hash/slice.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,3 +6,8 @@ require 'active_support/core_ext/module/delegation'
 require 'active_support/core_ext/module/introspection'
 require 'active_support/core_ext/module/loading'
 require 'active_support/core_ext/module/aliasing'
+require 'active_support/core_ext/module/model_naming'
+
+class Module
+  include ActiveSupport::CoreExt::Module::ModelNaming
+end</diff>
      <filename>vendor/rails/activesupport/lib/active_support/core_ext/module.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,17 +3,18 @@ class Object
     Class.remove_class(*subclasses_of(*superclasses))
   end
 
+  # Exclude this class unless it's a subclass of our supers and is defined.
+  # We check defined? in case we find a removed class that has yet to be
+  # garbage collected. This also fails for anonymous classes -- please
+  # submit a patch if you have a workaround.
   def subclasses_of(*superclasses) #:nodoc:
     subclasses = []
 
-    # Exclude this class unless it's a subclass of our supers and is defined.
-    # We check defined? in case we find a removed class that has yet to be
-    # garbage collected. This also fails for anonymous classes -- please
-    # submit a patch if you have a workaround.
-    ObjectSpace.each_object(Class) do |k|
-      if superclasses.any? { |superclass| k &lt; superclass } &amp;&amp;
-        (k.name.blank? || eval(&quot;defined?(::#{k}) &amp;&amp; ::#{k}.object_id == k.object_id&quot;))
-        subclasses &lt;&lt; k
+    superclasses.each do |sup|
+      ObjectSpace.each_object(class &lt;&lt; sup; self; end) do |k|
+        if k != sup &amp;&amp; (k.name.blank? || eval(&quot;defined?(::#{k}) &amp;&amp; ::#{k}.object_id == k.object_id&quot;))
+          subclasses &lt;&lt; k
+        end
       end
     end
 </diff>
      <filename>vendor/rails/activesupport/lib/active_support/core_ext/object/extending.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ module ActiveSupport #:nodoc:
         end
 
         if RUBY_VERSION &lt; '1.9'
-          def step_with_blockless(value, &amp;block)
+          def step_with_blockless(value = 1, &amp;block)
             if block_given?
               step_without_blockless(value, &amp;block)
             else
@@ -18,7 +18,7 @@ module ActiveSupport #:nodoc:
             end
           end
         else
-          def step_with_blockless(value, &amp;block)
+          def step_with_blockless(value = 1, &amp;block)
             if block_given?
               step_without_blockless(value, &amp;block)
             else</diff>
      <filename>vendor/rails/activesupport/lib/active_support/core_ext/range/blockless_step.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,16 +1,16 @@
 module ActiveSupport #:nodoc:
   module CoreExtensions #:nodoc:
     module String #:nodoc:
-      unless '1.9'.respond_to?(:force_encoding)
-        # Define methods for handling unicode data.
-        module Unicode
-          def self.append_features(base)
-            if '1.8.7'.respond_to?(:chars)
-              base.class_eval { remove_method :chars }
-            end
-            super
+      # Define methods for handling unicode data.
+      module Unicode
+        def self.append_features(base)
+          if '1.8.7 and later'.respond_to?(:chars)
+            base.class_eval { remove_method :chars }
           end
+          super
+        end
 
+        unless '1.9'.respond_to?(:force_encoding)
           # +chars+ is a Unicode safe proxy for string methods. It creates and returns an instance of the
           # ActiveSupport::Multibyte::Chars class which encapsulates the original string. A Unicode safe version of all
           # the String methods are defined on this proxy class. Undefined methods are forwarded to String, so all of the
@@ -44,14 +44,12 @@ module ActiveSupport #:nodoc:
           def is_utf8?
             ActiveSupport::Multibyte::Handlers::UTF8Handler.consumes?(self)
           end
-        end
-      else
-        module Unicode #:nodoc:
-          def chars
+        else
+          def chars #:nodoc:
             self
           end
 
-          def is_utf8?
+          def is_utf8? #:nodoc:
             case encoding
               when Encoding::UTF_8
                 valid_encoding?</diff>
      <filename>vendor/rails/activesupport/lib/active_support/core_ext/string/unicode.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,32 @@
 require 'date'
 require 'time'
 
-# Ruby 1.8-cvs and 1.9 define private Time#to_date
 class Time
+  # Ruby 1.8-cvs and 1.9 define private Time#to_date
   %w(to_date to_datetime).each do |method|
     public method if private_instance_methods.include?(method)
   end
+
+  # Pre-1.9 versions of Ruby have a bug with marshaling Time instances, where utc instances are
+  # unmarshaled in the local zone, instead of utc. We're layering behavior on the _dump and _load
+  # methods so that utc instances can be flagged on dump, and coerced back to utc on load.
+  if RUBY_VERSION &lt; '1.9'
+    class &lt;&lt; self
+      alias_method :_original_load, :_load
+      def _load(marshaled_time)
+        time = _original_load(marshaled_time)
+        utc = time.instance_variable_get('@marshal_with_utc_coercion')
+        utc ? time.utc : time
+      end
+    end
+    
+    alias_method :_original_dump, :_dump
+    def _dump(*args)
+      obj = self.frozen? ? self.dup : self
+      obj.instance_variable_set('@marshal_with_utc_coercion', utc?)
+      obj._original_dump(*args)
+    end
+  end
 end
 
 require 'active_support/core_ext/time/behavior'</diff>
      <filename>vendor/rails/activesupport/lib/active_support/core_ext/time.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,458 +3,459 @@ require 'active_support/core_ext/module/attribute_accessors'
 require 'active_support/core_ext/load_error'
 require 'active_support/core_ext/kernel'
 
-module Dependencies #:nodoc:
-  extend self
-
-  # Should we turn on Ruby warnings on the first load of dependent files?
-  mattr_accessor :warnings_on_first_load
-  self.warnings_on_first_load = false
-
-  # All files ever loaded.
-  mattr_accessor :history
-  self.history = Set.new
-
-  # All files currently loaded.
-  mattr_accessor :loaded
-  self.loaded = Set.new
-
-  # Should we load files or require them?
-  mattr_accessor :mechanism
-  self.mechanism = :load
-
-  # The set of directories from which we may automatically load files. Files
-  # under these directories will be reloaded on each request in development mode,
-  # unless the directory also appears in load_once_paths.
-  mattr_accessor :load_paths
-  self.load_paths = []
-
-  # The set of directories from which automatically loaded constants are loaded
-  # only once. All directories in this set must also be present in +load_paths+.
-  mattr_accessor :load_once_paths
-  self.load_once_paths = []
-
-  # An array of qualified constant names that have been loaded. Adding a name to
-  # this array will cause it to be unloaded the next time Dependencies are cleared.
-  mattr_accessor :autoloaded_constants
-  self.autoloaded_constants = []
-
-  # An array of constant names that need to be unloaded on every request. Used
-  # to allow arbitrary constants to be marked for unloading.
-  mattr_accessor :explicitly_unloadable_constants
-  self.explicitly_unloadable_constants = []
-
-  # Set to true to enable logging of const_missing and file loads
-  mattr_accessor :log_activity
-  self.log_activity = false
-
-  # An internal stack used to record which constants are loaded by any block.
-  mattr_accessor :constant_watch_stack
-  self.constant_watch_stack = []
-
-  def load?
-    mechanism == :load
-  end
-
-  def depend_on(file_name, swallow_load_errors = false)
-    path = search_for_file(file_name)
-    require_or_load(path || file_name)
-  rescue LoadError
-    raise unless swallow_load_errors
-  end
-
-  def associate_with(file_name)
-    depend_on(file_name, true)
-  end
+module ActiveSupport #:nodoc:
+  module Dependencies #:nodoc:
+    extend self
+
+    # Should we turn on Ruby warnings on the first load of dependent files?
+    mattr_accessor :warnings_on_first_load
+    self.warnings_on_first_load = false
+
+    # All files ever loaded.
+    mattr_accessor :history
+    self.history = Set.new
+
+    # All files currently loaded.
+    mattr_accessor :loaded
+    self.loaded = Set.new
+
+    # Should we load files or require them?
+    mattr_accessor :mechanism
+    self.mechanism = :load
+
+    # The set of directories from which we may automatically load files. Files
+    # under these directories will be reloaded on each request in development mode,
+    # unless the directory also appears in load_once_paths.
+    mattr_accessor :load_paths
+    self.load_paths = []
+
+    # The set of directories from which automatically loaded constants are loaded
+    # only once. All directories in this set must also be present in +load_paths+.
+    mattr_accessor :load_once_paths
+    self.load_once_paths = []
+
+    # An array of qualified constant names that have been loaded. Adding a name to
+    # this array will cause it to be unloaded the next time Dependencies are cleared.
+    mattr_accessor :autoloaded_constants
+    self.autoloaded_constants = []
+
+    # An array of constant names that need to be unloaded on every request. Used
+    # to allow arbitrary constants to be marked for unloading.
+    mattr_accessor :explicitly_unloadable_constants
+    self.explicitly_unloadable_constants = []
+
+    # Set to true to enable logging of const_missing and file loads
+    mattr_accessor :log_activity
+    self.log_activity = false
+
+    # An internal stack used to record which constants are loaded by any block.
+    mattr_accessor :constant_watch_stack
+    self.constant_watch_stack = []
+
+    def load?
+      mechanism == :load
+    end
 
-  def clear
-    log_call
-    loaded.clear
-    remove_unloadable_constants!
-  end
+    def depend_on(file_name, swallow_load_errors = false)
+      path = search_for_file(file_name)
+      require_or_load(path || file_name)
+    rescue LoadError
+      raise unless swallow_load_errors
+    end
 
-  def require_or_load(file_name, const_path = nil)
-    log_call file_name, const_path
-    file_name = $1 if file_name =~ /^(.*)\.rb$/
-    expanded = File.expand_path(file_name)
-    return if loaded.include?(expanded)
+    def associate_with(file_name)
+      depend_on(file_name, true)
+    end
 
-    # Record that we've seen this file *before* loading it to avoid an
-    # infinite loop with mutual dependencies.
-    loaded &lt;&lt; expanded
+    def clear
+      log_call
+      loaded.clear
+      remove_unloadable_constants!
+    end
 
-    begin
-      if load?
-        log &quot;loading #{file_name}&quot;
+    def require_or_load(file_name, const_path = nil)
+      log_call file_name, const_path
+      file_name = $1 if file_name =~ /^(.*)\.rb$/
+      expanded = File.expand_path(file_name)
+      return if loaded.include?(expanded)
 
-        # Enable warnings iff this file has not been loaded before and
-        # warnings_on_first_load is set.
-        load_args = [&quot;#{file_name}.rb&quot;]
-        load_args &lt;&lt; const_path unless const_path.nil?
+      # Record that we've seen this file *before* loading it to avoid an
+      # infinite loop with mutual dependencies.
+      loaded &lt;&lt; expanded
 
-        if !warnings_on_first_load or history.include?(expanded)
-          result = load_file(*load_args)
+      begin
+        if load?
+          log &quot;loading #{file_name}&quot;
+
+          # Enable warnings iff this file has not been loaded before and
+          # warnings_on_first_load is set.
+          load_args = [&quot;#{file_name}.rb&quot;]
+          load_args &lt;&lt; const_path unless const_path.nil?
+
+          if !warnings_on_first_load or history.include?(expanded)
+            result = load_file(*load_args)
+          else
+            enable_warnings { result = load_file(*load_args) }
+          end
         else
-          enable_warnings { result = load_file(*load_args) }
+          log &quot;requiring #{file_name}&quot;
+          result = require file_name
         end
-      else
-        log &quot;requiring #{file_name}&quot;
-        result = require file_name
+      rescue Exception
+        loaded.delete expanded
+        raise
       end
-    rescue Exception
-      loaded.delete expanded
-      raise
-    end
 
-    # Record history *after* loading so first load gets warnings.
-    history &lt;&lt; expanded
-    return result
-  end
+      # Record history *after* loading so first load gets warnings.
+      history &lt;&lt; expanded
+      return result
+    end
 
-  # Is the provided constant path defined?
-  def qualified_const_defined?(path)
-    raise NameError, &quot;#{path.inspect} is not a valid constant name!&quot; unless
-      /^(::)?([A-Z]\w*)(::[A-Z]\w*)*$/ =~ path
+    # Is the provided constant path defined?
+    def qualified_const_defined?(path)
+      raise NameError, &quot;#{path.inspect} is not a valid constant name!&quot; unless
+        /^(::)?([A-Z]\w*)(::[A-Z]\w*)*$/ =~ path
 
-    names = path.to_s.split('::')
-    names.shift if names.first.empty?
+      names = path.to_s.split('::')
+      names.shift if names.first.empty?
 
-    # We can't use defined? because it will invoke const_missing for the parent
-    # of the name we are checking.
-    names.inject(Object) do |mod, name|
-      return false unless uninherited_const_defined?(mod, name)
-      mod.const_get name
+      # We can't use defined? because it will invoke const_missing for the parent
+      # of the name we are checking.
+      names.inject(Object) do |mod, name|
+        return false unless uninherited_const_defined?(mod, name)
+        mod.const_get name
+      end
+      return true
     end
-    return true
-  end
 
-  if Module.method(:const_defined?).arity == 1
-    # Does this module define this constant?
-    # Wrapper to accomodate changing Module#const_defined? in Ruby 1.9
-    def uninherited_const_defined?(mod, const)
-      mod.const_defined?(const)
-    end
-  else
-    def uninherited_const_defined?(mod, const) #:nodoc:
-      mod.const_defined?(const, false)
+    if Module.method(:const_defined?).arity == 1
+      # Does this module define this constant?
+      # Wrapper to accomodate changing Module#const_defined? in Ruby 1.9
+      def uninherited_const_defined?(mod, const)
+        mod.const_defined?(const)
+      end
+    else
+      def uninherited_const_defined?(mod, const) #:nodoc:
+        mod.const_defined?(const, false)
+      end
     end
-  end
-
-  # Given +path+, a filesystem path to a ruby file, return an array of constant
-  # paths which would cause Dependencies to attempt to load this file.
-  def loadable_constants_for_path(path, bases = load_paths)
-    path = $1 if path =~ /\A(.*)\.rb\Z/
-    expanded_path = File.expand_path(path)
-
-    bases.collect do |root|
-      expanded_root = File.expand_path(root)
-      next unless %r{\A#{Regexp.escape(expanded_root)}(/|\\)} =~ expanded_path
-
-      nesting = expanded_path[(expanded_root.size)..-1]
-      nesting = nesting[1..-1] if nesting &amp;&amp; nesting[0] == ?/
-      next if nesting.blank?
-
-      [
-        nesting.camelize,
-        # Special case: application.rb might define ApplicationControlller.
-        ('ApplicationController' if nesting == 'application')
-      ]
-    end.flatten.compact.uniq
-  end
 
-  # Search for a file in load_paths matching the provided suffix.
-  def search_for_file(path_suffix)
-    path_suffix = path_suffix + '.rb' unless path_suffix.ends_with? '.rb'
-    load_paths.each do |root|
-      path = File.join(root, path_suffix)
-      return path if File.file? path
+    # Given +path+, a filesystem path to a ruby file, return an array of constant
+    # paths which would cause Dependencies to attempt to load this file.
+    def loadable_constants_for_path(path, bases = load_paths)
+      path = $1 if path =~ /\A(.*)\.rb\Z/
+      expanded_path = File.expand_path(path)
+
+      bases.collect do |root|
+        expanded_root = File.expand_path(root)
+        next unless %r{\A#{Regexp.escape(expanded_root)}(/|\\)} =~ expanded_path
+
+        nesting = expanded_path[(expanded_root.size)..-1]
+        nesting = nesting[1..-1] if nesting &amp;&amp; nesting[0] == ?/
+        next if nesting.blank?
+
+        [
+          nesting.camelize,
+          # Special case: application.rb might define ApplicationControlller.
+          ('ApplicationController' if nesting == 'application')
+        ]
+      end.flatten.compact.uniq
     end
-    nil # Gee, I sure wish we had first_match ;-)
-  end
 
-  # Does the provided path_suffix correspond to an autoloadable module?
-  # Instead of returning a boolean, the autoload base for this module is returned.
-  def autoloadable_module?(path_suffix)
-    load_paths.each do |load_path|
-      return load_path if File.directory? File.join(load_path, path_suffix)
+    # Search for a file in load_paths matching the provided suffix.
+    def search_for_file(path_suffix)
+      path_suffix = path_suffix + '.rb' unless path_suffix.ends_with? '.rb'
+      load_paths.each do |root|
+        path = File.join(root, path_suffix)
+        return path if File.file? path
+      end
+      nil # Gee, I sure wish we had first_match ;-)
     end
-    nil
-  end
-
-  def load_once_path?(path)
-    load_once_paths.any? { |base| path.starts_with? base }
-  end
 
-  # Attempt to autoload the provided module name by searching for a directory
-  # matching the expect path suffix. If found, the module is created and assigned
-  # to +into+'s constants with the name +const_name+. Provided that the directory
-  # was loaded from a reloadable base path, it is added to the set of constants
-  # that are to be unloaded.
-  def autoload_module!(into, const_name, qualified_name, path_suffix)
-    return nil unless base_path = autoloadable_module?(path_suffix)
-    mod = Module.new
-    into.const_set const_name, mod
-    autoloaded_constants &lt;&lt; qualified_name unless load_once_paths.include?(base_path)
-    return mod
-  end
-
-  # Load the file at the provided path. +const_paths+ is a set of qualified
-  # constant names. When loading the file, Dependencies will watch for the
-  # addition of these constants. Each that is defined will be marked as
-  # autoloaded, and will be removed when Dependencies.clear is next called.
-  #
-  # If the second parameter is left off, then Dependencies will construct a set
-  # of names that the file at +path+ may define. See
-  # +loadable_constants_for_path+ for more details.
-  def load_file(path, const_paths = loadable_constants_for_path(path))
-    log_call path, const_paths
-    const_paths = [const_paths].compact unless const_paths.is_a? Array
-    parent_paths = const_paths.collect { |const_path| /(.*)::[^:]+\Z/ =~ const_path ? $1 : :Object }
-
-    result = nil
-    newly_defined_paths = new_constants_in(*parent_paths) do
-      result = load_without_new_constant_marking path
+    # Does the provided path_suffix correspond to an autoloadable module?
+    # Instead of returning a boolean, the autoload base for this module is returned.
+    def autoloadable_module?(path_suffix)
+      load_paths.each do |load_path|
+        return load_path if File.directory? File.join(load_path, path_suffix)
+      end
+      nil
     end
 
-    autoloaded_constants.concat newly_defined_paths unless load_once_path?(path)
-    autoloaded_constants.uniq!
-    log &quot;loading #{path} defined #{newly_defined_paths * ', '}&quot; unless newly_defined_paths.empty?
-    return result
-  end
+    def load_once_path?(path)
+      load_once_paths.any? { |base| path.starts_with? base }
+    end
 
-  # Return the constant path for the provided parent and constant name.
-  def qualified_name_for(mod, name)
-    mod_name = to_constant_name mod
-    (%w(Object Kernel).include? mod_name) ? name.to_s : &quot;#{mod_name}::#{name}&quot;
-  end
+    # Attempt to autoload the provided module name by searching for a directory
+    # matching the expect path suffix. If found, the module is created and assigned
+    # to +into+'s constants with the name +const_name+. Provided that the directory
+    # was loaded from a reloadable base path, it is added to the set of constants
+    # that are to be unloaded.
+    def autoload_module!(into, const_name, qualified_name, path_suffix)
+      return nil unless base_path = autoloadable_module?(path_suffix)
+      mod = Module.new
+      into.const_set const_name, mod
+      autoloaded_constants &lt;&lt; qualified_name unless load_once_paths.include?(base_path)
+      return mod
+    end
 
-  # Load the constant named +const_name+ which is missing from +from_mod+. If
-  # it is not possible to load the constant into from_mod, try its parent module
-  # using const_missing.
-  def load_missing_constant(from_mod, const_name)
-    log_call from_mod, const_name
-    if from_mod == Kernel
-      if ::Object.const_defined?(const_name)
-        log &quot;Returning Object::#{const_name} for Kernel::#{const_name}&quot;
-        return ::Object.const_get(const_name)
-      else
-        log &quot;Substituting Object for Kernel&quot;
-        from_mod = Object
+    # Load the file at the provided path. +const_paths+ is a set of qualified
+    # constant names. When loading the file, Dependencies will watch for the
+    # addition of these constants. Each that is defined will be marked as
+    # autoloaded, and will be removed when Dependencies.clear is next called.
+    #
+    # If the second parameter is left off, then Dependencies will construct a set
+    # of names that the file at +path+ may define. See
+    # +loadable_constants_for_path+ for more details.
+    def load_file(path, const_paths = loadable_constants_for_path(path))
+      log_call path, const_paths
+      const_paths = [const_paths].compact unless const_paths.is_a? Array
+      parent_paths = const_paths.collect { |const_path| /(.*)::[^:]+\Z/ =~ const_path ? $1 : :Object }
+
+      result = nil
+      newly_defined_paths = new_constants_in(*parent_paths) do
+        result = load_without_new_constant_marking path
       end
-    end
 
-    # If we have an anonymous module, all we can do is attempt to load from Object.
-    from_mod = Object if from_mod.name.blank?
+      autoloaded_constants.concat newly_defined_paths unless load_once_path?(path)
+      autoloaded_constants.uniq!
+      log &quot;loading #{path} defined #{newly_defined_paths * ', '}&quot; unless newly_defined_paths.empty?
+      return result
+    end
 
-    unless qualified_const_defined?(from_mod.name) &amp;&amp; from_mod.name.constantize.object_id == from_mod.object_id
-      raise ArgumentError, &quot;A copy of #{from_mod} has been removed from the module tree but is still active!&quot;
+    # Return the constant path for the provided parent and constant name.
+    def qualified_name_for(mod, name)
+      mod_name = to_constant_name mod
+      (%w(Object Kernel).include? mod_name) ? name.to_s : &quot;#{mod_name}::#{name}&quot;
     end
 
-    raise ArgumentError, &quot;#{from_mod} is not missing constant #{const_name}!&quot; if uninherited_const_defined?(from_mod, const_name)
+    # Load the constant named +const_name+ which is missing from +from_mod+. If
+    # it is not possible to load the constant into from_mod, try its parent module
+    # using const_missing.
+    def load_missing_constant(from_mod, const_name)
+      log_call from_mod, const_name
+      if from_mod == Kernel
+        if ::Object.const_defined?(const_name)
+          log &quot;Returning Object::#{const_name} for Kernel::#{const_name}&quot;
+          return ::Object.const_get(const_name)
+        else
+          log &quot;Substituting Object for Kernel&quot;
+          from_mod = Object
+        end
+      end
 
-    qualified_name = qualified_name_for from_mod, const_name
-    path_suffix = qualified_name.underscore
-    name_error = NameError.new(&quot;uninitialized constant #{qualified_name}&quot;)
+      # If we have an anonymous module, all we can do is attempt to load from Object.
+      from_mod = Object if from_mod.name.blank?
 
-    file_path = search_for_file(path_suffix)
-    if file_path &amp;&amp; ! loaded.include?(File.expand_path(file_path)) # We found a matching file to load
-      require_or_load file_path
-      raise LoadError, &quot;Expected #{file_path} to define #{qualified_name}&quot; unless uninherited_const_defined?(from_mod, const_name)
-      return from_mod.const_get(const_name)
-    elsif mod = autoload_module!(from_mod, const_name, qualified_name, path_suffix)
-      return mod
-    elsif (parent = from_mod.parent) &amp;&amp; parent != from_mod &amp;&amp;
-          ! from_mod.parents.any? { |p| uninherited_const_defined?(p, const_name) }
-      # If our parents do not have a constant named +const_name+ then we are free
-      # to attempt to load upwards. If they do have such a constant, then this
-      # const_missing must be due to from_mod::const_name, which should not
-      # return constants from from_mod's parents.
-      begin
-        return parent.const_missing(const_name)
-      rescue NameError =&gt; e
-        raise unless e.missing_name? qualified_name_for(parent, const_name)
+      unless qualified_const_defined?(from_mod.name) &amp;&amp; from_mod.name.constantize.object_id == from_mod.object_id
+        raise ArgumentError, &quot;A copy of #{from_mod} has been removed from the module tree but is still active!&quot;
+      end
+
+      raise ArgumentError, &quot;#{from_mod} is not missing constant #{const_name}!&quot; if uninherited_const_defined?(from_mod, const_name)
+
+      qualified_name = qualified_name_for from_mod, const_name
+      path_suffix = qualified_name.underscore
+      name_error = NameError.new(&quot;uninitialized constant #{qualified_name}&quot;)
+
+      file_path = search_for_file(path_suffix)
+      if file_path &amp;&amp; ! loaded.include?(File.expand_path(file_path)) # We found a matching file to load
+        require_or_load file_path
+        raise LoadError, &quot;Expected #{file_path} to define #{qualified_name}&quot; unless uninherited_const_defined?(from_mod, const_name)
+        return from_mod.const_get(const_name)
+      elsif mod = autoload_module!(from_mod, const_name, qualified_name, path_suffix)
+        return mod
+      elsif (parent = from_mod.parent) &amp;&amp; parent != from_mod &amp;&amp;
+            ! from_mod.parents.any? { |p| uninherited_const_defined?(p, const_name) }
+        # If our parents do not have a constant named +const_name+ then we are free
+        # to attempt to load upwards. If they do have such a constant, then this
+        # const_missing must be due to from_mod::const_name, which should not
+        # return constants from from_mod's parents.
+        begin
+          return parent.const_missing(const_name)
+        rescue NameError =&gt; e
+          raise unless e.missing_name? qualified_name_for(parent, const_name)
+          raise name_error
+        end
+      else
         raise name_error
       end
-    else
-      raise name_error
     end
-  end
 
-  # Remove the constants that have been autoloaded, and those that have been
-  # marked for unloading.
-  def remove_unloadable_constants!
-    autoloaded_constants.each { |const| remove_constant const }
-    autoloaded_constants.clear
-    explicitly_unloadable_constants.each { |const| remove_constant const }
-  end
+    # Remove the constants that have been autoloaded, and those that have been
+    # marked for unloading.
+    def remove_unloadable_constants!
+      autoloaded_constants.each { |const| remove_constant const }
+      autoloaded_constants.clear
+      explicitly_unloadable_constants.each { |const| remove_constant const }
+    end
 
-  # Determine if the given constant has been automatically loaded.
-  def autoloaded?(desc)
-    # No name =&gt; anonymous module.
-    return false if desc.is_a?(Module) &amp;&amp; desc.name.blank?
-    name = to_constant_name desc
-    return false unless qualified_const_defined? name
-    return autoloaded_constants.include?(name)
-  end
+    # Determine if the given constant has been automatically loaded.
+    def autoloaded?(desc)
+      # No name =&gt; anonymous module.
+      return false if desc.is_a?(Module) &amp;&amp; desc.name.blank?
+      name = to_constant_name desc
+      return false unless qualified_const_defined? name
+      return autoloaded_constants.include?(name)
+    end
 
-  # Will the provided constant descriptor be unloaded?
-  def will_unload?(const_desc)
-    autoloaded?(desc) ||
-      explicitly_unloadable_constants.include?(to_constant_name(const_desc))
-  end
+    # Will the provided constant descriptor be unloaded?
+    def will_unload?(const_desc)
+      autoloaded?(const_desc) ||
+        explicitly_unloadable_constants.include?(to_constant_name(const_desc))
+    end
 
-  # Mark the provided constant name for unloading. This constant will be
-  # unloaded on each request, not just the next one.
-  def mark_for_unload(const_desc)
-    name = to_constant_name const_desc
-    if explicitly_unloadable_constants.include? name
-      return false
-    else
-      explicitly_unloadable_constants &lt;&lt; name
-      return true
+    # Mark the provided constant name for unloading. This constant will be
+    # unloaded on each request, not just the next one.
+    def mark_for_unload(const_desc)
+      name = to_constant_name const_desc
+      if explicitly_unloadable_constants.include? name
+        return false
+      else
+        explicitly_unloadable_constants &lt;&lt; name
+        return true
+      end
     end
-  end
 
-  # Run the provided block and detect the new constants that were loaded during
-  # its execution. Constants may only be regarded as 'new' once -- so if the
-  # block calls +new_constants_in+ again, then the constants defined within the
-  # inner call will not be reported in this one.
-  #
-  # If the provided block does not run to completion, and instead raises an
-  # exception, any new constants are regarded as being only partially defined
-  # and will be removed immediately.
-  def new_constants_in(*descs)
-    log_call(*descs)
-
-    # Build the watch frames. Each frame is a tuple of
-    #   [module_name_as_string, constants_defined_elsewhere]
-    watch_frames = descs.collect do |desc|
-      if desc.is_a? Module
-        mod_name = desc.name
-        initial_constants = desc.local_constant_names
-      elsif desc.is_a?(String) || desc.is_a?(Symbol)
-        mod_name = desc.to_s
-
-        # Handle the case where the module has yet to be defined.
-        initial_constants = if qualified_const_defined?(mod_name)
-          mod_name.constantize.local_constant_names
+    # Run the provided block and detect the new constants that were loaded during
+    # its execution. Constants may only be regarded as 'new' once -- so if the
+    # block calls +new_constants_in+ again, then the constants defined within the
+    # inner call will not be reported in this one.
+    #
+    # If the provided block does not run to completion, and instead raises an
+    # exception, any new constants are regarded as being only partially defined
+    # and will be removed immediately.
+    def new_constants_in(*descs)
+      log_call(*descs)
+
+      # Build the watch frames. Each frame is a tuple of
+      #   [module_name_as_string, constants_defined_elsewhere]
+      watch_frames = descs.collect do |desc|
+        if desc.is_a? Module
+          mod_name = desc.name
+          initial_constants = desc.local_constant_names
+        elsif desc.is_a?(String) || desc.is_a?(Symbol)
+          mod_name = desc.to_s
+
+          # Handle the case where the module has yet to be defined.
+          initial_constants = if qualified_const_defined?(mod_name)
+            mod_name.constantize.local_constant_names
+          else
+           []
+          end
         else
-         []
+          raise Argument, &quot;#{desc.inspect} does not describe a module!&quot;
         end
-      else
-        raise Argument, &quot;#{desc.inspect} does not describe a module!&quot;
-      end
 
-      [mod_name, initial_constants]
-    end
+        [mod_name, initial_constants]
+      end
 
-    constant_watch_stack.concat watch_frames
+      constant_watch_stack.concat watch_frames
 
-    aborting = true
-    begin
-      yield # Now yield to the code that is to define new constants.
-      aborting = false
-    ensure
-      # Find the new constants.
-      new_constants = watch_frames.collect do |mod_name, prior_constants|
-        # Module still doesn't exist? Treat it as if it has no constants.
-        next [] unless qualified_const_defined?(mod_name)
-
-        mod = mod_name.constantize
-        next [] unless mod.is_a? Module
-        new_constants = mod.local_constant_names - prior_constants
-
-        # Make sure no other frames takes credit for these constants.
-        constant_watch_stack.each do |frame_name, constants|
-          constants.concat new_constants if frame_name == mod_name
+      aborting = true
+      begin
+        yield # Now yield to the code that is to define new constants.
+        aborting = false
+      ensure
+        # Find the new constants.
+        new_constants = watch_frames.collect do |mod_name, prior_constants|
+          # Module still doesn't exist? Treat it as if it has no constants.
+          next [] unless qualified_const_defined?(mod_name)
+
+          mod = mod_name.constantize
+          next [] unless mod.is_a? Module
+          new_constants = mod.local_constant_names - prior_constants
+
+          # Make sure no other frames takes credit for these constants.
+          constant_watch_stack.each do |frame_name, constants|
+            constants.concat new_constants if frame_name == mod_name
+          end
+
+          new_constants.collect do |suffix|
+            mod_name == &quot;Object&quot; ? suffix : &quot;#{mod_name}::#{suffix}&quot;
+          end
+        end.flatten
+
+        log &quot;New constants: #{new_constants * ', '}&quot;
+
+        if aborting
+          log &quot;Error during loading, removing partially loaded constants &quot;
+          new_constants.each { |name| remove_constant name }
+          new_constants.clear
         end
+      end
 
-        new_constants.collect do |suffix|
-          mod_name == &quot;Object&quot; ? suffix : &quot;#{mod_name}::#{suffix}&quot;
+      return new_constants
+    ensure
+      # Remove the stack frames that we added.
+      if defined?(watch_frames) &amp;&amp; ! watch_frames.blank?
+        frame_ids = watch_frames.collect(&amp;:object_id)
+        constant_watch_stack.delete_if do |watch_frame|
+          frame_ids.include? watch_frame.object_id
         end
-      end.flatten
-
-      log &quot;New constants: #{new_constants * ', '}&quot;
-
-      if aborting
-        log &quot;Error during loading, removing partially loaded constants &quot;
-        new_constants.each { |name| remove_constant name }
-        new_constants.clear
       end
     end
 
-    return new_constants
-  ensure
-    # Remove the stack frames that we added.
-    if defined?(watch_frames) &amp;&amp; ! watch_frames.blank?
-      frame_ids = watch_frames.collect(&amp;:object_id)
-      constant_watch_stack.delete_if do |watch_frame|
-        frame_ids.include? watch_frame.object_id
+    class LoadingModule #:nodoc:
+      # Old style environment.rb referenced this method directly.  Please note, it doesn't
+      # actually *do* anything any more.
+      def self.root(*args)
+        if defined?(RAILS_DEFAULT_LOGGER)
+          RAILS_DEFAULT_LOGGER.warn &quot;Your environment.rb uses the old syntax, it may not continue to work in future releases.&quot;
+          RAILS_DEFAULT_LOGGER.warn &quot;For upgrade instructions please see: http://manuals.rubyonrails.com/read/book/19&quot;
+        end
       end
     end
-  end
 
-  class LoadingModule #:nodoc:
-    # Old style environment.rb referenced this method directly.  Please note, it doesn't
-    # actually *do* anything any more.
-    def self.root(*args)
-      if defined?(RAILS_DEFAULT_LOGGER)
-        RAILS_DEFAULT_LOGGER.warn &quot;Your environment.rb uses the old syntax, it may not continue to work in future releases.&quot;
-        RAILS_DEFAULT_LOGGER.warn &quot;For upgrade instructions please see: http://manuals.rubyonrails.com/read/book/19&quot;
+    # Convert the provided const desc to a qualified constant name (as a string).
+    # A module, class, symbol, or string may be provided.
+    def to_constant_name(desc) #:nodoc:
+      name = case desc
+        when String then desc.starts_with?('::') ? desc[2..-1] : desc
+        when Symbol then desc.to_s
+        when Module
+          raise ArgumentError, &quot;Anonymous modules have no name to be referenced by&quot; if desc.name.blank?
+          desc.name
+        else raise TypeError, &quot;Not a valid constant descriptor: #{desc.inspect}&quot;
       end
     end
-  end
 
-  # Convert the provided const desc to a qualified constant name (as a string).
-  # A module, class, symbol, or string may be provided.
-  def to_constant_name(desc) #:nodoc:
-    name = case desc
-      when String then desc.starts_with?('::') ? desc[2..-1] : desc
-      when Symbol then desc.to_s
-      when Module
-        raise ArgumentError, &quot;Anonymous modules have no name to be referenced by&quot; if desc.name.blank?
-        desc.name
-      else raise TypeError, &quot;Not a valid constant descriptor: #{desc.inspect}&quot;
-    end
-  end
+    def remove_constant(const) #:nodoc:
+      return false unless qualified_const_defined? const
 
-  def remove_constant(const) #:nodoc:
-    return false unless qualified_const_defined? const
+      const = $1 if /\A::(.*)\Z/ =~ const.to_s
+      names = const.to_s.split('::')
+      if names.size == 1 # It's under Object
+        parent = Object
+      else
+        parent = (names[0..-2] * '::').constantize
+      end
 
-    const = $1 if /\A::(.*)\Z/ =~ const.to_s
-    names = const.to_s.split('::')
-    if names.size == 1 # It's under Object
-      parent = Object
-    else
-      parent = (names[0..-2] * '::').constantize
+      log &quot;removing constant #{const}&quot;
+      parent.instance_eval { remove_const names.last }
+      return true
     end
 
-    log &quot;removing constant #{const}&quot;
-    parent.instance_eval { remove_const names.last }
-    return true
-  end
-
-protected
-  def log_call(*args)
-    if defined?(RAILS_DEFAULT_LOGGER) &amp;&amp; RAILS_DEFAULT_LOGGER &amp;&amp; log_activity
-      arg_str = args.collect(&amp;:inspect) * ', '
-      /in `([a-z_\?\!]+)'/ =~ caller(1).first
-      selector = $1 || '&lt;unknown&gt;'
-      log &quot;called #{selector}(#{arg_str})&quot;
-    end
-  end
+    protected
+      def log_call(*args)
+        if defined?(RAILS_DEFAULT_LOGGER) &amp;&amp; RAILS_DEFAULT_LOGGER &amp;&amp; log_activity
+          arg_str = args.collect(&amp;:inspect) * ', '
+          /in `([a-z_\?\!]+)'/ =~ caller(1).first
+          selector = $1 || '&lt;unknown&gt;'
+          log &quot;called #{selector}(#{arg_str})&quot;
+        end
+      end
 
-  def log(msg)
-    if defined?(RAILS_DEFAULT_LOGGER) &amp;&amp; RAILS_DEFAULT_LOGGER &amp;&amp; log_activity
-      RAILS_DEFAULT_LOGGER.debug &quot;Dependencies: #{msg}&quot;
-    end
+      def log(msg)
+        if defined?(RAILS_DEFAULT_LOGGER) &amp;&amp; RAILS_DEFAULT_LOGGER &amp;&amp; log_activity
+          RAILS_DEFAULT_LOGGER.debug &quot;Dependencies: #{msg}&quot;
+        end
+      end
   end
-
 end
 
 Object.instance_eval do
-  define_method(:require_or_load)     { |file_name| Dependencies.require_or_load(file_name) } unless Object.respond_to?(:require_or_load)
-  define_method(:require_dependency)  { |file_name| Dependencies.depend_on(file_name) }       unless Object.respond_to?(:require_dependency)
-  define_method(:require_association) { |file_name| Dependencies.associate_with(file_name) }  unless Object.respond_to?(:require_association)
+  define_method(:require_or_load)     { |file_name| ActiveSupport::Dependencies.require_or_load(file_name) } unless Object.respond_to?(:require_or_load)
+  define_method(:require_dependency)  { |file_name| ActiveSupport::Dependencies.depend_on(file_name) }       unless Object.respond_to?(:require_dependency)
+  define_method(:require_association) { |file_name| ActiveSupport::Dependencies.associate_with(file_name) }  unless Object.respond_to?(:require_association)
 end
 
 class Module #:nodoc:
@@ -464,7 +465,7 @@ class Module #:nodoc:
   # Use const_missing to autoload associations so we don't have to
   # require_association when using single-table inheritance.
   def const_missing(class_id)
-    Dependencies.load_missing_constant self, class_id
+    ActiveSupport::Dependencies.load_missing_constant self, class_id
   end
 
   def unloadable(const_desc = self)
@@ -480,15 +481,15 @@ class Class
     else
       begin
         begin
-          Dependencies.load_missing_constant self, const_name
+          ActiveSupport::Dependencies.load_missing_constant self, const_name
         rescue NameError
           parent.send :const_missing, const_name
         end
       rescue NameError =&gt; e
         # Make sure that the name we are missing is the one that caused the error
-        parent_qualified_name = Dependencies.qualified_name_for parent, const_name
+        parent_qualified_name = ActiveSupport::Dependencies.qualified_name_for parent, const_name
         raise unless e.missing_name? parent_qualified_name
-        qualified_name = Dependencies.qualified_name_for self, const_name
+        qualified_name = ActiveSupport::Dependencies.qualified_name_for self, const_name
         raise NameError.new(&quot;uninitialized constant #{qualified_name}&quot;).copy_blame!(e)
       end
     end
@@ -499,14 +500,14 @@ class Object
   alias_method :load_without_new_constant_marking, :load
 
   def load(file, *extras) #:nodoc:
-    Dependencies.new_constants_in(Object) { super }
+    ActiveSupport::Dependencies.new_constants_in(Object) { super }
   rescue Exception =&gt; exception  # errors from loading file
     exception.blame_file! file
     raise
   end
 
   def require(file, *extras) #:nodoc:
-    Dependencies.new_constants_in(Object) { super }
+    ActiveSupport::Dependencies.new_constants_in(Object) { super }
   rescue Exception =&gt; exception  # errors from required file
     exception.blame_file! file
     raise
@@ -526,7 +527,7 @@ class Object
   # Returns true if the constant was not previously marked for unloading, false
   # otherwise.
   def unloadable(const_desc)
-    Dependencies.mark_for_unload const_desc
+    ActiveSupport::Dependencies.mark_for_unload const_desc
   end
 end
 </diff>
      <filename>vendor/rails/activesupport/lib/active_support/dependencies.rb</filename>
    </modified>
    <modified>
      <diff>@@ -92,7 +92,7 @@ module ActiveSupport
             class_eval(&lt;&lt;-EOS, __FILE__, __LINE__)
               def #{target}_with_deprecation#{punctuation}(*args, &amp;block)
                 ::ActiveSupport::Deprecation.warn(self.class.deprecated_method_warning(:#{method_name}, #{options[method_name].inspect}), caller)
-                #{target}_without_deprecation#{punctuation}(*args, &amp;block)
+                send(:#{target}_without_deprecation#{punctuation}, *args, &amp;block)
               end
             EOS
           end
@@ -109,7 +109,7 @@ module ActiveSupport
       end
 
       def deprecation_horizon
-        '2.0'
+        '2.2'
       end
     end
 
@@ -144,17 +144,11 @@ module ActiveSupport
         end
     end
 
-    # Stand-in for &lt;tt&gt;@request&lt;/tt&gt;, &lt;tt&gt;@attributes&lt;/tt&gt;, &lt;tt&gt;@params&lt;/tt&gt;, etc.
-    # which emits deprecation warnings on any method call (except +inspect+).
-    class DeprecatedInstanceVariableProxy #:nodoc:
+    class DeprecationProxy #:nodoc:
       silence_warnings do
         instance_methods.each { |m| undef_method m unless m =~ /^__/ }
       end
 
-      def initialize(instance, method, var = &quot;@#{method}&quot;)
-        @instance, @method, @var = instance, method, var
-      end
-
       # Don't give a deprecation warning on inspect since test/unit and error
       # logs rely on it for diagnostics.
       def inspect
@@ -166,7 +160,16 @@ module ActiveSupport
           warn caller, called, args
           target.__send__(called, *args, &amp;block)
         end
+    end
 
+    # Stand-in for &lt;tt&gt;@request&lt;/tt&gt;, &lt;tt&gt;@attributes&lt;/tt&gt;, &lt;tt&gt;@params&lt;/tt&gt;, etc.
+    # which emits deprecation warnings on any method call (except +inspect+).
+    class DeprecatedInstanceVariableProxy &lt; DeprecationProxy #:nodoc:
+      def initialize(instance, method, var = &quot;@#{method}&quot;)
+        @instance, @method, @var = instance, method, var
+      end
+
+      private
         def target
           @instance.__send__(@method)
         end
@@ -176,6 +179,21 @@ module ActiveSupport
         end
     end
 
+    class DeprecatedConstantProxy &lt; DeprecationProxy #:nodoc:
+      def initialize(old_const, new_const)
+        @old_const = old_const
+        @new_const = new_const
+      end
+
+      private
+        def target
+          @new_const.to_s.constantize
+        end
+
+        def warn(callstack, called, args)
+          ActiveSupport::Deprecation.warn(&quot;#{@old_const} is deprecated! Use #{@new_const} instead.&quot;, callstack)
+        end
+    end
   end
 end
 </diff>
      <filename>vendor/rails/activesupport/lib/active_support/deprecation.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,53 +1,55 @@
-Inflector.inflections do |inflect|
-  inflect.plural(/$/, 's')
-  inflect.plural(/s$/i, 's')
-  inflect.plural(/(ax|test)is$/i, '\1es')
-  inflect.plural(/(octop|vir)us$/i, '\1i')
-  inflect.plural(/(alias|status)$/i, '\1es')
-  inflect.plural(/(bu)s$/i, '\1ses')
-  inflect.plural(/(buffal|tomat)o$/i, '\1oes')
-  inflect.plural(/([ti])um$/i, '\1a')
-  inflect.plural(/sis$/i, 'ses')
-  inflect.plural(/(?:([^f])fe|([lr])f)$/i, '\1\2ves')
-  inflect.plural(/(hive)$/i, '\1s')
-  inflect.plural(/([^aeiouy]|qu)y$/i, '\1ies')
-  inflect.plural(/(x|ch|ss|sh)$/i, '\1es')
-  inflect.plural(/(matr|vert|ind)(?:ix|ex)$/i, '\1ices')
-  inflect.plural(/([m|l])ouse$/i, '\1ice')
-  inflect.plural(/^(ox)$/i, '\1en')
-  inflect.plural(/(quiz)$/i, '\1zes')
+module ActiveSupport
+  Inflector.inflections do |inflect|
+    inflect.plural(/$/, 's')
+    inflect.plural(/s$/i, 's')
+    inflect.plural(/(ax|test)is$/i, '\1es')
+    inflect.plural(/(octop|vir)us$/i, '\1i')
+    inflect.plural(/(alias|status)$/i, '\1es')
+    inflect.plural(/(bu)s$/i, '\1ses')
+    inflect.plural(/(buffal|tomat)o$/i, '\1oes')
+    inflect.plural(/([ti])um$/i, '\1a')
+    inflect.plural(/sis$/i, 'ses')
+    inflect.plural(/(?:([^f])fe|([lr])f)$/i, '\1\2ves')
+    inflect.plural(/(hive)$/i, '\1s')
+    inflect.plural(/([^aeiouy]|qu)y$/i, '\1ies')
+    inflect.plural(/(x|ch|ss|sh)$/i, '\1es')
+    inflect.plural(/(matr|vert|ind)(?:ix|ex)$/i, '\1ices')
+    inflect.plural(/([m|l])ouse$/i, '\1ice')
+    inflect.plural(/^(ox)$/i, '\1en')
+    inflect.plural(/(quiz)$/i, '\1zes')
 
-  inflect.singular(/s$/i, '')
-  inflect.singular(/(n)ews$/i, '\1ews')
-  inflect.singular(/([ti])a$/i, '\1um')
-  inflect.singular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i, '\1\2sis')
-  inflect.singular(/(^analy)ses$/i, '\1sis')
-  inflect.singular(/([^f])ves$/i, '\1fe')
-  inflect.singular(/(hive)s$/i, '\1')
-  inflect.singular(/(tive)s$/i, '\1')
-  inflect.singular(/([lr])ves$/i, '\1f')
-  inflect.singular(/([^aeiouy]|qu)ies$/i, '\1y')
-  inflect.singular(/(s)eries$/i, '\1eries')
-  inflect.singular(/(m)ovies$/i, '\1ovie')
-  inflect.singular(/(x|ch|ss|sh)es$/i, '\1')
-  inflect.singular(/([m|l])ice$/i, '\1ouse')
-  inflect.singular(/(bus)es$/i, '\1')
-  inflect.singular(/(o)es$/i, '\1')
-  inflect.singular(/(shoe)s$/i, '\1')
-  inflect.singular(/(cris|ax|test)es$/i, '\1is')
-  inflect.singular(/(octop|vir)i$/i, '\1us')
-  inflect.singular(/(alias|status)es$/i, '\1')
-  inflect.singular(/^(ox)en/i, '\1')
-  inflect.singular(/(vert|ind)ices$/i, '\1ex')
-  inflect.singular(/(matr)ices$/i, '\1ix')
-  inflect.singular(/(quiz)zes$/i, '\1')
+    inflect.singular(/s$/i, '')
+    inflect.singular(/(n)ews$/i, '\1ews')
+    inflect.singular(/([ti])a$/i, '\1um')
+    inflect.singular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i, '\1\2sis')
+    inflect.singular(/(^analy)ses$/i, '\1sis')
+    inflect.singular(/([^f])ves$/i, '\1fe')
+    inflect.singular(/(hive)s$/i, '\1')
+    inflect.singular(/(tive)s$/i, '\1')
+    inflect.singular(/([lr])ves$/i, '\1f')
+    inflect.singular(/([^aeiouy]|qu)ies$/i, '\1y')
+    inflect.singular(/(s)eries$/i, '\1eries')
+    inflect.singular(/(m)ovies$/i, '\1ovie')
+    inflect.singular(/(x|ch|ss|sh)es$/i, '\1')
+    inflect.singular(/([m|l])ice$/i, '\1ouse')
+    inflect.singular(/(bus)es$/i, '\1')
+    inflect.singular(/(o)es$/i, '\1')
+    inflect.singular(/(shoe)s$/i, '\1')
+    inflect.singular(/(cris|ax|test)es$/i, '\1is')
+    inflect.singular(/(octop|vir)i$/i, '\1us')
+    inflect.singular(/(alias|status)es$/i, '\1')
+    inflect.singular(/^(ox)en/i, '\1')
+    inflect.singular(/(vert|ind)ices$/i, '\1ex')
+    inflect.singular(/(matr)ices$/i, '\1ix')
+    inflect.singular(/(quiz)zes$/i, '\1')
 
-  inflect.irregular('person', 'people')
-  inflect.irregular('man', 'men')
-  inflect.irregular('child', 'children')
-  inflect.irregular('sex', 'sexes')
-  inflect.irregular('move', 'moves')
-  inflect.irregular('cow', 'kine')
+    inflect.irregular('person', 'people')
+    inflect.irregular('man', 'men')
+    inflect.irregular('child', 'children')
+    inflect.irregular('sex', 'sexes')
+    inflect.irregular('move', 'moves')
+    inflect.irregular('cow', 'kine')
 
-  inflect.uncountable(%w(equipment information rice money species series fish sheep))
+    inflect.uncountable(%w(equipment information rice money species series fish sheep))
+  end
 end</diff>
      <filename>vendor/rails/activesupport/lib/active_support/inflections.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,305 +1,310 @@
 require 'singleton'
 
-# The Inflector transforms words from singular to plural, class names to table names, modularized class names to ones without,
-# and class names to foreign keys. The default inflections for pluralization, singularization, and uncountable words are kept
-# in inflections.rb.
-#
-# The Rails core team has stated patches for the inflections library will not be accepted
-# in order to avoid breaking legacy applications which may be relying on errant inflections.
-# If you discover an incorrect inflection and require it for your application, you'll need
-# to correct it yourself (explained below).
-module Inflector
-  # A singleton instance of this class is yielded by Inflector.inflections, which can then be used to specify additional
-  # inflection rules. Examples:
+module ActiveSupport
+  # The Inflector transforms words from singular to plural, class names to table names, modularized class names to ones without,
+  # and class names to foreign keys. The default inflections for pluralization, singularization, and uncountable words are kept
+  # in inflections.rb.
   #
-  #   Inflector.inflections do |inflect|
-  #     inflect.plural /^(ox)$/i, '\1\2en'
-  #     inflect.singular /^(ox)en/i, '\1'
-  #
-  #     inflect.irregular 'octopus', 'octopi'
-  #
-  #     inflect.uncountable &quot;equipment&quot;
-  #   end
-  #
-  # New rules are added at the top. So in the example above, the irregular rule for octopus will now be the first of the
-  # pluralization and singularization rules that is runs. This guarantees that your rules run before any of the rules that may
-  # already have been loaded.
-  class Inflections
-    include Singleton
+  # The Rails core team has stated patches for the inflections library will not be accepted
+  # in order to avoid breaking legacy applications which may be relying on errant inflections.
+  # If you discover an incorrect inflection and require it for your application, you'll need
+  # to correct it yourself (explained below).
+  module Inflector
+    # A singleton instance of this class is yielded by Inflector.inflections, which can then be used to specify additional
+    # inflection rules. Examples:
+    #
+    #   Inflector.inflections do |inflect|
+    #     inflect.plural /^(ox)$/i, '\1\2en'
+    #     inflect.singular /^(ox)en/i, '\1'
+    #
+    #     inflect.irregular 'octopus', 'octopi'
+    #
+    #     inflect.uncountable &quot;equipment&quot;
+    #   end
+    #
+    # New rules are added at the top. So in the example above, the irregular rule for octopus will now be the first of the
+    # pluralization and singularization rules that is runs. This guarantees that your rules run before any of the rules that may
+    # already have been loaded.
+    class Inflections
+      include Singleton
 
-    attr_reader :plurals, :singulars, :uncountables
+      attr_reader :plurals, :singulars, :uncountables
 
-    def initialize
-      @plurals, @singulars, @uncountables = [], [], []
-    end
+      def initialize
+        @plurals, @singulars, @uncountables = [], [], []
+      end
+
+      # Specifies a new pluralization rule and its replacement. The rule can either be a string or a regular expression.
+      # The replacement should always be a string that may include references to the matched data from the rule.
+      def plural(rule, replacement)
+        @plurals.insert(0, [rule, replacement])
+      end
+
+      # Specifies a new singularization rule and its replacement. The rule can either be a string or a regular expression.
+      # The replacement should always be a string that may include references to the matched data from the rule.
+      def singular(rule, replacement)
+        @singulars.insert(0, [rule, replacement])
+      end
 
-    # Specifies a new pluralization rule and its replacement. The rule can either be a string or a regular expression.
-    # The replacement should always be a string that may include references to the matched data from the rule.
-    def plural(rule, replacement)
-      @plurals.insert(0, [rule, replacement])
+      # Specifies a new irregular that applies to both pluralization and singularization at the same time. This can only be used
+      # for strings, not regular expressions. You simply pass the irregular in singular and plural form.
+      #
+      # Examples:
+      #   irregular 'octopus', 'octopi'
+      #   irregular 'person', 'people'
+      def irregular(singular, plural)
+        if singular[0,1].upcase == plural[0,1].upcase
+          plural(Regexp.new(&quot;(#{singular[0,1]})#{singular[1..-1]}$&quot;, &quot;i&quot;), '\1' + plural[1..-1])
+          singular(Regexp.new(&quot;(#{plural[0,1]})#{plural[1..-1]}$&quot;, &quot;i&quot;), '\1' + singular[1..-1])
+        else
+          plural(Regexp.new(&quot;#{singular[0,1].upcase}(?i)#{singular[1..-1]}$&quot;), plural[0,1].upcase + plural[1..-1])
+          plural(Regexp.new(&quot;#{singular[0,1].downcase}(?i)#{singular[1..-1]}$&quot;), plural[0,1].downcase + plural[1..-1])
+          singular(Regexp.new(&quot;#{plural[0,1].upcase}(?i)#{plural[1..-1]}$&quot;), singular[0,1].upcase + singular[1..-1])
+          singular(Regexp.new(&quot;#{plural[0,1].downcase}(?i)#{plural[1..-1]}$&quot;), singular[0,1].downcase + singular[1..-1])
+        end
+      end
+
+      # Add uncountable words that shouldn't be attempted inflected.
+      #
+      # Examples:
+      #   uncountable &quot;money&quot;
+      #   uncountable &quot;money&quot;, &quot;information&quot;
+      #   uncountable %w( money information rice )
+      def uncountable(*words)
+        (@uncountables &lt;&lt; words).flatten!
+      end
+
+      # Clears the loaded inflections within a given scope (default is &lt;tt&gt;:all&lt;/tt&gt;).
+      # Give the scope as a symbol of the inflection type, the options are: &lt;tt&gt;:plurals&lt;/tt&gt;,
+      # &lt;tt&gt;:singulars&lt;/tt&gt;, &lt;tt&gt;:uncountables&lt;/tt&gt;.
+      #
+      # Examples:
+      #   clear :all
+      #   clear :plurals
+      def clear(scope = :all)
+        case scope
+          when :all
+            @plurals, @singulars, @uncountables = [], [], []
+          else
+            instance_variable_set &quot;@#{scope}&quot;, []
+        end
+      end
     end
 
-    # Specifies a new singularization rule and its replacement. The rule can either be a string or a regular expression.
-    # The replacement should always be a string that may include references to the matched data from the rule.
-    def singular(rule, replacement)
-      @singulars.insert(0, [rule, replacement])
+    extend self
+
+    # Yields a singleton instance of Inflector::Inflections so you can specify additional
+    # inflector rules.
+    #
+    # Example:
+    #   Inflector.inflections do |inflect|
+    #     inflect.uncountable &quot;rails&quot;
+    #   end
+    def inflections
+      if block_given?
+        yield Inflections.instance
+      else
+        Inflections.instance
+      end
     end
 
-    # Specifies a new irregular that applies to both pluralization and singularization at the same time. This can only be used
-    # for strings, not regular expressions. You simply pass the irregular in singular and plural form.
+    # Returns the plural form of the word in the string.
     #
     # Examples:
-    #   irregular 'octopus', 'octopi'
-    #   irregular 'person', 'people'
-    def irregular(singular, plural)
-      if singular[0,1].upcase == plural[0,1].upcase
-        plural(Regexp.new(&quot;(#{singular[0,1]})#{singular[1..-1]}$&quot;, &quot;i&quot;), '\1' + plural[1..-1])
-        singular(Regexp.new(&quot;(#{plural[0,1]})#{plural[1..-1]}$&quot;, &quot;i&quot;), '\1' + singular[1..-1])
+    #   &quot;post&quot;.pluralize             # =&gt; &quot;posts&quot;
+    #   &quot;octopus&quot;.pluralize          # =&gt; &quot;octopi&quot;
+    #   &quot;sheep&quot;.pluralize            # =&gt; &quot;sheep&quot;
+    #   &quot;words&quot;.pluralize            # =&gt; &quot;words&quot;
+    #   &quot;the blue mailman&quot;.pluralize # =&gt; &quot;the blue mailmen&quot;
+    #   &quot;CamelOctopus&quot;.pluralize     # =&gt; &quot;CamelOctopi&quot;
+    def pluralize(word)
+      result = word.to_s.dup
+
+      if word.empty? || inflections.uncountables.include?(result.downcase)
+        result
       else
-        plural(Regexp.new(&quot;#{singular[0,1].upcase}(?i)#{singular[1..-1]}$&quot;), plural[0,1].upcase + plural[1..-1])
-        plural(Regexp.new(&quot;#{singular[0,1].downcase}(?i)#{singular[1..-1]}$&quot;), plural[0,1].downcase + plural[1..-1])
-        singular(Regexp.new(&quot;#{plural[0,1].upcase}(?i)#{plural[1..-1]}$&quot;), singular[0,1].upcase + singular[1..-1])
-        singular(Regexp.new(&quot;#{plural[0,1].downcase}(?i)#{plural[1..-1]}$&quot;), singular[0,1].downcase + singular[1..-1])       
+        inflections.plurals.each { |(rule, replacement)| break if result.gsub!(rule, replacement) }
+        result
       end
     end
 
-    # Add uncountable words that shouldn't be attempted inflected.
+    # The reverse of +pluralize+, returns the singular form of a word in a string.
     #
     # Examples:
-    #   uncountable &quot;money&quot;
-    #   uncountable &quot;money&quot;, &quot;information&quot;
-    #   uncountable %w( money information rice )
-    def uncountable(*words)
-      (@uncountables &lt;&lt; words).flatten!
+    #   &quot;posts&quot;.singularize            # =&gt; &quot;post&quot;
+    #   &quot;octopi&quot;.singularize           # =&gt; &quot;octopus&quot;
+    #   &quot;sheep&quot;.singluarize            # =&gt; &quot;sheep&quot;
+    #   &quot;word&quot;.singluarize             # =&gt; &quot;word&quot;
+    #   &quot;the blue mailmen&quot;.singularize # =&gt; &quot;the blue mailman&quot;
+    #   &quot;CamelOctopi&quot;.singularize      # =&gt; &quot;CamelOctopus&quot;
+    def singularize(word)
+      result = word.to_s.dup
+
+      if inflections.uncountables.include?(result.downcase)
+        result
+      else
+        inflections.singulars.each { |(rule, replacement)| break if result.gsub!(rule, replacement) }
+        result
+      end
     end
 
-    # Clears the loaded inflections within a given scope (default is &lt;tt&gt;:all&lt;/tt&gt;).
-    # Give the scope as a symbol of the inflection type, the options are: &lt;tt&gt;:plurals&lt;/tt&gt;,
-    # &lt;tt&gt;:singulars&lt;/tt&gt;, &lt;tt&gt;:uncountables&lt;/tt&gt;.
+    # By default, +camelize+ converts strings to UpperCamelCase. If the argument to +camelize+
+    # is set to &lt;tt&gt;:lower&lt;/tt&gt; then +camelize+ produces lowerCamelCase.
+    #
+    # +camelize+ will also convert '/' to '::' which is useful for converting paths to namespaces.
     #
     # Examples:
-    #   clear :all
-    #   clear :plurals
-    def clear(scope = :all)
-      case scope
-        when :all
-          @plurals, @singulars, @uncountables = [], [], []
-        else
-          instance_variable_set &quot;@#{scope}&quot;, []
+    #   &quot;active_record&quot;.camelize                # =&gt; &quot;ActiveRecord&quot;
+    #   &quot;active_record&quot;.camelize(:lower)        # =&gt; &quot;activeRecord&quot;
+    #   &quot;active_record/errors&quot;.camelize         # =&gt; &quot;ActiveRecord::Errors&quot;
+    #   &quot;active_record/errors&quot;.camelize(:lower) # =&gt; &quot;activeRecord::Errors&quot;
+    def camelize(lower_case_and_underscored_word, first_letter_in_uppercase = true)
+      if first_letter_in_uppercase
+        lower_case_and_underscored_word.to_s.gsub(/\/(.?)/) { &quot;::#{$1.upcase}&quot; }.gsub(/(?:^|_)(.)/) { $1.upcase }
+      else
+        lower_case_and_underscored_word.first + camelize(lower_case_and_underscored_word)[1..-1]
       end
     end
-  end
-
-  extend self
 
-  # Yields a singleton instance of Inflector::Inflections so you can specify additional
-  # inflector rules.
-  #
-  # Example:
-  #   Inflector.inflections do |inflect|
-  #     inflect.uncountable &quot;rails&quot;
-  #   end
-  def inflections
-    if block_given?
-      yield Inflections.instance
-    else
-      Inflections.instance
+    # Capitalizes all the words and replaces some characters in the string to create
+    # a nicer looking title. +titleize+ is meant for creating pretty output. It is not
+    # used in the Rails internals.
+    #
+    # +titleize+ is also aliased as as +titlecase+.
+    #
+    # Examples:
+    #   &quot;man from the boondocks&quot;.titleize # =&gt; &quot;Man From The Boondocks&quot;
+    #   &quot;x-men: the last stand&quot;.titleize  # =&gt; &quot;X Men: The Last Stand&quot;
+    def titleize(word)
+      humanize(underscore(word)).gsub(/\b('?[a-z])/) { $1.capitalize }
     end
-  end
-
-  # Returns the plural form of the word in the string.
-  #
-  # Examples:
-  #   &quot;post&quot;.pluralize             # =&gt; &quot;posts&quot;
-  #   &quot;octopus&quot;.pluralize          # =&gt; &quot;octopi&quot;
-  #   &quot;sheep&quot;.pluralize            # =&gt; &quot;sheep&quot;
-  #   &quot;words&quot;.pluralize            # =&gt; &quot;words&quot;
-  #   &quot;the blue mailman&quot;.pluralize # =&gt; &quot;the blue mailmen&quot;
-  #   &quot;CamelOctopus&quot;.pluralize     # =&gt; &quot;CamelOctopi&quot;
-  def pluralize(word)
-    result = word.to_s.dup
 
-    if word.empty? || inflections.uncountables.include?(result.downcase)
-      result
-    else
-      inflections.plurals.each { |(rule, replacement)| break if result.gsub!(rule, replacement) }
-      result
+    # The reverse of +camelize+. Makes an underscored, lowercase form from the expression in the string.
+    #
+    # Changes '::' to '/' to convert namespaces to paths.
+    #
+    # Examples:
+    #   &quot;ActiveRecord&quot;.underscore         # =&gt; &quot;active_record&quot;
+    #   &quot;ActiveRecord::Errors&quot;.underscore # =&gt; active_record/errors
+    def underscore(camel_cased_word)
+      camel_cased_word.to_s.gsub(/::/, '/').
+        gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
+        gsub(/([a-z\d])([A-Z])/,'\1_\2').
+        tr(&quot;-&quot;, &quot;_&quot;).
+        downcase
     end
-  end
-
-  # The reverse of +pluralize+, returns the singular form of a word in a string.
-  #
-  # Examples:
-  #   &quot;posts&quot;.singularize            # =&gt; &quot;post&quot;
-  #   &quot;octopi&quot;.singularize           # =&gt; &quot;octopus&quot;
-  #   &quot;sheep&quot;.singluarize            # =&gt; &quot;sheep&quot;
-  #   &quot;word&quot;.singluarize             # =&gt; &quot;word&quot;
-  #   &quot;the blue mailmen&quot;.singularize # =&gt; &quot;the blue mailman&quot;
-  #   &quot;CamelOctopi&quot;.singularize      # =&gt; &quot;CamelOctopus&quot;
-  def singularize(word)
-    result = word.to_s.dup
 
-    if inflections.uncountables.include?(result.downcase)
-      result
-    else
-      inflections.singulars.each { |(rule, replacement)| break if result.gsub!(rule, replacement) }
-      result
+    # Replaces underscores with dashes in the string.
+    #
+    # Example:
+    #   &quot;puni_puni&quot; # =&gt; &quot;puni-puni&quot;
+    def dasherize(underscored_word)
+      underscored_word.gsub(/_/, '-')
     end
-  end
 
-  # By default, +camelize+ converts strings to UpperCamelCase. If the argument to +camelize+
-  # is set to &lt;tt&gt;:lower&lt;/tt&gt; then +camelize+ produces lowerCamelCase.
-  #
-  # +camelize+ will also convert '/' to '::' which is useful for converting paths to namespaces.
-  #
-  # Examples:
-  #   &quot;active_record&quot;.camelize                # =&gt; &quot;ActiveRecord&quot;
-  #   &quot;active_record&quot;.camelize(:lower)        # =&gt; &quot;activeRecord&quot;
-  #   &quot;active_record/errors&quot;.camelize         # =&gt; &quot;ActiveRecord::Errors&quot;
-  #   &quot;active_record/errors&quot;.camelize(:lower) # =&gt; &quot;activeRecord::Errors&quot;
-  def camelize(lower_case_and_underscored_word, first_letter_in_uppercase = true)
-    if first_letter_in_uppercase
-      lower_case_and_underscored_word.to_s.gsub(/\/(.?)/) { &quot;::#{$1.upcase}&quot; }.gsub(/(?:^|_)(.)/) { $1.upcase }
-    else
-      lower_case_and_underscored_word.first + camelize(lower_case_and_underscored_word)[1..-1]
+    # Capitalizes the first word and turns underscores into spaces and strips a
+    # trailing &quot;_id&quot;, if any. Like +titleize+, this is meant for creating pretty output.
+    #
+    # Examples:
+    #   &quot;employee_salary&quot; # =&gt; &quot;Employee salary&quot;
+    #   &quot;author_id&quot;       # =&gt; &quot;Author&quot;
+    def humanize(lower_case_and_underscored_word)
+      lower_case_and_underscored_word.to_s.gsub(/_id$/, &quot;&quot;).gsub(/_/, &quot; &quot;).capitalize
     end
-  end
 
-  # Capitalizes all the words and replaces some characters in the string to create
-  # a nicer looking title. +titleize+ is meant for creating pretty output. It is not
-  # used in the Rails internals.
-  #
-  # +titleize+ is also aliased as as +titlecase+.
-  #
-  # Examples:
-  #   &quot;man from the boondocks&quot;.titleize # =&gt; &quot;Man From The Boondocks&quot;
-  #   &quot;x-men: the last stand&quot;.titleize  # =&gt; &quot;X Men: The Last Stand&quot;
-  def titleize(word)
-    humanize(underscore(word)).gsub(/\b('?[a-z])/) { $1.capitalize }
-  end
-
-  # The reverse of +camelize+. Makes an underscored, lowercase form from the expression in the string.
-  #
-  # Changes '::' to '/' to convert namespaces to paths.
-  #
-  # Examples:
-  #   &quot;ActiveRecord&quot;.underscore         # =&gt; &quot;active_record&quot;
-  #   &quot;ActiveRecord::Errors&quot;.underscore # =&gt; active_record/errors
-  def underscore(camel_cased_word)
-    camel_cased_word.to_s.gsub(/::/, '/').
-      gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
-      gsub(/([a-z\d])([A-Z])/,'\1_\2').
-      tr(&quot;-&quot;, &quot;_&quot;).
-      downcase
-  end
-
-  # Replaces underscores with dashes in the string.
-  #
-  # Example:
-  #   &quot;puni_puni&quot; # =&gt; &quot;puni-puni&quot;
-  def dasherize(underscored_word)
-    underscored_word.gsub(/_/, '-')
-  end
-
-  # Capitalizes the first word and turns underscores into spaces and strips a
-  # trailing &quot;_id&quot;, if any. Like +titleize+, this is meant for creating pretty output.
-  #
-  # Examples:
-  #   &quot;employee_salary&quot; # =&gt; &quot;Employee salary&quot;
-  #   &quot;author_id&quot;       # =&gt; &quot;Author&quot;
-  def humanize(lower_case_and_underscored_word)
-    lower_case_and_underscored_word.to_s.gsub(/_id$/, &quot;&quot;).gsub(/_/, &quot; &quot;).capitalize
-  end
+    # Removes the module part from the expression in the string.
+    #
+    # Examples:
+    #   &quot;ActiveRecord::CoreExtensions::String::Inflections&quot;.demodulize # =&gt; &quot;Inflections&quot;
+    #   &quot;Inflections&quot;.demodulize                                       # =&gt; &quot;Inflections&quot;
+    def demodulize(class_name_in_module)
+      class_name_in_module.to_s.gsub(/^.*::/, '')
+    end
 
-  # Removes the module part from the expression in the string.
-  #
-  # Examples:
-  #   &quot;ActiveRecord::CoreExtensions::String::Inflections&quot;.demodulize # =&gt; &quot;Inflections&quot;
-  #   &quot;Inflections&quot;.demodulize                                       # =&gt; &quot;Inflections&quot;
-  def demodulize(class_name_in_module)
-    class_name_in_module.to_s.gsub(/^.*::/, '')
-  end
+    # Create the name of a table like Rails does for models to table names. This method
+    # uses the +pluralize+ method on the last word in the string.
+    #
+    # Examples
+    #   &quot;RawScaledScorer&quot;.tableize # =&gt; &quot;raw_scaled_scorers&quot;
+    #   &quot;egg_and_ham&quot;.tableize     # =&gt; &quot;egg_and_hams&quot;
+    #   &quot;fancyCategory&quot;.tableize   # =&gt; &quot;fancy_categories&quot;
+    def tableize(class_name)
+      pluralize(underscore(class_name))
+    end
 
-  # Create the name of a table like Rails does for models to table names. This method
-  # uses the +pluralize+ method on the last word in the string.
-  #
-  # Examples
-  #   &quot;RawScaledScorer&quot;.tableize # =&gt; &quot;raw_scaled_scorers&quot;
-  #   &quot;egg_and_ham&quot;.tableize     # =&gt; &quot;egg_and_hams&quot;
-  #   &quot;fancyCategory&quot;.tableize   # =&gt; &quot;fancy_categories&quot;
-  def tableize(class_name)
-    pluralize(underscore(class_name))
-  end
+    # Create a class name from a plural table name like Rails does for table names to models.
+    # Note that this returns a string and not a Class. (To convert to an actual class
+    # follow +classify+ with +constantize+.)
+    #
+    # Examples:
+    #   &quot;egg_and_hams&quot;.classify # =&gt; &quot;EggAndHam&quot;
+    #   &quot;posts&quot;.classify        # =&gt; &quot;Post&quot;
+    #
+    # Singular names are not handled correctly:
+    #   &quot;business&quot;.classify     # =&gt; &quot;Busines&quot;
+    def classify(table_name)
+      # strip out any leading schema name
+      camelize(singularize(table_name.to_s.sub(/.*\./, '')))
+    end
 
-  # Create a class name from a plural table name like Rails does for table names to models.
-  # Note that this returns a string and not a Class. (To convert to an actual class
-  # follow +classify+ with +constantize+.)
-  #
-  # Examples:
-  #   &quot;egg_and_hams&quot;.classify # =&gt; &quot;EggAndHam&quot;
-  #   &quot;posts&quot;.classify        # =&gt; &quot;Post&quot;
-  #
-  # Singular names are not handled correctly:
-  #   &quot;business&quot;.classify     # =&gt; &quot;Busines&quot;
-  def classify(table_name)
-    # strip out any leading schema name
-    camelize(singularize(table_name.to_s.sub(/.*\./, '')))
-  end
+    # Creates a foreign key name from a class name.
+    # +separate_class_name_and_id_with_underscore+ sets whether
+    # the method should put '_' between the name and 'id'.
+    #
+    # Examples:
+    #   &quot;Message&quot;.foreign_key        # =&gt; &quot;message_id&quot;
+    #   &quot;Message&quot;.foreign_key(false) # =&gt; &quot;messageid&quot;
+    #   &quot;Admin::Post&quot;.foreign_key    # =&gt; &quot;post_id&quot;
+    def foreign_key(class_name, separate_class_name_and_id_with_underscore = true)
+      underscore(demodulize(class_name)) + (separate_class_name_and_id_with_underscore ? &quot;_id&quot; : &quot;id&quot;)
+    end
 
-  # Creates a foreign key name from a class name.
-  # +separate_class_name_and_id_with_underscore+ sets whether
-  # the method should put '_' between the name and 'id'.
-  #
-  # Examples:
-  #   &quot;Message&quot;.foreign_key        # =&gt; &quot;message_id&quot;
-  #   &quot;Message&quot;.foreign_key(false) # =&gt; &quot;messageid&quot;
-  #   &quot;Admin::Post&quot;.foreign_key    # =&gt; &quot;post_id&quot;
-  def foreign_key(class_name, separate_class_name_and_id_with_underscore = true)
-    underscore(demodulize(class_name)) + (separate_class_name_and_id_with_underscore ? &quot;_id&quot; : &quot;id&quot;)
-  end
+    # Tries to find a constant with the name specified in the argument string:
+    #
+    #   &quot;Module&quot;.constantize     # =&gt; Module
+    #   &quot;Test::Unit&quot;.constantize # =&gt; Test::Unit
+    #
+    # The name is assumed to be the one of a top-level constant, no matter whether
+    # it starts with &quot;::&quot; or not. No lexical context is taken into account:
+    #
+    #   C = 'outside'
+    #   module M
+    #     C = 'inside'
+    #     C               # =&gt; 'inside'
+    #     &quot;C&quot;.constantize # =&gt; 'outside', same as ::C
+    #   end
+    #
+    # NameError is raised when the name is not in CamelCase or the constant is
+    # unknown.
+    def constantize(camel_cased_word)
+      names = camel_cased_word.split('::')
+      names.shift if names.empty? || names.first.empty?
 
-  # Tries to find a constant with the name specified in the argument string:
-  #
-  #   &quot;Module&quot;.constantize     # =&gt; Module
-  #   &quot;Test::Unit&quot;.constantize # =&gt; Test::Unit
-  #
-  # The name is assumed to be the one of a top-level constant, no matter whether
-  # it starts with &quot;::&quot; or not. No lexical context is taken into account:
-  #
-  #   C = 'outside'
-  #   module M
-  #     C = 'inside'
-  #     C               # =&gt; 'inside'
-  #     &quot;C&quot;.constantize # =&gt; 'outside', same as ::C
-  #   end
-  #
-  # NameError is raised when the name is not in CamelCase or the constant is
-  # unknown.
-  def constantize(camel_cased_word)
-    unless /\A(?:::)?([A-Z]\w*(?:::[A-Z]\w*)*)\z/ =~ camel_cased_word
-      raise NameError, &quot;#{camel_cased_word.inspect} is not a valid constant name!&quot;
+      constant = Object
+      names.each do |name|
+        constant = constant.const_defined?(name) ? constant.const_get(name) : constant.const_missing(name)
+      end
+      constant
     end
 
-    Object.module_eval(&quot;::#{$1}&quot;, __FILE__, __LINE__)
-  end
-
-  # Turns a number into an ordinal string used to denote the position in an
-  # ordered sequence such as 1st, 2nd, 3rd, 4th.
-  #
-  # Examples:
-  #   ordinalize(1)     # =&gt; &quot;1st&quot;
-  #   ordinalize(2)     # =&gt; &quot;2nd&quot;
-  #   ordinalize(1002)  # =&gt; &quot;1002nd&quot;
-  #   ordinalize(1003)  # =&gt; &quot;1003rd&quot;
-  def ordinalize(number)
-    if (11..13).include?(number.to_i % 100)
-      &quot;#{number}th&quot;
-    else
-      case number.to_i % 10
-        when 1; &quot;#{number}st&quot;
-        when 2; &quot;#{number}nd&quot;
-        when 3; &quot;#{number}rd&quot;
-        else    &quot;#{number}th&quot;
+    # Turns a number into an ordinal string used to denote the position in an
+    # ordered sequence such as 1st, 2nd, 3rd, 4th.
+    #
+    # Examples:
+    #   ordinalize(1)     # =&gt; &quot;1st&quot;
+    #   ordinalize(2)     # =&gt; &quot;2nd&quot;
+    #   ordinalize(1002)  # =&gt; &quot;1002nd&quot;
+    #   ordinalize(1003)  # =&gt; &quot;1003rd&quot;
+    def ordinalize(number)
+      if (11..13).include?(number.to_i % 100)
+        &quot;#{number}th&quot;
+      else
+        case number.to_i % 10
+          when 1; &quot;#{number}st&quot;
+          when 2; &quot;#{number}nd&quot;
+          when 3; &quot;#{number}rd&quot;
+          else    &quot;#{number}th&quot;
+        end
       end
     end
   end</diff>
      <filename>vendor/rails/activesupport/lib/active_support/inflector.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ class DateTime
     if ActiveSupport.use_standard_json_time_format
       xmlschema.inspect
     else
-      %(&quot;#{strftime(&quot;%Y/%m/%d %H:%M:%S %z&quot;)}&quot;)
+      strftime('&quot;%Y/%m/%d %H:%M:%S %z&quot;')
     end
   end
 end</diff>
      <filename>vendor/rails/activesupport/lib/active_support/json/encoders/date_time.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,17 +1,19 @@
-class OrderedOptions &lt; ActiveSupport::OrderedHash #:nodoc:
-  def []=(key, value)
-    super(key.to_sym, value)
-  end
+module ActiveSupport #:nodoc:
+  class OrderedOptions &lt; OrderedHash #:nodoc:
+    def []=(key, value)
+      super(key.to_sym, value)
+    end
 
-  def [](key)
-    super(key.to_sym)
-  end
+    def [](key)
+      super(key.to_sym)
+    end
 
-  def method_missing(name, *args)
-    if name.to_s =~ /(.*)=$/
-      self[$1.to_sym] = args.first
-    else
-      self[name]
+    def method_missing(name, *args)
+      if name.to_s =~ /(.*)=$/
+        self[$1.to_sym] = args.first
+      else
+        self[name]
+      end
     end
   end
 end</diff>
      <filename>vendor/rails/activesupport/lib/active_support/ordered_options.rb</filename>
    </modified>
    <modified>
      <diff>@@ -159,19 +159,24 @@ module ActiveSupport
       utc == other
     end
     
-    # If wrapped +time+ is a DateTime, use DateTime#since instead of &lt;tt&gt;+&lt;/tt&gt;.
-    # Otherwise, just pass on to +method_missing+.
     def +(other)
-      result = utc.acts_like?(:date) ? utc.since(other) : utc + other rescue utc.since(other)
-      result.in_time_zone(time_zone)
+      # If we're adding a Duration of variable length (i.e., years, months, days), move forward from #time,
+      # otherwise move forward from #utc, for accuracy when moving across DST boundaries
+      if duration_of_variable_length?(other)
+        method_missing(:+, other)
+      else
+        result = utc.acts_like?(:date) ? utc.since(other) : utc + other rescue utc.since(other)
+        result.in_time_zone(time_zone)
+      end
     end
-    
-    # If a time-like object is passed in, compare it with +utc+.
-    # Else if wrapped +time+ is a DateTime, use DateTime#ago instead of DateTime#-.
-    # Otherwise, just pass on to +method_missing+.
+
     def -(other)
+      # If we're subtracting a Duration of variable length (i.e., years, months, days), move backwards from #time,
+      # otherwise move backwards #utc, for accuracy when moving across DST boundaries
       if other.acts_like?(:time)
         utc - other
+      elsif duration_of_variable_length?(other)
+        method_missing(:-, other)
       else
         result = utc.acts_like?(:date) ? utc.ago(other) : utc - other rescue utc.ago(other)
         result.in_time_zone(time_zone)
@@ -179,15 +184,27 @@ module ActiveSupport
     end
     
     def since(other)
-      utc.since(other).in_time_zone(time_zone)
+      # If we're adding a Duration of variable length (i.e., years, months, days), move forward from #time,
+      # otherwise move forward from #utc, for accuracy when moving across DST boundaries
+      if duration_of_variable_length?(other)
+        method_missing(:since, other)
+      else
+        utc.since(other).in_time_zone(time_zone)
+      end
     end
     
     def ago(other)
-      utc.ago(other).in_time_zone(time_zone)
+      since(-other)
     end
-    
+
     def advance(options)
-      utc.advance(options).in_time_zone(time_zone)
+      # If we're advancing a value of variable length (i.e., years, weeks, months, days), advance from #time,
+      # otherwise advance from #utc, for accuracy when moving across DST boundaries
+      if options.detect {|k,v| [:years, :weeks, :months, :days].include? k}
+        method_missing(:advance, options)
+      else
+        utc.advance(options).in_time_zone(time_zone)
+      end
     end
     
     %w(year mon month day mday hour min sec).each do |method_name|
@@ -246,7 +263,7 @@ module ActiveSupport
     end
     
     def marshal_load(variables)
-      initialize(variables[0], ::Time.send!(:get_zone, variables[1]), variables[2])
+      initialize(variables[0].utc, ::Time.send!(:get_zone, variables[1]), variables[2].utc)
     end
 
     # Ensure proxy class responds to all methods that underlying time instance responds to.
@@ -279,5 +296,9 @@ module ActiveSupport
       def transfer_time_values_to_utc_constructor(time)
         ::Time.utc_time(time.year, time.month, time.day, time.hour, time.min, time.sec, time.respond_to?(:usec) ? time.usec : 0)
       end
+      
+      def duration_of_variable_length?(obj)
+        ActiveSupport::Duration === obj &amp;&amp; obj.parts.flatten.detect {|p| [:years, :months, :days].include? p }
+      end
   end
 end</diff>
      <filename>vendor/rails/activesupport/lib/active_support/time_with_zone.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@
 # * Retrieve and display zones with a friendlier name (e.g., &quot;Eastern Time (US &amp; Canada)&quot; instead of &quot;America/New_York&quot;).
 # * Lazily load TZInfo::Timezone instances only when they're needed.
 # * Create ActiveSupport::TimeWithZone instances via TimeZone's +local+, +parse+, +at+ and +now+ methods.
-# 
+#
 # If you set &lt;tt&gt;config.time_zone&lt;/tt&gt; in the Rails Initializer, you can access this TimeZone object via &lt;tt&gt;Time.zone&lt;/tt&gt;:
 #
 #   # environment.rb:
@@ -16,379 +16,381 @@
 #   Time.zone.name  # =&gt; &quot;Eastern Time (US &amp; Canada)&quot;
 #   Time.zone.now   # =&gt; Sun, 18 May 2008 14:30:44 EDT -04:00
 #
-# The version of TZInfo bundled with Active Support only includes the definitions necessary to support the zones 
+# The version of TZInfo bundled with Active Support only includes the definitions necessary to support the zones
 # defined by the TimeZone class. If you need to use zones that aren't defined by TimeZone, you'll need to install the TZInfo gem
 # (if a recent version of the gem is installed locally, this will be used instead of the bundled version.)
-class TimeZone
-  unless const_defined?(:MAPPING)
-    # Keys are Rails TimeZone names, values are TZInfo identifiers
-    MAPPING = {
-      &quot;International Date Line West&quot; =&gt; &quot;Pacific/Midway&quot;,
-      &quot;Midway Island&quot;                =&gt; &quot;Pacific/Midway&quot;,
-      &quot;Samoa&quot;                        =&gt; &quot;Pacific/Pago_Pago&quot;,
-      &quot;Hawaii&quot;                       =&gt; &quot;Pacific/Honolulu&quot;,
-      &quot;Alaska&quot;                       =&gt; &quot;America/Juneau&quot;,
-      &quot;Pacific Time (US &amp; Canada)&quot;   =&gt; &quot;America/Los_Angeles&quot;,
-      &quot;Tijuana&quot;                      =&gt; &quot;America/Tijuana&quot;,
-      &quot;Mountain Time (US &amp; Canada)&quot;  =&gt; &quot;America/Denver&quot;,
-      &quot;Arizona&quot;                      =&gt; &quot;America/Phoenix&quot;,
-      &quot;Chihuahua&quot;                    =&gt; &quot;America/Chihuahua&quot;,
-      &quot;Mazatlan&quot;                     =&gt; &quot;America/Mazatlan&quot;,
-      &quot;Central Time (US &amp; Canada)&quot;   =&gt; &quot;America/Chicago&quot;,
-      &quot;Saskatchewan&quot;                 =&gt; &quot;America/Regina&quot;,
-      &quot;Guadalajara&quot;                  =&gt; &quot;America/Mexico_City&quot;,
-      &quot;Mexico City&quot;                  =&gt; &quot;America/Mexico_City&quot;,
-      &quot;Monterrey&quot;                    =&gt; &quot;America/Monterrey&quot;,
-      &quot;Central America&quot;              =&gt; &quot;America/Guatemala&quot;,
-      &quot;Eastern Time (US &amp; Canada)&quot;   =&gt; &quot;America/New_York&quot;,
-      &quot;Indiana (East)&quot;               =&gt; &quot;America/Indiana/Indianapolis&quot;,
-      &quot;Bogota&quot;                       =&gt; &quot;America/Bogota&quot;,
-      &quot;Lima&quot;                         =&gt; &quot;America/Lima&quot;,
-      &quot;Quito&quot;                        =&gt; &quot;America/Lima&quot;,
-      &quot;Atlantic Time (Canada)&quot;       =&gt; &quot;America/Halifax&quot;,
-      &quot;Caracas&quot;                      =&gt; &quot;America/Caracas&quot;,
-      &quot;La Paz&quot;                       =&gt; &quot;America/La_Paz&quot;,
-      &quot;Santiago&quot;                     =&gt; &quot;America/Santiago&quot;,
-      &quot;Newfoundland&quot;                 =&gt; &quot;America/St_Johns&quot;,
-      &quot;Brasilia&quot;                     =&gt; &quot;America/Argentina/Buenos_Aires&quot;,
-      &quot;Buenos Aires&quot;                 =&gt; &quot;America/Argentina/Buenos_Aires&quot;,
-      &quot;Georgetown&quot;                   =&gt; &quot;America/Argentina/San_Juan&quot;,
-      &quot;Greenland&quot;                    =&gt; &quot;America/Godthab&quot;,
-      &quot;Mid-Atlantic&quot;                 =&gt; &quot;Atlantic/South_Georgia&quot;,
-      &quot;Azores&quot;                       =&gt; &quot;Atlantic/Azores&quot;,
-      &quot;Cape Verde Is.&quot;               =&gt; &quot;Atlantic/Cape_Verde&quot;,
-      &quot;Dublin&quot;                       =&gt; &quot;Europe/Dublin&quot;,
-      &quot;Edinburgh&quot;                    =&gt; &quot;Europe/Dublin&quot;,
-      &quot;Lisbon&quot;                       =&gt; &quot;Europe/Lisbon&quot;,
-      &quot;London&quot;                       =&gt; &quot;Europe/London&quot;,
-      &quot;Casablanca&quot;                   =&gt; &quot;Africa/Casablanca&quot;,
-      &quot;Monrovia&quot;                     =&gt; &quot;Africa/Monrovia&quot;,
-      &quot;UTC&quot;                          =&gt; &quot;Etc/UTC&quot;,
-      &quot;Belgrade&quot;                     =&gt; &quot;Europe/Belgrade&quot;,
-      &quot;Bratislava&quot;                   =&gt; &quot;Europe/Bratislava&quot;,
-      &quot;Budapest&quot;                     =&gt; &quot;Europe/Budapest&quot;,
-      &quot;Ljubljana&quot;                    =&gt; &quot;Europe/Ljubljana&quot;,
-      &quot;Prague&quot;                       =&gt; &quot;Europe/Prague&quot;,
-      &quot;Sarajevo&quot;                     =&gt; &quot;Europe/Sarajevo&quot;,
-      &quot;Skopje&quot;                       =&gt; &quot;Europe/Skopje&quot;,
-      &quot;Warsaw&quot;                       =&gt; &quot;Europe/Warsaw&quot;,
-      &quot;Zagreb&quot;                       =&gt; &quot;Europe/Zagreb&quot;,
-      &quot;Brussels&quot;                     =&gt; &quot;Europe/Brussels&quot;,
-      &quot;Copenhagen&quot;                   =&gt; &quot;Europe/Copenhagen&quot;,
-      &quot;Madrid&quot;                       =&gt; &quot;Europe/Madrid&quot;,
-      &quot;Paris&quot;                        =&gt; &quot;Europe/Paris&quot;,
-      &quot;Amsterdam&quot;                    =&gt; &quot;Europe/Amsterdam&quot;,
-      &quot;Berlin&quot;                       =&gt; &quot;Europe/Berlin&quot;,
-      &quot;Bern&quot;                         =&gt; &quot;Europe/Berlin&quot;,
-      &quot;Rome&quot;                         =&gt; &quot;Europe/Rome&quot;,
-      &quot;Stockholm&quot;                    =&gt; &quot;Europe/Stockholm&quot;,
-      &quot;Vienna&quot;                       =&gt; &quot;Europe/Vienna&quot;,
-      &quot;West Central Africa&quot;          =&gt; &quot;Africa/Algiers&quot;,
-      &quot;Bucharest&quot;                    =&gt; &quot;Europe/Bucharest&quot;,
-      &quot;Cairo&quot;                        =&gt; &quot;Africa/Cairo&quot;,
-      &quot;Helsinki&quot;                     =&gt; &quot;Europe/Helsinki&quot;,
-      &quot;Kyev&quot;                         =&gt; &quot;Europe/Kiev&quot;,
-      &quot;Riga&quot;                         =&gt; &quot;Europe/Riga&quot;,
-      &quot;Sofia&quot;                        =&gt; &quot;Europe/Sofia&quot;,
-      &quot;Tallinn&quot;                      =&gt; &quot;Europe/Tallinn&quot;,
-      &quot;Vilnius&quot;                      =&gt; &quot;Europe/Vilnius&quot;,
-      &quot;Athens&quot;                       =&gt; &quot;Europe/Athens&quot;,
-      &quot;Istanbul&quot;                     =&gt; &quot;Europe/Istanbul&quot;,
-      &quot;Minsk&quot;                        =&gt; &quot;Europe/Minsk&quot;,
-      &quot;Jerusalem&quot;                    =&gt; &quot;Asia/Jerusalem&quot;,
-      &quot;Harare&quot;                       =&gt; &quot;Africa/Harare&quot;,
-      &quot;Pretoria&quot;                     =&gt; &quot;Africa/Johannesburg&quot;,
-      &quot;Moscow&quot;                       =&gt; &quot;Europe/Moscow&quot;,
-      &quot;St. Petersburg&quot;               =&gt; &quot;Europe/Moscow&quot;,
-      &quot;Volgograd&quot;                    =&gt; &quot;Europe/Moscow&quot;,
-      &quot;Kuwait&quot;                       =&gt; &quot;Asia/Kuwait&quot;,
-      &quot;Riyadh&quot;                       =&gt; &quot;Asia/Riyadh&quot;,
-      &quot;Nairobi&quot;                      =&gt; &quot;Africa/Nairobi&quot;,
-      &quot;Baghdad&quot;                      =&gt; &quot;Asia/Baghdad&quot;,
-      &quot;Tehran&quot;                       =&gt; &quot;Asia/Tehran&quot;,
-      &quot;Abu Dhabi&quot;                    =&gt; &quot;Asia/Muscat&quot;,
-      &quot;Muscat&quot;                       =&gt; &quot;Asia/Muscat&quot;,
-      &quot;Baku&quot;                         =&gt; &quot;Asia/Baku&quot;,
-      &quot;Tbilisi&quot;                      =&gt; &quot;Asia/Tbilisi&quot;,
-      &quot;Yerevan&quot;                      =&gt; &quot;Asia/Yerevan&quot;,
-      &quot;Kabul&quot;                        =&gt; &quot;Asia/Kabul&quot;,
-      &quot;Ekaterinburg&quot;                 =&gt; &quot;Asia/Yekaterinburg&quot;,
-      &quot;Islamabad&quot;                    =&gt; &quot;Asia/Karachi&quot;,
-      &quot;Karachi&quot;                      =&gt; &quot;Asia/Karachi&quot;,
-      &quot;Tashkent&quot;                     =&gt; &quot;Asia/Tashkent&quot;,
-      &quot;Chennai&quot;                      =&gt; &quot;Asia/Kolkata&quot;,
-      &quot;Kolkata&quot;                      =&gt; &quot;Asia/Kolkata&quot;,
-      &quot;Mumbai&quot;                       =&gt; &quot;Asia/Kolkata&quot;,
-      &quot;New Delhi&quot;                    =&gt; &quot;Asia/Kolkata&quot;,
-      &quot;Kathmandu&quot;                    =&gt; &quot;Asia/Katmandu&quot;,
-      &quot;Astana&quot;                       =&gt; &quot;Asia/Dhaka&quot;,
-      &quot;Dhaka&quot;                        =&gt; &quot;Asia/Dhaka&quot;,
-      &quot;Sri Jayawardenepura&quot;          =&gt; &quot;Asia/Dhaka&quot;,
-      &quot;Almaty&quot;                       =&gt; &quot;Asia/Almaty&quot;,
-      &quot;Novosibirsk&quot;                  =&gt; &quot;Asia/Novosibirsk&quot;,
-      &quot;Rangoon&quot;                      =&gt; &quot;Asia/Rangoon&quot;,
-      &quot;Bangkok&quot;                      =&gt; &quot;Asia/Bangkok&quot;,
-      &quot;Hanoi&quot;                        =&gt; &quot;Asia/Bangkok&quot;,
-      &quot;Jakarta&quot;                      =&gt; &quot;Asia/Jakarta&quot;,
-      &quot;Krasnoyarsk&quot;                  =&gt; &quot;Asia/Krasnoyarsk&quot;,
-      &quot;Beijing&quot;                      =&gt; &quot;Asia/Shanghai&quot;,
-      &quot;Chongqing&quot;                    =&gt; &quot;Asia/Chongqing&quot;,
-      &quot;Hong Kong&quot;                    =&gt; &quot;Asia/Hong_Kong&quot;,
-      &quot;Urumqi&quot;                       =&gt; &quot;Asia/Urumqi&quot;,
-      &quot;Kuala Lumpur&quot;                 =&gt; &quot;Asia/Kuala_Lumpur&quot;,
-      &quot;Singapore&quot;                    =&gt; &quot;Asia/Singapore&quot;,
-      &quot;Taipei&quot;                       =&gt; &quot;Asia/Taipei&quot;,
-      &quot;Perth&quot;                        =&gt; &quot;Australia/Perth&quot;,
-      &quot;Irkutsk&quot;                      =&gt; &quot;Asia/Irkutsk&quot;,
-      &quot;Ulaan Bataar&quot;                 =&gt; &quot;Asia/Ulaanbaatar&quot;,
-      &quot;Seoul&quot;                        =&gt; &quot;Asia/Seoul&quot;,
-      &quot;Osaka&quot;                        =&gt; &quot;Asia/Tokyo&quot;,
-      &quot;Sapporo&quot;                      =&gt; &quot;Asia/Tokyo&quot;,
-      &quot;Tokyo&quot;                        =&gt; &quot;Asia/Tokyo&quot;,
-      &quot;Yakutsk&quot;                      =&gt; &quot;Asia/Yakutsk&quot;,
-      &quot;Darwin&quot;                       =&gt; &quot;Australia/Darwin&quot;,
-      &quot;Adelaide&quot;                     =&gt; &quot;Australia/Adelaide&quot;,
-      &quot;Canberra&quot;                     =&gt; &quot;Australia/Melbourne&quot;,
-      &quot;Melbourne&quot;                    =&gt; &quot;Australia/Melbourne&quot;,
-      &quot;Sydney&quot;                       =&gt; &quot;Australia/Sydney&quot;,
-      &quot;Brisbane&quot;                     =&gt; &quot;Australia/Brisbane&quot;,
-      &quot;Hobart&quot;                       =&gt; &quot;Australia/Hobart&quot;,
-      &quot;Vladivostok&quot;                  =&gt; &quot;Asia/Vladivostok&quot;,
-      &quot;Guam&quot;                         =&gt; &quot;Pacific/Guam&quot;,
-      &quot;Port Moresby&quot;                 =&gt; &quot;Pacific/Port_Moresby&quot;,
-      &quot;Magadan&quot;                      =&gt; &quot;Asia/Magadan&quot;,
-      &quot;Solomon Is.&quot;                  =&gt; &quot;Asia/Magadan&quot;,
-      &quot;New Caledonia&quot;                =&gt; &quot;Pacific/Noumea&quot;,
-      &quot;Fiji&quot;                         =&gt; &quot;Pacific/Fiji&quot;,
-      &quot;Kamchatka&quot;                    =&gt; &quot;Asia/Kamchatka&quot;,
-      &quot;Marshall Is.&quot;                 =&gt; &quot;Pacific/Majuro&quot;,
-      &quot;Auckland&quot;                     =&gt; &quot;Pacific/Auckland&quot;,
-      &quot;Wellington&quot;                   =&gt; &quot;Pacific/Auckland&quot;,
-      &quot;Nuku'alofa&quot;                   =&gt; &quot;Pacific/Tongatapu&quot;
-    }.each { |name, zone| name.freeze; zone.freeze }
-    MAPPING.freeze
-  end
-
-  include Comparable
-  attr_reader :name
+module ActiveSupport
+  class TimeZone
+    unless const_defined?(:MAPPING)
+      # Keys are Rails TimeZone names, values are TZInfo identifiers
+      MAPPING = {
+        &quot;International Date Line West&quot; =&gt; &quot;Pacific/Midway&quot;,
+        &quot;Midway Island&quot;                =&gt; &quot;Pacific/Midway&quot;,
+        &quot;Samoa&quot;                        =&gt; &quot;Pacific/Pago_Pago&quot;,
+        &quot;Hawaii&quot;                       =&gt; &quot;Pacific/Honolulu&quot;,
+        &quot;Alaska&quot;                       =&gt; &quot;America/Juneau&quot;,
+        &quot;Pacific Time (US &amp; Canada)&quot;   =&gt; &quot;America/Los_Angeles&quot;,
+        &quot;Tijuana&quot;                      =&gt; &quot;America/Tijuana&quot;,
+        &quot;Mountain Time (US &amp; Canada)&quot;  =&gt; &quot;America/Denver&quot;,
+        &quot;Arizona&quot;                      =&gt; &quot;America/Phoenix&quot;,
+        &quot;Chihuahua&quot;                    =&gt; &quot;America/Chihuahua&quot;,
+        &quot;Mazatlan&quot;                     =&gt; &quot;America/Mazatlan&quot;,
+        &quot;Central Time (US &amp; Canada)&quot;   =&gt; &quot;America/Chicago&quot;,
+        &quot;Saskatchewan&quot;                 =&gt; &quot;America/Regina&quot;,
+        &quot;Guadalajara&quot;                  =&gt; &quot;America/Mexico_City&quot;,
+        &quot;Mexico City&quot;                  =&gt; &quot;America/Mexico_City&quot;,
+        &quot;Monterrey&quot;                    =&gt; &quot;America/Monterrey&quot;,
+        &quot;Central America&quot;              =&gt; &quot;America/Guatemala&quot;,
+        &quot;Eastern Time (US &amp; Canada)&quot;   =&gt; &quot;America/New_York&quot;,
+        &quot;Indiana (East)&quot;               =&gt; &quot;America/Indiana/Indianapolis&quot;,
+        &quot;Bogota&quot;                       =&gt; &quot;America/Bogota&quot;,
+        &quot;Lima&quot;                         =&gt; &quot;America/Lima&quot;,
+        &quot;Quito&quot;                        =&gt; &quot;America/Lima&quot;,
+        &quot;Atlantic Time (Canada)&quot;       =&gt; &quot;America/Halifax&quot;,
+        &quot;Caracas&quot;                      =&gt; &quot;America/Caracas&quot;,
+        &quot;La Paz&quot;                       =&gt; &quot;America/La_Paz&quot;,
+        &quot;Santiago&quot;                     =&gt; &quot;America/Santiago&quot;,
+        &quot;Newfoundland&quot;                 =&gt; &quot;America/St_Johns&quot;,
+        &quot;Brasilia&quot;                     =&gt; &quot;America/Argentina/Buenos_Aires&quot;,
+        &quot;Buenos Aires&quot;                 =&gt; &quot;America/Argentina/Buenos_Aires&quot;,
+        &quot;Georgetown&quot;                   =&gt; &quot;America/Argentina/San_Juan&quot;,
+        &quot;Greenland&quot;                    =&gt; &quot;America/Godthab&quot;,
+        &quot;Mid-Atlantic&quot;                 =&gt; &quot;Atlantic/South_Georgia&quot;,
+        &quot;Azores&quot;                       =&gt; &quot;Atlantic/Azores&quot;,
+        &quot;Cape Verde Is.&quot;               =&gt; &quot;Atlantic/Cape_Verde&quot;,
+        &quot;Dublin&quot;                       =&gt; &quot;Europe/Dublin&quot;,
+        &quot;Edinburgh&quot;                    =&gt; &quot;Europe/Dublin&quot;,
+        &quot;Lisbon&quot;                       =&gt; &quot;Europe/Lisbon&quot;,
+        &quot;London&quot;                       =&gt; &quot;Europe/London&quot;,
+        &quot;Casablanca&quot;                   =&gt; &quot;Africa/Casablanca&quot;,
+        &quot;Monrovia&quot;                     =&gt; &quot;Africa/Monrovia&quot;,
+        &quot;UTC&quot;                          =&gt; &quot;Etc/UTC&quot;,
+        &quot;Belgrade&quot;                     =&gt; &quot;Europe/Belgrade&quot;,
+        &quot;Bratislava&quot;                   =&gt; &quot;Europe/Bratislava&quot;,
+        &quot;Budapest&quot;                     =&gt; &quot;Europe/Budapest&quot;,
+        &quot;Ljubljana&quot;                    =&gt; &quot;Europe/Ljubljana&quot;,
+        &quot;Prague&quot;                       =&gt; &quot;Europe/Prague&quot;,
+        &quot;Sarajevo&quot;                     =&gt; &quot;Europe/Sarajevo&quot;,
+        &quot;Skopje&quot;                       =&gt; &quot;Europe/Skopje&quot;,
+        &quot;Warsaw&quot;                       =&gt; &quot;Europe/Warsaw&quot;,
+        &quot;Zagreb&quot;                       =&gt; &quot;Europe/Zagreb&quot;,
+        &quot;Brussels&quot;                     =&gt; &quot;Europe/Brussels&quot;,
+        &quot;Copenhagen&quot;                   =&gt; &quot;Europe/Copenhagen&quot;,
+        &quot;Madrid&quot;                       =&gt; &quot;Europe/Madrid&quot;,
+        &quot;Paris&quot;                        =&gt; &quot;Europe/Paris&quot;,
+        &quot;Amsterdam&quot;                    =&gt; &quot;Europe/Amsterdam&quot;,
+        &quot;Berlin&quot;                       =&gt; &quot;Europe/Berlin&quot;,
+        &quot;Bern&quot;                         =&gt; &quot;Europe/Berlin&quot;,
+        &quot;Rome&quot;                         =&gt; &quot;Europe/Rome&quot;,
+        &quot;Stockholm&quot;                    =&gt; &quot;Europe/Stockholm&quot;,
+        &quot;Vienna&quot;                       =&gt; &quot;Europe/Vienna&quot;,
+        &quot;West Central Africa&quot;          =&gt; &quot;Africa/Algiers&quot;,
+        &quot;Bucharest&quot;                    =&gt; &quot;Europe/Bucharest&quot;,
+        &quot;Cairo&quot;                        =&gt; &quot;Africa/Cairo&quot;,
+        &quot;Helsinki&quot;                     =&gt; &quot;Europe/Helsinki&quot;,
+        &quot;Kyev&quot;                         =&gt; &quot;Europe/Kiev&quot;,
+        &quot;Riga&quot;                         =&gt; &quot;Europe/Riga&quot;,
+        &quot;Sofia&quot;                        =&gt; &quot;Europe/Sofia&quot;,
+        &quot;Tallinn&quot;                      =&gt; &quot;Europe/Tallinn&quot;,
+        &quot;Vilnius&quot;                      =&gt; &quot;Europe/Vilnius&quot;,
+        &quot;Athens&quot;                       =&gt; &quot;Europe/Athens&quot;,
+        &quot;Istanbul&quot;                     =&gt; &quot;Europe/Istanbul&quot;,
+        &quot;Minsk&quot;                        =&gt; &quot;Europe/Minsk&quot;,
+        &quot;Jerusalem&quot;                    =&gt; &quot;Asia/Jerusalem&quot;,
+        &quot;Harare&quot;                       =&gt; &quot;Africa/Harare&quot;,
+        &quot;Pretoria&quot;                     =&gt; &quot;Africa/Johannesburg&quot;,
+        &quot;Moscow&quot;                       =&gt; &quot;Europe/Moscow&quot;,
+        &quot;St. Petersburg&quot;               =&gt; &quot;Europe/Moscow&quot;,
+        &quot;Volgograd&quot;                    =&gt; &quot;Europe/Moscow&quot;,
+        &quot;Kuwait&quot;                       =&gt; &quot;Asia/Kuwait&quot;,
+        &quot;Riyadh&quot;                       =&gt; &quot;Asia/Riyadh&quot;,
+        &quot;Nairobi&quot;                      =&gt; &quot;Africa/Nairobi&quot;,
+        &quot;Baghdad&quot;                      =&gt; &quot;Asia/Baghdad&quot;,
+        &quot;Tehran&quot;                       =&gt; &quot;Asia/Tehran&quot;,
+        &quot;Abu Dhabi&quot;                    =&gt; &quot;Asia/Muscat&quot;,
+        &quot;Muscat&quot;                       =&gt; &quot;Asia/Muscat&quot;,
+        &quot;Baku&quot;                         =&gt; &quot;Asia/Baku&quot;,
+        &quot;Tbilisi&quot;                      =&gt; &quot;Asia/Tbilisi&quot;,
+        &quot;Yerevan&quot;                      =&gt; &quot;Asia/Yerevan&quot;,
+        &quot;Kabul&quot;                        =&gt; &quot;Asia/Kabul&quot;,
+        &quot;Ekaterinburg&quot;                 =&gt; &quot;Asia/Yekaterinburg&quot;,
+        &quot;Islamabad&quot;                    =&gt; &quot;Asia/Karachi&quot;,
+        &quot;Karachi&quot;                      =&gt; &quot;Asia/Karachi&quot;,
+        &quot;Tashkent&quot;                     =&gt; &quot;Asia/Tashkent&quot;,
+        &quot;Chennai&quot;                      =&gt; &quot;Asia/Kolkata&quot;,
+        &quot;Kolkata&quot;                      =&gt; &quot;Asia/Kolkata&quot;,
+        &quot;Mumbai&quot;                       =&gt; &quot;Asia/Kolkata&quot;,
+        &quot;New Delhi&quot;                    =&gt; &quot;Asia/Kolkata&quot;,
+        &quot;Kathmandu&quot;                    =&gt; &quot;Asia/Katmandu&quot;,
+        &quot;Astana&quot;                       =&gt; &quot;Asia/Dhaka&quot;,
+        &quot;Dhaka&quot;                        =&gt; &quot;Asia/Dhaka&quot;,
+        &quot;Sri Jayawardenepura&quot;          =&gt; &quot;Asia/Dhaka&quot;,
+        &quot;Almaty&quot;                       =&gt; &quot;Asia/Almaty&quot;,
+        &quot;Novosibirsk&quot;                  =&gt; &quot;Asia/Novosibirsk&quot;,
+        &quot;Rangoon&quot;                      =&gt; &quot;Asia/Rangoon&quot;,
+        &quot;Bangkok&quot;                      =&gt; &quot;Asia/Bangkok&quot;,
+        &quot;Hanoi&quot;                        =&gt; &quot;Asia/Bangkok&quot;,
+        &quot;Jakarta&quot;                      =&gt; &quot;Asia/Jakarta&quot;,
+        &quot;Krasnoyarsk&quot;                  =&gt; &quot;Asia/Krasnoyarsk&quot;,
+        &quot;Beijing&quot;                      =&gt; &quot;Asia/Shanghai&quot;,
+        &quot;Chongqing&quot;                    =&gt; &quot;Asia/Chongqing&quot;,
+        &quot;Hong Kong&quot;                    =&gt; &quot;Asia/Hong_Kong&quot;,
+        &quot;Urumqi&quot;                       =&gt; &quot;Asia/Urumqi&quot;,
+        &quot;Kuala Lumpur&quot;                 =&gt; &quot;Asia/Kuala_Lumpur&quot;,
+        &quot;Singapore&quot;                    =&gt; &quot;Asia/Singapore&quot;,
+        &quot;Taipei&quot;                       =&gt; &quot;Asia/Taipei&quot;,
+        &quot;Perth&quot;                        =&gt; &quot;Australia/Perth&quot;,
+        &quot;Irkutsk&quot;                      =&gt; &quot;Asia/Irkutsk&quot;,
+        &quot;Ulaan Bataar&quot;                 =&gt; &quot;Asia/Ulaanbaatar&quot;,
+        &quot;Seoul&quot;                        =&gt; &quot;Asia/Seoul&quot;,
+        &quot;Osaka&quot;                        =&gt; &quot;Asia/Tokyo&quot;,
+        &quot;Sapporo&quot;                      =&gt; &quot;Asia/Tokyo&quot;,
+        &quot;Tokyo&quot;                        =&gt; &quot;Asia/Tokyo&quot;,
+        &quot;Yakutsk&quot;                      =&gt; &quot;Asia/Yakutsk&quot;,
+        &quot;Darwin&quot;                       =&gt; &quot;Australia/Darwin&quot;,
+        &quot;Adelaide&quot;                     =&gt; &quot;Australia/Adelaide&quot;,
+        &quot;Canberra&quot;                     =&gt; &quot;Australia/Melbourne&quot;,
+        &quot;Melbourne&quot;                    =&gt; &quot;Australia/Melbourne&quot;,
+        &quot;Sydney&quot;                       =&gt; &quot;Australia/Sydney&quot;,
+        &quot;Brisbane&quot;                     =&gt; &quot;Australia/Brisbane&quot;,
+        &quot;Hobart&quot;                       =&gt; &quot;Australia/Hobart&quot;,
+        &quot;Vladivostok&quot;                  =&gt; &quot;Asia/Vladivostok&quot;,
+        &quot;Guam&quot;                         =&gt; &quot;Pacific/Guam&quot;,
+        &quot;Port Moresby&quot;                 =&gt; &quot;Pacific/Port_Moresby&quot;,
+        &quot;Magadan&quot;                      =&gt; &quot;Asia/Magadan&quot;,
+        &quot;Solomon Is.&quot;                  =&gt; &quot;Asia/Magadan&quot;,
+        &quot;New Caledonia&quot;                =&gt; &quot;Pacific/Noumea&quot;,
+        &quot;Fiji&quot;                         =&gt; &quot;Pacific/Fiji&quot;,
+        &quot;Kamchatka&quot;                    =&gt; &quot;Asia/Kamchatka&quot;,
+        &quot;Marshall Is.&quot;                 =&gt; &quot;Pacific/Majuro&quot;,
+        &quot;Auckland&quot;                     =&gt; &quot;Pacific/Auckland&quot;,
+        &quot;Wellington&quot;                   =&gt; &quot;Pacific/Auckland&quot;,
+        &quot;Nuku'alofa&quot;                   =&gt; &quot;Pacific/Tongatapu&quot;
+      }.each { |name, zone| name.freeze; zone.freeze }
+      MAPPING.freeze
+    end
 
-  # Create a new TimeZone object with the given name and offset. The
-  # offset is the number of seconds that this time zone is offset from UTC
-  # (GMT). Seconds were chosen as the offset unit because that is the unit that
-  # Ruby uses to represent time zone offsets (see Time#utc_offset).
-  def initialize(name, utc_offset, tzinfo = nil)
-    @name = name
-    @utc_offset = utc_offset
-    @tzinfo = tzinfo
-  end
+    include Comparable
+    attr_reader :name
 
-  def utc_offset
-    @utc_offset ||= tzinfo.current_period.utc_offset
-  end
-
-  # Returns the offset of this time zone as a formatted string, of the
-  # format &quot;+HH:MM&quot;.
-  def formatted_offset(colon=true, alternate_utc_string = nil)
-    utc_offset == 0 &amp;&amp; alternate_utc_string || utc_offset.to_utc_offset_s(colon)
-  end
+    # Create a new TimeZone object with the given name and offset. The
+    # offset is the number of seconds that this time zone is offset from UTC
+    # (GMT). Seconds were chosen as the offset unit because that is the unit that
+    # Ruby uses to represent time zone offsets (see Time#utc_offset).
+    def initialize(name, utc_offset, tzinfo = nil)
+      @name = name
+      @utc_offset = utc_offset
+      @tzinfo = tzinfo
+    end
 
-  # Compare this time zone to the parameter. The two are comapred first on
-  # their offsets, and then by name.
-  def &lt;=&gt;(zone)
-    result = (utc_offset &lt;=&gt; zone.utc_offset)
-    result = (name &lt;=&gt; zone.name) if result == 0
-    result
-  end
+    def utc_offset
+      @utc_offset ||= tzinfo.current_period.utc_offset
+    end
 
-  # Returns a textual representation of this time zone.
-  def to_s
-    &quot;(GMT#{formatted_offset}) #{name}&quot;
-  end
+    # Returns the offset of this time zone as a formatted string, of the
+    # format &quot;+HH:MM&quot;.
+    def formatted_offset(colon=true, alternate_utc_string = nil)
+      utc_offset == 0 &amp;&amp; alternate_utc_string || utc_offset.to_utc_offset_s(colon)
+    end
 
-  # Method for creating new ActiveSupport::TimeWithZone instance in time zone of +self+ from given values. Example:
-  #
-  #   Time.zone = &quot;Hawaii&quot;                      # =&gt; &quot;Hawaii&quot;
-  #   Time.zone.local(2007, 2, 1, 15, 30, 45)   # =&gt; Thu, 01 Feb 2007 15:30:45 HST -10:00
-  def local(*args)
-    time = Time.utc_time(*args)
-    ActiveSupport::TimeWithZone.new(nil, self, time)
-  end
+    # Compare this time zone to the parameter. The two are comapred first on
+    # their offsets, and then by name.
+    def &lt;=&gt;(zone)
+      result = (utc_offset &lt;=&gt; zone.utc_offset)
+      result = (name &lt;=&gt; zone.name) if result == 0
+      result
+    end
 
-  # Method for creating new ActiveSupport::TimeWithZone instance in time zone of +self+ from number of seconds since the Unix epoch. Example:
-  #
-  #   Time.zone = &quot;Hawaii&quot;        # =&gt; &quot;Hawaii&quot;
-  #   Time.utc(2000).to_f         # =&gt; 946684800.0
-  #   Time.zone.at(946684800.0)   # =&gt; Fri, 31 Dec 1999 14:00:00 HST -10:00
-  def at(secs)
-    utc = Time.at(secs).utc rescue DateTime.civil(1970).since(secs)
-    utc.in_time_zone(self)
-  end
+    # Returns a textual representation of this time zone.
+    def to_s
+      &quot;(GMT#{formatted_offset}) #{name}&quot;
+    end
 
-  # Method for creating new ActiveSupport::TimeWithZone instance in time zone of +self+ from parsed string. Example:
-  #
-  #   Time.zone = &quot;Hawaii&quot;                      # =&gt; &quot;Hawaii&quot;
-  #   Time.zone.parse('1999-12-31 14:00:00')    # =&gt; Fri, 31 Dec 1999 14:00:00 HST -10:00
-  #
-  # If upper components are missing from the string, they are supplied from TimeZone#now:
-  #
-  #   Time.zone.now                 # =&gt; Fri, 31 Dec 1999 14:00:00 HST -10:00
-  #   Time.zone.parse('22:30:00')   # =&gt; Fri, 31 Dec 1999 22:30:00 HST -10:00
-  def parse(str, now=now)
-    date_parts = Date._parse(str)
-    return if date_parts.blank?
-    time = Time.parse(str, now) rescue DateTime.parse(str)
-    if date_parts[:offset].nil?
+    # Method for creating new ActiveSupport::TimeWithZone instance in time zone of +self+ from given values. Example:
+    #
+    #   Time.zone = &quot;Hawaii&quot;                      # =&gt; &quot;Hawaii&quot;
+    #   Time.zone.local(2007, 2, 1, 15, 30, 45)   # =&gt; Thu, 01 Feb 2007 15:30:45 HST -10:00
+    def local(*args)
+      time = Time.utc_time(*args)
       ActiveSupport::TimeWithZone.new(nil, self, time)
-    else
-      time.in_time_zone(self)
     end
-  end
 
-  # Returns an ActiveSupport::TimeWithZone instance representing the current time
-  # in the time zone represented by +self+. Example:
-  #
-  #   Time.zone = 'Hawaii'  # =&gt; &quot;Hawaii&quot;
-  #   Time.zone.now         # =&gt; Wed, 23 Jan 2008 20:24:27 HST -10:00
-  def now
-    Time.now.utc.in_time_zone(self)
-  end
+    # Method for creating new ActiveSupport::TimeWithZone instance in time zone of +self+ from number of seconds since the Unix epoch. Example:
+    #
+    #   Time.zone = &quot;Hawaii&quot;        # =&gt; &quot;Hawaii&quot;
+    #   Time.utc(2000).to_f         # =&gt; 946684800.0
+    #   Time.zone.at(946684800.0)   # =&gt; Fri, 31 Dec 1999 14:00:00 HST -10:00
+    def at(secs)
+      utc = Time.at(secs).utc rescue DateTime.civil(1970).since(secs)
+      utc.in_time_zone(self)
+    end
 
-  # Return the current date in this time zone.
-  def today
-    tzinfo.now.to_date
-  end
+    # Method for creating new ActiveSupport::TimeWithZone instance in time zone of +self+ from parsed string. Example:
+    #
+    #   Time.zone = &quot;Hawaii&quot;                      # =&gt; &quot;Hawaii&quot;
+    #   Time.zone.parse('1999-12-31 14:00:00')    # =&gt; Fri, 31 Dec 1999 14:00:00 HST -10:00
+    #
+    # If upper components are missing from the string, they are supplied from TimeZone#now:
+    #
+    #   Time.zone.now                 # =&gt; Fri, 31 Dec 1999 14:00:00 HST -10:00
+    #   Time.zone.parse('22:30:00')   # =&gt; Fri, 31 Dec 1999 22:30:00 HST -10:00
+    def parse(str, now=now)
+      date_parts = Date._parse(str)
+      return if date_parts.blank?
+      time = Time.parse(str, now) rescue DateTime.parse(str)
+      if date_parts[:offset].nil?
+        ActiveSupport::TimeWithZone.new(nil, self, time)
+      else
+        time.in_time_zone(self)
+      end
+    end
 
-  # Adjust the given time to the simultaneous time in the time zone represented by +self+. Returns a
-  # Time.utc() instance -- if you want an ActiveSupport::TimeWithZone instance, use Time#in_time_zone() instead.
-  def utc_to_local(time)
-    tzinfo.utc_to_local(time)
-  end
+    # Returns an ActiveSupport::TimeWithZone instance representing the current time
+    # in the time zone represented by +self+. Example:
+    #
+    #   Time.zone = 'Hawaii'  # =&gt; &quot;Hawaii&quot;
+    #   Time.zone.now         # =&gt; Wed, 23 Jan 2008 20:24:27 HST -10:00
+    def now
+      Time.now.utc.in_time_zone(self)
+    end
 
-  # Adjust the given time to the simultaneous time in UTC. Returns a Time.utc() instance.
-  def local_to_utc(time, dst=true)
-    tzinfo.local_to_utc(time, dst)
-  end
+    # Return the current date in this time zone.
+    def today
+      tzinfo.now.to_date
+    end
 
-  # Available so that TimeZone instances respond like TZInfo::Timezone instances
-  def period_for_utc(time)
-    tzinfo.period_for_utc(time)
-  end
+    # Adjust the given time to the simultaneous time in the time zone represented by +self+. Returns a
+    # Time.utc() instance -- if you want an ActiveSupport::TimeWithZone instance, use Time#in_time_zone() instead.
+    def utc_to_local(time)
+      tzinfo.utc_to_local(time)
+    end
 
-  # Available so that TimeZone instances respond like TZInfo::Timezone instances
-  def period_for_local(time, dst=true)
-    tzinfo.period_for_local(time, dst)
-  end
+    # Adjust the given time to the simultaneous time in UTC. Returns a Time.utc() instance.
+    def local_to_utc(time, dst=true)
+      tzinfo.local_to_utc(time, dst)
+    end
 
-  # TODO: Preload instead of lazy load for thread safety
-  def tzinfo
-    @tzinfo ||= TZInfo::Timezone.get(MAPPING[name])
-  end
+    # Available so that TimeZone instances respond like TZInfo::Timezone instances
+    def period_for_utc(time)
+      tzinfo.period_for_utc(time)
+    end
 
-  unless const_defined?(:ZONES)
-    ZONES = []
-    ZONES_MAP = {}
-    [[-39_600, &quot;International Date Line West&quot;, &quot;Midway Island&quot;, &quot;Samoa&quot; ],
-     [-36_000, &quot;Hawaii&quot; ],
-     [-32_400, &quot;Alaska&quot; ],
-     [-28_800, &quot;Pacific Time (US &amp; Canada)&quot;, &quot;Tijuana&quot; ],
-     [-25_200, &quot;Mountain Time (US &amp; Canada)&quot;, &quot;Chihuahua&quot;, &quot;Mazatlan&quot;,
-               &quot;Arizona&quot; ],
-     [-21_600, &quot;Central Time (US &amp; Canada)&quot;, &quot;Saskatchewan&quot;, &quot;Guadalajara&quot;,
-               &quot;Mexico City&quot;, &quot;Monterrey&quot;, &quot;Central America&quot; ],
-     [-18_000, &quot;Eastern Time (US &amp; Canada)&quot;, &quot;Indiana (East)&quot;, &quot;Bogota&quot;,
-               &quot;Lima&quot;, &quot;Quito&quot; ],
-     [-14_400, &quot;Atlantic Time (Canada)&quot;, &quot;Caracas&quot;, &quot;La Paz&quot;, &quot;Santiago&quot; ],
-     [-12_600, &quot;Newfoundland&quot; ],
-     [-10_800, &quot;Brasilia&quot;, &quot;Buenos Aires&quot;, &quot;Georgetown&quot;, &quot;Greenland&quot; ],
-     [ -7_200, &quot;Mid-Atlantic&quot; ],
-     [ -3_600, &quot;Azores&quot;, &quot;Cape Verde Is.&quot; ],
-     [      0, &quot;Dublin&quot;, &quot;Edinburgh&quot;, &quot;Lisbon&quot;, &quot;London&quot;, &quot;Casablanca&quot;,
-               &quot;Monrovia&quot;, &quot;UTC&quot; ],
-     [  3_600, &quot;Belgrade&quot;, &quot;Bratislava&quot;, &quot;Budapest&quot;, &quot;Ljubljana&quot;, &quot;Prague&quot;,
-               &quot;Sarajevo&quot;, &quot;Skopje&quot;, &quot;Warsaw&quot;, &quot;Zagreb&quot;, &quot;Brussels&quot;,
-               &quot;Copenhagen&quot;, &quot;Madrid&quot;, &quot;Paris&quot;, &quot;Amsterdam&quot;, &quot;Berlin&quot;,
-               &quot;Bern&quot;, &quot;Rome&quot;, &quot;Stockholm&quot;, &quot;Vienna&quot;,
-               &quot;West Central Africa&quot; ],
-     [  7_200, &quot;Bucharest&quot;, &quot;Cairo&quot;, &quot;Helsinki&quot;, &quot;Kyev&quot;, &quot;Riga&quot;, &quot;Sofia&quot;,
-               &quot;Tallinn&quot;, &quot;Vilnius&quot;, &quot;Athens&quot;, &quot;Istanbul&quot;, &quot;Minsk&quot;,
-               &quot;Jerusalem&quot;, &quot;Harare&quot;, &quot;Pretoria&quot; ],
-     [ 10_800, &quot;Moscow&quot;, &quot;St. Petersburg&quot;, &quot;Volgograd&quot;, &quot;Kuwait&quot;, &quot;Riyadh&quot;,
-               &quot;Nairobi&quot;, &quot;Baghdad&quot; ],
-     [ 12_600, &quot;Tehran&quot; ],
-     [ 14_400, &quot;Abu Dhabi&quot;, &quot;Muscat&quot;, &quot;Baku&quot;, &quot;Tbilisi&quot;, &quot;Yerevan&quot; ],
-     [ 16_200, &quot;Kabul&quot; ],
-     [ 18_000, &quot;Ekaterinburg&quot;, &quot;Islamabad&quot;, &quot;Karachi&quot;, &quot;Tashkent&quot; ],
-     [ 19_800, &quot;Chennai&quot;, &quot;Kolkata&quot;, &quot;Mumbai&quot;, &quot;New Delhi&quot; ],
-     [ 20_700, &quot;Kathmandu&quot; ],
-     [ 21_600, &quot;Astana&quot;, &quot;Dhaka&quot;, &quot;Sri Jayawardenepura&quot;, &quot;Almaty&quot;,
-               &quot;Novosibirsk&quot; ],
-     [ 23_400, &quot;Rangoon&quot; ],
-     [ 25_200, &quot;Bangkok&quot;, &quot;Hanoi&quot;, &quot;Jakarta&quot;, &quot;Krasnoyarsk&quot; ],
-     [ 28_800, &quot;Beijing&quot;, &quot;Chongqing&quot;, &quot;Hong Kong&quot;, &quot;Urumqi&quot;,
-               &quot;Kuala Lumpur&quot;, &quot;Singapore&quot;, &quot;Taipei&quot;, &quot;Perth&quot;, &quot;Irkutsk&quot;,
-               &quot;Ulaan Bataar&quot; ],
-     [ 32_400, &quot;Seoul&quot;, &quot;Osaka&quot;, &quot;Sapporo&quot;, &quot;Tokyo&quot;, &quot;Yakutsk&quot; ],
-     [ 34_200, &quot;Darwin&quot;, &quot;Adelaide&quot; ],
-     [ 36_000, &quot;Canberra&quot;, &quot;Melbourne&quot;, &quot;Sydney&quot;, &quot;Brisbane&quot;, &quot;Hobart&quot;,
-               &quot;Vladivostok&quot;, &quot;Guam&quot;, &quot;Port Moresby&quot; ],
-     [ 39_600, &quot;Magadan&quot;, &quot;Solomon Is.&quot;, &quot;New Caledonia&quot; ],
-     [ 43_200, &quot;Fiji&quot;, &quot;Kamchatka&quot;, &quot;Marshall Is.&quot;, &quot;Auckland&quot;,
-               &quot;Wellington&quot; ],
-     [ 46_800, &quot;Nuku'alofa&quot; ]].
-    each do |offset, *places|
-      places.each do |place|
-        place.freeze
-        zone = new(place, offset)
-        ZONES &lt;&lt; zone
-        ZONES_MAP[place] = zone
-      end
+    # Available so that TimeZone instances respond like TZInfo::Timezone instances
+    def period_for_local(time, dst=true)
+      tzinfo.period_for_local(time, dst)
     end
-    ZONES.sort!
-    ZONES.freeze
-    ZONES_MAP.freeze
 
-    US_ZONES = ZONES.find_all { |z| z.name =~ /US|Arizona|Indiana|Hawaii|Alaska/ }
-    US_ZONES.freeze
-  end
+    # TODO: Preload instead of lazy load for thread safety
+    def tzinfo
+      @tzinfo ||= TZInfo::Timezone.get(MAPPING[name])
+    end
 
-  class &lt;&lt; self
-    alias_method :create, :new
+    unless const_defined?(:ZONES)
+      ZONES = []
+      ZONES_MAP = {}
+      [[-39_600, &quot;International Date Line West&quot;, &quot;Midway Island&quot;, &quot;Samoa&quot; ],
+       [-36_000, &quot;Hawaii&quot; ],
+       [-32_400, &quot;Alaska&quot; ],
+       [-28_800, &quot;Pacific Time (US &amp; Canada)&quot;, &quot;Tijuana&quot; ],
+       [-25_200, &quot;Mountain Time (US &amp; Canada)&quot;, &quot;Chihuahua&quot;, &quot;Mazatlan&quot;,
+                 &quot;Arizona&quot; ],
+       [-21_600, &quot;Central Time (US &amp; Canada)&quot;, &quot;Saskatchewan&quot;, &quot;Guadalajara&quot;,
+                 &quot;Mexico City&quot;, &quot;Monterrey&quot;, &quot;Central America&quot; ],
+       [-18_000, &quot;Eastern Time (US &amp; Canada)&quot;, &quot;Indiana (East)&quot;, &quot;Bogota&quot;,
+                 &quot;Lima&quot;, &quot;Quito&quot; ],
+       [-14_400, &quot;Atlantic Time (Canada)&quot;, &quot;Caracas&quot;, &quot;La Paz&quot;, &quot;Santiago&quot; ],
+       [-12_600, &quot;Newfoundland&quot; ],
+       [-10_800, &quot;Brasilia&quot;, &quot;Buenos Aires&quot;, &quot;Georgetown&quot;, &quot;Greenland&quot; ],
+       [ -7_200, &quot;Mid-Atlantic&quot; ],
+       [ -3_600, &quot;Azores&quot;, &quot;Cape Verde Is.&quot; ],
+       [      0, &quot;Dublin&quot;, &quot;Edinburgh&quot;, &quot;Lisbon&quot;, &quot;London&quot;, &quot;Casablanca&quot;,
+                 &quot;Monrovia&quot;, &quot;UTC&quot; ],
+       [  3_600, &quot;Belgrade&quot;, &quot;Bratislava&quot;, &quot;Budapest&quot;, &quot;Ljubljana&quot;, &quot;Prague&quot;,
+                 &quot;Sarajevo&quot;, &quot;Skopje&quot;, &quot;Warsaw&quot;, &quot;Zagreb&quot;, &quot;Brussels&quot;,
+                 &quot;Copenhagen&quot;, &quot;Madrid&quot;, &quot;Paris&quot;, &quot;Amsterdam&quot;, &quot;Berlin&quot;,
+                 &quot;Bern&quot;, &quot;Rome&quot;, &quot;Stockholm&quot;, &quot;Vienna&quot;,
+                 &quot;West Central Africa&quot; ],
+       [  7_200, &quot;Bucharest&quot;, &quot;Cairo&quot;, &quot;Helsinki&quot;, &quot;Kyev&quot;, &quot;Riga&quot;, &quot;Sofia&quot;,
+                 &quot;Tallinn&quot;, &quot;Vilnius&quot;, &quot;Athens&quot;, &quot;Istanbul&quot;, &quot;Minsk&quot;,
+                 &quot;Jerusalem&quot;, &quot;Harare&quot;, &quot;Pretoria&quot; ],
+       [ 10_800, &quot;Moscow&quot;, &quot;St. Petersburg&quot;, &quot;Volgograd&quot;, &quot;Kuwait&quot;, &quot;Riyadh&quot;,
+                 &quot;Nairobi&quot;, &quot;Baghdad&quot; ],
+       [ 12_600, &quot;Tehran&quot; ],
+       [ 14_400, &quot;Abu Dhabi&quot;, &quot;Muscat&quot;, &quot;Baku&quot;, &quot;Tbilisi&quot;, &quot;Yerevan&quot; ],
+       [ 16_200, &quot;Kabul&quot; ],
+       [ 18_000, &quot;Ekaterinburg&quot;, &quot;Islamabad&quot;, &quot;Karachi&quot;, &quot;Tashkent&quot; ],
+       [ 19_800, &quot;Chennai&quot;, &quot;Kolkata&quot;, &quot;Mumbai&quot;, &quot;New Delhi&quot; ],
+       [ 20_700, &quot;Kathmandu&quot; ],
+       [ 21_600, &quot;Astana&quot;, &quot;Dhaka&quot;, &quot;Sri Jayawardenepura&quot;, &quot;Almaty&quot;,
+                 &quot;Novosibirsk&quot; ],
+       [ 23_400, &quot;Rangoon&quot; ],
+       [ 25_200, &quot;Bangkok&quot;, &quot;Hanoi&quot;, &quot;Jakarta&quot;, &quot;Krasnoyarsk&quot; ],
+       [ 28_800, &quot;Beijing&quot;, &quot;Chongqing&quot;, &quot;Hong Kong&quot;, &quot;Urumqi&quot;,
+                 &quot;Kuala Lumpur&quot;, &quot;Singapore&quot;, &quot;Taipei&quot;, &quot;Perth&quot;, &quot;Irkutsk&quot;,
+                 &quot;Ulaan Bataar&quot; ],
+       [ 32_400, &quot;Seoul&quot;, &quot;Osaka&quot;, &quot;Sapporo&quot;, &quot;Tokyo&quot;, &quot;Yakutsk&quot; ],
+       [ 34_200, &quot;Darwin&quot;, &quot;Adelaide&quot; ],
+       [ 36_000, &quot;Canberra&quot;, &quot;Melbourne&quot;, &quot;Sydney&quot;, &quot;Brisbane&quot;, &quot;Hobart&quot;,
+                 &quot;Vladivostok&quot;, &quot;Guam&quot;, &quot;Port Moresby&quot; ],
+       [ 39_600, &quot;Magadan&quot;, &quot;Solomon Is.&quot;, &quot;New Caledonia&quot; ],
+       [ 43_200, &quot;Fiji&quot;, &quot;Kamchatka&quot;, &quot;Marshall Is.&quot;, &quot;Auckland&quot;,
+                 &quot;Wellington&quot; ],
+       [ 46_800, &quot;Nuku'alofa&quot; ]].
+      each do |offset, *places|
+        places.each do |place|
+          place.freeze
+          zone = new(place, offset)
+          ZONES &lt;&lt; zone
+          ZONES_MAP[place] = zone
+        end
+      end
+      ZONES.sort!
+      ZONES.freeze
+      ZONES_MAP.freeze
 
-    # Return a TimeZone instance with the given name, or +nil+ if no
-    # such TimeZone instance exists. (This exists to support the use of
-    # this class with the +composed_of+ macro.)
-    def new(name)
-      self[name]
+      US_ZONES = ZONES.find_all { |z| z.name =~ /US|Arizona|Indiana|Hawaii|Alaska/ }
+      US_ZONES.freeze
     end
 
-    # Return an array of all TimeZone objects. There are multiple
-    # TimeZone objects per time zone, in many cases, to make it easier
-    # for users to find their own time zone.
-    def all
-      ZONES
-    end
+    class &lt;&lt; self
+      alias_method :create, :new
 
-    # Locate a specific time zone object. If the argument is a string, it
-    # is interpreted to mean the name of the timezone to locate. If it is a
-    # numeric value it is either the hour offset, or the second offset, of the
-    # timezone to find. (The first one with that offset will be returned.)
-    # Returns +nil+ if no such time zone is known to the system.
-    def [](arg)
-      case arg
-        when String
-          ZONES_MAP[arg]
-        when Numeric, ActiveSupport::Duration
-          arg *= 3600 if arg.abs &lt;= 13
-          all.find { |z| z.utc_offset == arg.to_i }
-        else
-          raise ArgumentError, &quot;invalid argument to TimeZone[]: #{arg.inspect}&quot;
+      # Return a TimeZone instance with the given name, or +nil+ if no
+      # such TimeZone instance exists. (This exists to support the use of
+      # this class with the +composed_of+ macro.)
+      def new(name)
+        self[name]
       end
-    end
 
-    # A convenience method for returning a collection of TimeZone objects
-    # for time zones in the USA.
-    def us_zones
-      US_ZONES
+      # Return an array of all TimeZone objects. There are multiple
+      # TimeZone objects per time zone, in many cases, to make it easier
+      # for users to find their own time zone.
+      def all
+        ZONES
+      end
+
+      # Locate a specific time zone object. If the argument is a string, it
+      # is interpreted to mean the name of the timezone to locate. If it is a
+      # numeric value it is either the hour offset, or the second offset, of the
+      # timezone to find. (The first one with that offset will be returned.)
+      # Returns +nil+ if no such time zone is known to the system.
+      def [](arg)
+        case arg
+          when String
+            ZONES_MAP[arg]
+          when Numeric, ActiveSupport::Duration
+            arg *= 3600 if arg.abs &lt;= 13
+            all.find { |z| z.utc_offset == arg.to_i }
+          else
+            raise ArgumentError, &quot;invalid argument to TimeZone[]: #{arg.inspect}&quot;
+        end
+      end
+
+      # A convenience method for returning a collection of TimeZone objects
+      # for time zones in the USA.
+      def us_zones
+        US_ZONES
+      end
     end
   end
 end</diff>
      <filename>vendor/rails/activesupport/lib/active_support/values/time_zone.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@ rescue Gem::LoadError
 end
 
 begin
-  gem 'tzinfo', '~&gt; 0.3.8'
+  gem 'tzinfo', '~&gt; 0.3.9'
 rescue Gem::LoadError
-  $:.unshift &quot;#{File.dirname(__FILE__)}/vendor/tzinfo-0.3.8&quot;
+  $:.unshift &quot;#{File.dirname(__FILE__)}/vendor/tzinfo-0.3.9&quot;
 end
\ No newline at end of file</diff>
      <filename>vendor/rails/activesupport/lib/active_support/vendor.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ module ActiveSupport
   module VERSION #:nodoc:
     MAJOR = 2
     MINOR = 1
-    TINY  = 0
+    TINY  = 1
 
     STRING = [MAJOR, MINOR, TINY].join('.')
   end</diff>
      <filename>vendor/rails/activesupport/lib/active_support/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,18 @@
+*2.1.1 (September 4th, 2008)*
+
+* Fix script/about in production mode.  #370 [Cheah Chu Yeow, Xavier Noria, David Krmpotic]
+
+* Add the gem load paths before the framework is loaded, so certain gems like RedCloth and BlueCloth can be frozen.
+
+* Fix discrepancies with loading rails/init.rb from gems.
+
+* Plugins check for the gem init path (rails/init.rb) before the standard plugin init path (init.rb)  [Jacek Becela]
+
+* Wrapped Rails.env in StringInquirer so you can do Rails.env.development? [DHH]
+
+* Fixed that RailsInfoController wasn't considering all requests local in development mode (Edgard Castro) [#310 state:resolved]
+
+
 *2.1.0 (May 31st, 2008)*
 
 * script/dbconsole fires up the command-line database client.  #102 [Steve Purcell]</diff>
      <filename>vendor/rails/railties/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,7 @@ require 'rake'
 require 'rake/testtask'
 require 'rake/rdoctask'
 require 'rake/gempackagetask'
+require 'rake/contrib/sshpublisher'
 require 'rake/contrib/rubyforgepublisher'
 
 require 'date'
@@ -264,9 +265,10 @@ Rake::RDocTask.new { |rdoc|
   rdoc.title    = &quot;Railties -- Gluing the Engine to the Rails&quot;
   rdoc.options &lt;&lt; '--line-numbers' &lt;&lt; '--inline-source' &lt;&lt; '--accessor' &lt;&lt; 'cattr_accessor=object'
   rdoc.options &lt;&lt; '--charset' &lt;&lt; 'utf-8'
-  rdoc.template = &quot;#{ENV['template']}.rb&quot; if ENV['template']
+  rdoc.template = ENV['template'] ? &quot;#{ENV['template']}.rb&quot; : '../doc/template/horo'
   rdoc.rdoc_files.include('README', 'CHANGELOG')
   rdoc.rdoc_files.include('lib/*.rb')
+  rdoc.rdoc_files.include('lib/rails/*.rb')
   rdoc.rdoc_files.include('lib/rails_generator/*.rb')
   rdoc.rdoc_files.include('lib/commands/**/*.rb')
 }
@@ -304,11 +306,11 @@ spec = Gem::Specification.new do |s|
   EOF
 
   s.add_dependency('rake', '&gt;= 0.8.1')
-  s.add_dependency('activesupport',    '= 2.1.0' + PKG_BUILD)
-  s.add_dependency('activerecord',     '= 2.1.0' + PKG_BUILD)
-  s.add_dependency('actionpack',       '= 2.1.0' + PKG_BUILD)
-  s.add_dependency('actionmailer',     '= 2.1.0' + PKG_BUILD)
-  s.add_dependency('activeresource',   '= 2.1.0' + PKG_BUILD)
+  s.add_dependency('activesupport',    '= 2.1.1' + PKG_BUILD)
+  s.add_dependency('activerecord',     '= 2.1.1' + PKG_BUILD)
+  s.add_dependency('actionpack',       '= 2.1.1' + PKG_BUILD)
+  s.add_dependency('actionmailer',     '= 2.1.1' + PKG_BUILD)
+  s.add_dependency('activeresource',   '= 2.1.1' + PKG_BUILD)
 
   s.rdoc_options &lt;&lt; '--exclude' &lt;&lt; '.'
   s.has_rdoc = false
@@ -331,10 +333,10 @@ end
 
 
 # Publishing -------------------------------------------------------
-desc &quot;Publish the API documentation&quot;
+desc &quot;Publish the rails gem&quot;
 task :pgem =&gt; [:gem] do 
-  Rake::SshFilePublisher.new(&quot;davidhh@wrath.rubyonrails.org&quot;, &quot;public_html/gems/gems&quot;, &quot;pkg&quot;, &quot;#{PKG_FILE_NAME}.gem&quot;).upload
-  `ssh davidhh@wrath.rubyonrails.org './gemupdate.sh'`
+  Rake::SshFilePublisher.new(&quot;david@greed.loudthinking.com&quot;, &quot;/u/sites/gems/gems&quot;, &quot;pkg&quot;, &quot;#{PKG_FILE_NAME}.gem&quot;).upload
+  `ssh david@greed.loudthinking.com '/u/sites/gems/gemupdate.sh'`
 end
 
 desc &quot;Publish the release files to RubyForge.&quot;</diff>
      <filename>vendor/rails/railties/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
 #!/usr/bin/env ruby
 require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/about'
+$LOAD_PATH.unshift &quot;#{RAILTIES_PATH}/builtin/rails_info&quot;
+require 'commands/about'
\ No newline at end of file</diff>
      <filename>vendor/rails/railties/bin/about</filename>
    </modified>
    <modified>
      <filename>vendor/rails/railties/bin/dbconsole</filename>
    </modified>
    <modified>
      <filename>vendor/rails/railties/bin/rails</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 class Rails::InfoController &lt; ActionController::Base
   def properties
-    if local_request?
+    if consider_all_requests_local || local_request?
       render :inline =&gt; Rails::Info.to_html
     else
       render :text =&gt; '&lt;p&gt;For security purposes, this information is only available to local requests.&lt;/p&gt;', :status =&gt; 500</diff>
      <filename>vendor/rails/railties/builtin/rails_info/rails/info_controller.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/railties/configs/apache.conf</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@
 
 # Add new inflection rules using the following format 
 # (all these examples are active by default):
-# Inflector.inflections do |inflect|
+# ActiveSupport::Inflector.inflections do |inflect|
 #   inflect.plural /^(ox)$/i, '\1en'
 #   inflect.singular /^(ox)en/i, '\1'
 #   inflect.irregular 'person', 'people'</diff>
      <filename>vendor/rails/railties/configs/initializers/inflections.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,13 @@
 # These settings change the behavior of Rails 2 apps and will be defaults
 # for Rails 3. You can remove this initializer when Rails 3 is released.
 
-# Include Active Record class name as root for JSON serialized output.
-ActiveRecord::Base.include_root_in_json = true
+if defined?(ActiveRecord)
+  # Include Active Record class name as root for JSON serialized output.
+  ActiveRecord::Base.include_root_in_json = true
 
-# Store the full class name (including module namespace) in STI type column.
-ActiveRecord::Base.store_full_sti_class = true
+  # Store the full class name (including module namespace) in STI type column.
+  ActiveRecord::Base.store_full_sti_class = true
+end
 
 # Use ISO 8601 format for JSON serialized times and dates.
 ActiveSupport.use_standard_json_time_format = true</diff>
      <filename>vendor/rails/railties/configs/initializers/new_rails_defaults.rb</filename>
    </modified>
    <modified>
      <diff>@@ -36,6 +36,8 @@ ActionController::Routing::Routes.draw do |map|
   # See how all your routes lay out with &quot;rake routes&quot;
 
   # Install the default routes as the lowest priority.
+  # Note: These default routes make all actions in every controller accessible via GET requests. You should
+  # consider removing the them or commenting them out if you're using named routes and resources.
   map.connect ':controller/:action/:id'
   map.connect ':controller/:action/:id.:format'
 end</diff>
      <filename>vendor/rails/railties/configs/routes.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/railties/dispatches/dispatch.fcgi</filename>
    </modified>
    <modified>
      <filename>vendor/rails/railties/dispatches/dispatch.rb</filename>
    </modified>
    <modified>
      <diff>@@ -82,14 +82,14 @@ module Rails
 
       def load_rubygems
         require 'rubygems'
-
-        unless rubygems_version &gt;= '0.9.4'
-          $stderr.puts %(Rails requires RubyGems &gt;= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
+        min_version = '1.1.1'
+        unless rubygems_version &gt;= min_version
+          $stderr.puts %Q(Rails requires RubyGems &gt;= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
           exit 1
         end
 
       rescue LoadError
-        $stderr.puts %(Rails requires RubyGems &gt;= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
+        $stderr.puts %Q(Rails requires RubyGems &gt;= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
         exit 1
       end
 </diff>
      <filename>vendor/rails/railties/environments/boot.rb</filename>
    </modified>
    <modified>
      <diff>@@ -40,7 +40,7 @@ Rails::Initializer.run do |config|
 
   # Make Time.zone default to the specified zone, and make Active Record store time values
   # in the database in UTC, and return them converted to the specified local zone.
-  # Run &quot;rake -D time&quot; for a list of tasks for finding time zone names. Uncomment to use default local time.
+  # Run &quot;rake -D time&quot; for a list of tasks for finding time zone names. Comment line to use default local time.
   config.time_zone = 'UTC'
 
   # Your secret key for verifying cookie session data integrity.</diff>
      <filename>vendor/rails/railties/environments/environment.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/railties/fresh_rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,2 +1,3 @@
 require 'environment'
+require 'rails/info'
 puts Rails::Info</diff>
      <filename>vendor/rails/railties/lib/commands/about.rb</filename>
    </modified>
    <modified>
      <diff>@@ -41,6 +41,8 @@ when &quot;mysql&quot;
 
   if config['password'] &amp;&amp; include_password
     args &lt;&lt; &quot;--password=#{config['password']}&quot;
+  elsif config['password'] &amp;&amp; !config['password'].empty?
+    args &lt;&lt; &quot;-p&quot;
   end
 
   args &lt;&lt; config['database']</diff>
      <filename>vendor/rails/railties/lib/commands/dbconsole.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/railties/lib/commands/generate.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/railties/lib/commands/performance/request.rb</filename>
    </modified>
    <modified>
      <diff>@@ -632,7 +632,7 @@ module Commands
     def options
       OptionParser.new do |o|
         o.set_summary_indent('  ')
-        o.banner =    &quot;Usage: #{@base_command.script_name} source URI [URI [URI]...]&quot;
+        o.banner =    &quot;Usage: #{@base_command.script_name} unsource URI [URI [URI]...]&quot;
         o.define_head &quot;Remove repositories from the default search list.&quot;
         o.separator &quot;&quot;
         o.on_tail(&quot;-h&quot;, &quot;--help&quot;, &quot;Show this help message.&quot;) { puts o; exit }
@@ -890,7 +890,7 @@ class RecursiveHTTPFetcher
 
   def ls
     @urls_to_fetch.collect do |url|
-      if url =~ /^svn:\/\/.*/
+      if url =~ /^svn(\+ssh)?:\/\/.*/
         `svn ls #{url}`.split(&quot;\n&quot;).map {|entry| &quot;/#{entry}&quot;} rescue nil
       else
         open(url) do |stream|</diff>
      <filename>vendor/rails/railties/lib/commands/plugin.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,7 +16,7 @@ def helper(*helper_names)
   end
 end
 
-require 'application'
+require_dependency 'application'
 
 class &lt;&lt; helper 
   include_all_modules_from ActionView</diff>
      <filename>vendor/rails/railties/lib/console_with_helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -36,7 +36,8 @@ module Rails
     end
   
     def env
-      RAILS_ENV
+      require 'active_support/string_inquirer'
+      ActiveSupport::StringInquirer.new(RAILS_ENV)
     end
   
     def cache
@@ -78,7 +79,10 @@ module Rails
 
     # The set of loaded plugins.
     attr_reader :loaded_plugins
-    
+
+    # Whether or not all the gem dependencies have been met
+    attr_reader :gems_dependencies_loaded
+
     # Runs the initializer. By default, this will invoke the #process method,
     # which simply executes all of the initialization routines. Alternately,
     # you can specify explicitly which initialization routine you want:
@@ -109,10 +113,10 @@ module Rails
       check_ruby_version
       install_gem_spec_stubs
       set_load_path
-      
+      add_gem_load_paths
+
       require_frameworks
       set_autoload_paths
-      add_gem_load_paths
       add_plugin_load_paths
       load_environment
 
@@ -200,10 +204,10 @@ module Rails
     # Set the paths from which Rails will automatically load source files, and
     # the load_once paths.
     def set_autoload_paths
-      Dependencies.load_paths = configuration.load_paths.uniq
-      Dependencies.load_once_paths = configuration.load_once_paths.uniq
+      ActiveSupport::Dependencies.load_paths = configuration.load_paths.uniq
+      ActiveSupport::Dependencies.load_once_paths = configuration.load_once_paths.uniq
 
-      extra = Dependencies.load_once_paths - Dependencies.load_paths
+      extra = ActiveSupport::Dependencies.load_once_paths - ActiveSupport::Dependencies.load_paths
       unless extra.empty?
         abort &lt;&lt;-end_error
           load_once_paths must be a subset of the load_paths.
@@ -230,7 +234,7 @@ module Rails
     end
 
     # Adds all load paths from plugins to the global set of load paths, so that
-    # code from plugins can be required (explicitly or automatically via Dependencies).
+    # code from plugins can be required (explicitly or automatically via ActiveSupport::Dependencies).
     def add_plugin_load_paths
       plugin_loader.add_plugin_load_paths
     end
@@ -238,12 +242,12 @@ module Rails
     def add_gem_load_paths
       unless @configuration.gems.empty?
         require &quot;rubygems&quot;
-        @configuration.gems.each &amp;:add_load_paths
+        @configuration.gems.each { |gem| gem.add_load_paths }
       end
     end
 
     def load_gems
-      @configuration.gems.each(&amp;:load)
+      @configuration.gems.each { |gem| gem.load }
     end
 
     def check_gem_dependencies
@@ -252,11 +256,16 @@ module Rails
         @gems_dependencies_loaded = false
         # don't print if the gems rake tasks are being run
         unless $rails_gem_installer
-          puts %{These gems that this application depends on are missing:}
-          unloaded_gems.each do |gem|
-            puts &quot; - #{gem.name}&quot;
-          end
-          puts %{Run &quot;rake gems:install&quot; to install them.}
+          abort &lt;&lt;-end_error
+Missing these required gems:
+  #{unloaded_gems.map { |gem| &quot;#{gem.name}  #{gem.requirement}&quot; } * &quot;\n  &quot;}
+
+You're running:
+  ruby #{Gem.ruby_version} at #{Gem.ruby}
+  rubygems #{Gem::RubyGemsVersion} at #{Gem.path * ', '}
+
+Run `rake gems:install` to install the missing gems.
+          end_error
         end
       else
         @gems_dependencies_loaded = true
@@ -306,7 +315,7 @@ module Rails
     end
 
     def load_observers
-      if @gems_dependencies_loaded &amp;&amp; configuration.frameworks.include?(:active_record)
+      if gems_dependencies_loaded &amp;&amp; configuration.frameworks.include?(:active_record)
         ActiveRecord::Base.instantiate_observers
       end
     end
@@ -412,7 +421,7 @@ module Rails
     # Sets the dependency loading mechanism based on the value of
     # Configuration#cache_classes.
     def initialize_dependency_mechanism
-      Dependencies.mechanism = configuration.cache_classes ? :require : :load
+      ActiveSupport::Dependencies.mechanism = configuration.cache_classes ? :require : :load
     end
 
     # Loads support for &quot;whiny nil&quot; (noisy warnings when methods are invoked
@@ -462,7 +471,7 @@ module Rails
 
     # Fires the user-supplied after_initialize block (Configuration#after_initialize)
     def after_initialize
-      if @gems_dependencies_loaded
+      if gems_dependencies_loaded
         configuration.after_initialize_blocks.each do |block|
           block.call
         end
@@ -470,7 +479,7 @@ module Rails
     end
 
     def load_application_initializers
-      if @gems_dependencies_loaded
+      if gems_dependencies_loaded
         Dir[&quot;#{configuration.root_path}/config/initializers/**/*.rb&quot;].sort.each do |initializer|
           load(initializer)
         end
@@ -478,6 +487,7 @@ module Rails
     end
 
     def prepare_dispatcher
+      return unless configuration.frameworks.include?(:action_controller)
       require 'dispatcher' unless defined?(::Dispatcher)
       Dispatcher.define_dispatcher_callbacks(configuration.cache_classes)
       Dispatcher.new(RAILS_DEFAULT_LOGGER).send :run_callbacks, :prepare_dispatch
@@ -598,12 +608,12 @@ module Rails
     # If &lt;tt&gt;reload_plugins?&lt;/tt&gt; is false, add this to your plugin's &lt;tt&gt;init.rb&lt;/tt&gt;
     # to make it reloadable:
     #
-    #   Dependencies.load_once_paths.delete lib_path
+    #   ActiveSupport::Dependencies.load_once_paths.delete lib_path
     #
     # If &lt;tt&gt;reload_plugins?&lt;/tt&gt; is true, add this to your plugin's &lt;tt&gt;init.rb&lt;/tt&gt;
     # to only load it once:
     #
-    #   Dependencies.load_once_paths &lt;&lt; lib_path
+    #   ActiveSupport::Dependencies.load_once_paths &lt;&lt; lib_path
     #
     attr_accessor :reload_plugins
 
@@ -620,13 +630,17 @@ module Rails
     # You can add gems with the #gem method.
     attr_accessor :gems
 
-    # Adds a single Gem dependency to the rails application.
+    # Adds a single Gem dependency to the rails application. By default, it will require
+    # the library with the same name as the gem. Use :lib to specify a different name.
     #
     #   # gem 'aws-s3', '&gt;= 0.4.0'
     #   # require 'aws/s3'
     #   config.gem 'aws-s3', :lib =&gt; 'aws/s3', :version =&gt; '&gt;= 0.4.0', \
     #     :source =&gt; &quot;http://code.whytheluckystiff.net&quot;
     #
+    # To require a library be installed, but not attempt to load it, pass :lib =&gt; false
+    #
+    #   config.gem 'qrp', :version =&gt; '0.4.1', :lib =&gt; false
     def gem(name, options = {})
       @gems &lt;&lt; Rails::GemDependency.new(name, options)
     end
@@ -698,6 +712,7 @@ module Rails
     # contents of the file are processed via ERB before being sent through
     # YAML::load.
     def database_configuration
+      require 'erb'
       YAML::load(ERB.new(IO.read(database_configuration_file)).result)
     end
 </diff>
      <filename>vendor/rails/railties/lib/initializer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,9 +23,13 @@ module Rails
       @unpack_directory = nil
     end
 
+    def unpacked_paths
+      Dir[File.join(self.class.unpacked_path, &quot;#{@name}-#{@version || &quot;*&quot;}&quot;)]
+    end
+
     def add_load_paths
       return if @loaded || @load_paths_added
-      unpacked_paths = Dir[File.join(self.class.unpacked_path, &quot;#{@name}-#{@version || &quot;*&quot;}&quot;)]
+      unpacked_paths = self.unpacked_paths
       if unpacked_paths.empty?
         args = [@name]
         args &lt;&lt; @requirement.to_s if @requirement
@@ -39,7 +43,7 @@ module Rails
       @load_paths_added = true
     rescue Gem::LoadError
     end
-    
+
     def dependencies
       all_dependencies = specification.dependencies.map do |dependency|
         GemDependency.new(dependency.name, :requirement =&gt; dependency.version_requirements)
@@ -47,14 +51,14 @@ module Rails
       all_dependencies += all_dependencies.map(&amp;:dependencies).flatten
       all_dependencies.uniq
     end
-    
+
     def gem_dir(base_directory)
       File.join(base_directory, specification.full_name)
     end
 
     def load
       return if @loaded || @load_paths_added == false
-      require(@lib || @name)
+      require(@lib || @name) unless @lib == false
       @loaded = true
     rescue LoadError
       puts $!.to_s
@@ -78,13 +82,13 @@ module Rails
       puts cmd
       puts %x(#{cmd})
     end
-    
+
     def unpack_to(directory)
       FileUtils.mkdir_p directory
       Dir.chdir directory do
         Gem::GemRunner.new.run(unpack_command)
       end
-      
+
       # copy the gem's specification into GEMDIR/.specification so that
       # we can access information about the gem on deployment systems
       # without having the gem installed
@@ -98,27 +102,26 @@ module Rails
       self.name == other.name &amp;&amp; self.requirement == other.requirement
     end
 
-private ###################################################################
-
     def specification
       @spec ||= Gem.source_index.search(Gem::Dependency.new(@name, @requirement)).sort_by { |s| s.version }.last
     end
-    
-    def gem_command
-      RUBY_PLATFORM =~ /win32/ ? 'gem.bat' : 'gem'
-    end
 
-    def install_command
-      cmd = %w(install) &lt;&lt; @name
-      cmd &lt;&lt; &quot;--version&quot; &lt;&lt; %(&quot;#{@requirement.to_s}&quot;) if @requirement
-      cmd &lt;&lt; &quot;--source&quot;  &lt;&lt; @source  if @source
-      cmd
-    end
-    
-    def unpack_command
-      cmd = %w(unpack) &lt;&lt; @name
-      cmd &lt;&lt; &quot;--version&quot; &lt;&lt; &quot;#{@requirement.to_s}&quot; if @requirement
-      cmd
-    end
+    private
+      def gem_command
+        RUBY_PLATFORM =~ /win32/ ? 'gem.bat' : 'gem'
+      end
+
+      def install_command
+        cmd = %w(install) &lt;&lt; @name
+        cmd &lt;&lt; &quot;--version&quot; &lt;&lt; %(&quot;#{@requirement.to_s}&quot;) if @requirement
+        cmd &lt;&lt; &quot;--source&quot;  &lt;&lt; @source  if @source
+        cmd
+      end
+
+      def unpack_command
+        cmd = %w(unpack) &lt;&lt; @name
+        cmd &lt;&lt; &quot;--version&quot; &lt;&lt; %(&quot;#{@requirement.to_s}&quot;) if @requirement
+        cmd
+      end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>vendor/rails/railties/lib/rails/gem_dependency.rb</filename>
    </modified>
    <modified>
      <diff>@@ -87,14 +87,14 @@ module Rails
       end
 
       def evaluate_init_rb(initializer)
-         if has_init_file?
-           silence_warnings do
-             # Allow plugins to reference the current configuration object
-             config = initializer.configuration
-             
-             eval(IO.read(init_path), binding, init_path)
-           end
-         end
+        if has_init_file?
+          silence_warnings do
+            # Allow plugins to reference the current configuration object
+            config = initializer.configuration
+            
+            eval(IO.read(init_path), binding, init_path)
+          end
+        end
       end               
   end
 
@@ -103,8 +103,9 @@ module Rails
   # to Dependencies.load_paths.
   class GemPlugin &lt; Plugin
     # Initialize this plugin from a Gem::Specification.
-    def initialize(spec)
-      super(File.join(spec.full_gem_path))
+    def initialize(spec, gem)
+      directory = (gem.frozen? &amp;&amp; gem.unpacked_paths.first) || File.join(spec.full_gem_path)
+      super(directory)
       @name = spec.name
     end
 </diff>
      <filename>vendor/rails/railties/lib/rails/plugin.rb</filename>
    </modified>
    <modified>
      <diff>@@ -45,9 +45,9 @@ module Rails
         plugins.each do |plugin|
           plugin.load_paths.each do |path|
             $LOAD_PATH.insert(application_lib_index + 1, path)
-            Dependencies.load_paths      &lt;&lt; path
+            ActiveSupport::Dependencies.load_paths      &lt;&lt; path
             unless Rails.configuration.reload_plugins?
-              Dependencies.load_once_paths &lt;&lt; path
+              ActiveSupport::Dependencies.load_once_paths &lt;&lt; path
             end
           end
         end</diff>
      <filename>vendor/rails/railties/lib/rails/plugin/loader.rb</filename>
    </modified>
    <modified>
      <diff>@@ -63,7 +63,7 @@ module Rails
         #     =&gt; &lt;Rails::Plugin name: 'acts_as_chunky_bacon' ... &gt;
         #
         def locate_plugins_under(base_path)
-           Dir.glob(File.join(base_path, '*')).inject([]) do |plugins, path|
+           Dir.glob(File.join(base_path, '*')).sort.inject([]) do |plugins, path|
             if plugin = create_plugin(path)
               plugins &lt;&lt; plugin
             elsif File.directory?(path)
@@ -78,8 +78,9 @@ module Rails
     # a &lt;tt&gt;rails/init.rb&lt;/tt&gt; file.
     class GemLocator &lt; Locator
       def plugins
-        specs  = initializer.configuration.gems.map(&amp;:specification)
-        specs += Gem.loaded_specs.values.select do |spec|
+        gem_index = initializer.configuration.gems.inject({}) { |memo, gem| memo.update gem.specification =&gt; gem }
+        specs     = gem_index.keys
+        specs    += Gem.loaded_specs.values.select do |spec|
           spec.loaded_from &amp;&amp; # prune stubs
             File.exist?(File.join(spec.full_gem_path, &quot;rails&quot;, &quot;init.rb&quot;))
         end
@@ -91,7 +92,7 @@ module Rails
         deps.add(*specs) unless specs.empty?
 
         deps.dependency_order.collect do |spec|
-          Rails::GemPlugin.new(spec)
+          Rails::GemPlugin.new(spec, gem_index[spec])
         end
       end
     end</diff>
      <filename>vendor/rails/railties/lib/rails/plugin/locator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ module Rails
   module VERSION #:nodoc:
     MAJOR = 2
     MINOR = 1
-    TINY  = 0
+    TINY  = 1
 
     STRING = [MAJOR, MINOR, TINY].join('.')
   end</diff>
      <filename>vendor/rails/railties/lib/rails/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -57,6 +57,17 @@ module Rails
         end
 
         protected
+          def current_migration_number
+            Dir.glob(&quot;#{RAILS_ROOT}/#{@migration_directory}/[0-9]*_*.rb&quot;).inject(0) do |max, file_path|
+              n = File.basename(file_path).split('_', 2).first.to_i
+              if n &gt; max then n else max end
+            end
+          end
+             
+          def next_migration_number
+            current_migration_number + 1
+          end
+               
           def migration_directory(relative_path)
             directory(@migration_directory = relative_path)
           end
@@ -70,7 +81,11 @@ module Rails
           end
 
           def next_migration_string(padding = 3)
-            Time.now.utc.strftime(&quot;%Y%m%d%H%M%S&quot;)
+            if ActiveRecord::Base.timestamped_migrations
+              Time.now.utc.strftime(&quot;%Y%m%d%H%M%S&quot;)
+            else
+              &quot;%.#{padding}d&quot; % next_migration_number
+            end
           end
 
           def gsub_file(relative_destination, regexp, *args, &amp;block)
@@ -88,7 +103,7 @@ module Rails
                 Tempfile.open(File.basename(destination), File.dirname(dst)) do |temp|
                   temp.write render_file(src, file_options, &amp;block)
                   temp.rewind
-                  $stdout.puts `#{diff_cmd} #{dst} #{temp.path}`
+                  $stdout.puts `#{diff_cmd} &quot;#{dst}&quot; &quot;#{temp.path}&quot;`
                 end
                 puts &quot;retrying&quot;
                 raise 'retry diff'</diff>
      <filename>vendor/rails/railties/lib/rails_generator/commands.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 require 'test_helper'
 
-class &lt;%= class_name %&gt;ObserverTest &lt; Test::Unit::TestCase
+class &lt;%= class_name %&gt;ObserverTest &lt; ActiveSupport::TestCase
   # Replace this with your real tests.
   def test_truth
     assert true</diff>
      <filename>vendor/rails/railties/lib/rails_generator/generators/components/observer/templates/unit_test.rb</filename>
    </modified>
    <modified>
      <filename>vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -108,7 +108,7 @@ module Rails
             sources &lt;&lt; PathSource.new(:vendor, &quot;#{::RAILS_ROOT}/vendor/generators&quot;)
             Rails.configuration.plugin_paths.each do |path|
               relative_path = Pathname.new(File.expand_path(path)).relative_path_from(Pathname.new(::RAILS_ROOT))
-              sources &lt;&lt; PathSource.new(:&quot;plugins (#{relative_path})&quot;, &quot;#{path}/**/{,rails_}generators&quot;)
+              sources &lt;&lt; PathSource.new(:&quot;plugins (#{relative_path})&quot;, &quot;#{path}/*/**/{,rails_}generators&quot;)
             end
           end
           sources &lt;&lt; PathSource.new(:user, &quot;#{Dir.user_home}/.rails/generators&quot;)</diff>
      <filename>vendor/rails/railties/lib/rails_generator/lookup.rb</filename>
    </modified>
    <modified>
      <diff>@@ -215,14 +215,14 @@ namespace :db do
     desc &quot;Create a db/schema.rb file that can be portably used against any DB supported by AR&quot;
     task :dump =&gt; :environment do
       require 'active_record/schema_dumper'
-      File.open(ENV['SCHEMA'] || &quot;db/schema.rb&quot;, &quot;w&quot;) do |file|
+      File.open(ENV['SCHEMA'] || &quot;#{RAILS_ROOT}/db/schema.rb&quot;, &quot;w&quot;) do |file|
         ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, file)
       end
     end
 
     desc &quot;Load a schema.rb file into the database&quot;
     task :load =&gt; :environment do
-      file = ENV['SCHEMA'] || &quot;db/schema.rb&quot;
+      file = ENV['SCHEMA'] || &quot;#{RAILS_ROOT}/db/schema.rb&quot;
       load(file)
     end
   end
@@ -234,7 +234,7 @@ namespace :db do
       case abcs[RAILS_ENV][&quot;adapter&quot;]
       when &quot;mysql&quot;, &quot;oci&quot;, &quot;oracle&quot;
         ActiveRecord::Base.establish_connection(abcs[RAILS_ENV])
-        File.open(&quot;db/#{RAILS_ENV}_structure.sql&quot;, &quot;w+&quot;) { |f| f &lt;&lt; ActiveRecord::Base.connection.structure_dump }
+        File.open(&quot;#{RAILS_ROOT}/db/#{RAILS_ENV}_structure.sql&quot;, &quot;w+&quot;) { |f| f &lt;&lt; ActiveRecord::Base.connection.structure_dump }
       when &quot;postgresql&quot;
         ENV['PGHOST']     = abcs[RAILS_ENV][&quot;host&quot;] if abcs[RAILS_ENV][&quot;host&quot;]
         ENV['PGPORT']     = abcs[RAILS_ENV][&quot;port&quot;].to_s if abcs[RAILS_ENV][&quot;port&quot;]
@@ -252,25 +252,27 @@ namespace :db do
       when &quot;firebird&quot;
         set_firebird_env(abcs[RAILS_ENV])
         db_string = firebird_db_string(abcs[RAILS_ENV])
-        sh &quot;isql -a #{db_string} &gt; db/#{RAILS_ENV}_structure.sql&quot;
+        sh &quot;isql -a #{db_string} &gt; #{RAILS_ROOT}/db/#{RAILS_ENV}_structure.sql&quot;
       else
         raise &quot;Task not supported by '#{abcs[&quot;test&quot;][&quot;adapter&quot;]}'&quot;
       end
 
       if ActiveRecord::Base.connection.supports_migrations?
-        File.open(&quot;db/#{RAILS_ENV}_structure.sql&quot;, &quot;a&quot;) { |f| f &lt;&lt; ActiveRecord::Base.connection.dump_schema_information }
+        File.open(&quot;#{RAILS_ROOT}/db/#{RAILS_ENV}_structure.sql&quot;, &quot;a&quot;) { |f| f &lt;&lt; ActiveRecord::Base.connection.dump_schema_information }
       end
     end
   end
 
   namespace :test do
-    desc &quot;Recreate the test database from the current environment's database schema&quot;
-    task :clone =&gt; %w(db:schema:dump db:test:purge) do
+    desc &quot;Recreate the test database from the current schema.rb&quot;
+    task :load =&gt; 'db:test:purge' do
       ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations['test'])
       ActiveRecord::Schema.verbose = false
       Rake::Task[&quot;db:schema:load&quot;].invoke
     end
 
+    desc &quot;Recreate the test database from the current environment's database schema&quot;
+    task :clone =&gt; %w(db:schema:dump db:test:load)
 
     desc &quot;Recreate the test databases from the development structure&quot;
     task :clone_structure =&gt; [ &quot;db:structure:dump&quot;, &quot;db:test:purge&quot; ] do
@@ -279,28 +281,28 @@ namespace :db do
       when &quot;mysql&quot;
         ActiveRecord::Base.establish_connection(:test)
         ActiveRecord::Base.connection.execute('SET foreign_key_checks = 0')
-        IO.readlines(&quot;db/#{RAILS_ENV}_structure.sql&quot;).join.split(&quot;\n\n&quot;).each do |table|
+        IO.readlines(&quot;#{RAILS_ROOT}/db/#{RAILS_ENV}_structure.sql&quot;).join.split(&quot;\n\n&quot;).each do |table|
           ActiveRecord::Base.connection.execute(table)
         end
       when &quot;postgresql&quot;
         ENV['PGHOST']     = abcs[&quot;test&quot;][&quot;host&quot;] if abcs[&quot;test&quot;][&quot;host&quot;]
         ENV['PGPORT']     = abcs[&quot;test&quot;][&quot;port&quot;].to_s if abcs[&quot;test&quot;][&quot;port&quot;]
         ENV['PGPASSWORD'] = abcs[&quot;test&quot;][&quot;password&quot;].to_s if abcs[&quot;test&quot;][&quot;password&quot;]
-        `psql -U &quot;#{abcs[&quot;test&quot;][&quot;username&quot;]}&quot; -f db/#{RAILS_ENV}_structure.sql #{abcs[&quot;test&quot;][&quot;database&quot;]}`
+        `psql -U &quot;#{abcs[&quot;test&quot;][&quot;username&quot;]}&quot; -f #{RAILS_ROOT}/db/#{RAILS_ENV}_structure.sql #{abcs[&quot;test&quot;][&quot;database&quot;]}`
       when &quot;sqlite&quot;, &quot;sqlite3&quot;
         dbfile = abcs[&quot;test&quot;][&quot;database&quot;] || abcs[&quot;test&quot;][&quot;dbfile&quot;]
-        `#{abcs[&quot;test&quot;][&quot;adapter&quot;]} #{dbfile} &lt; db/#{RAILS_ENV}_structure.sql`
+        `#{abcs[&quot;test&quot;][&quot;adapter&quot;]} #{dbfile} &lt; #{RAILS_ROOT}/db/#{RAILS_ENV}_structure.sql`
       when &quot;sqlserver&quot;
         `osql -E -S #{abcs[&quot;test&quot;][&quot;host&quot;]} -d #{abcs[&quot;test&quot;][&quot;database&quot;]} -i db\\#{RAILS_ENV}_structure.sql`
       when &quot;oci&quot;, &quot;oracle&quot;
         ActiveRecord::Base.establish_connection(:test)
-        IO.readlines(&quot;db/#{RAILS_ENV}_structure.sql&quot;).join.split(&quot;;\n\n&quot;).each do |ddl|
+        IO.readlines(&quot;#{RAILS_ROOT}/db/#{RAILS_ENV}_structure.sql&quot;).join.split(&quot;;\n\n&quot;).each do |ddl|
           ActiveRecord::Base.connection.execute(ddl)
         end
       when &quot;firebird&quot;
         set_firebird_env(abcs[&quot;test&quot;])
         db_string = firebird_db_string(abcs[&quot;test&quot;])
-        sh &quot;isql -i db/#{RAILS_ENV}_structure.sql #{db_string}&quot;
+        sh &quot;isql -i #{RAILS_ROOT}/db/#{RAILS_ENV}_structure.sql #{db_string}&quot;
       else
         raise &quot;Task not supported by '#{abcs[&quot;test&quot;][&quot;adapter&quot;]}'&quot;
       end
@@ -337,10 +339,10 @@ namespace :db do
       end
     end
 
-    desc 'Prepare the test database and load the schema'
-    task :prepare =&gt; %w(environment db:abort_if_pending_migrations) do
+    desc 'Check for pending migrations and load the test schema'
+    task :prepare =&gt; 'db:abort_if_pending_migrations' do
       if defined?(ActiveRecord) &amp;&amp; !ActiveRecord::Base.configurations.blank?
-        Rake::Task[{ :sql  =&gt; &quot;db:test:clone_structure&quot;, :ruby =&gt; &quot;db:test:clone&quot; }[ActiveRecord::Base.schema_format]].invoke
+        Rake::Task[{ :sql  =&gt; &quot;db:test:clone_structure&quot;, :ruby =&gt; &quot;db:test:load&quot; }[ActiveRecord::Base.schema_format]].invoke
       end
     end
   end</diff>
      <filename>vendor/rails/railties/lib/tasks/databases.rake</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,9 @@
 namespace :doc do
-  desc &quot;Generate documentation for the application. Set custom template with TEMPLATE=/path/to/rdoc/template.rb&quot;
+  desc &quot;Generate documentation for the application. Set custom template with TEMPLATE=/path/to/rdoc/template.rb or title with TITLE=\&quot;Custom Title\&quot;&quot;
   Rake::RDocTask.new(&quot;app&quot;) { |rdoc|
     rdoc.rdoc_dir = 'doc/app'
     rdoc.template = ENV['template'] if ENV['template']
-    rdoc.title    = &quot;Rails Application Documentation&quot;
+    rdoc.title    = ENV['title'] || &quot;Rails Application Documentation&quot;
     rdoc.options &lt;&lt; '--line-numbers' &lt;&lt; '--inline-source'
     rdoc.options &lt;&lt; '--charset' &lt;&lt; 'utf-8'
     rdoc.rdoc_files.include('doc/README_FOR_APP')</diff>
      <filename>vendor/rails/railties/lib/tasks/documentation.rake</filename>
    </modified>
    <modified>
      <diff>@@ -44,7 +44,7 @@ namespace :time do
         end
       end
       previous_offset = nil
-      TimeZone.__send__(method).each do |zone|
+      ActiveSupport::TimeZone.__send__(method).each do |zone|
         if offset.nil? || offset == zone.utc_offset
           puts &quot;\n* UTC #{zone.formatted_offset} *&quot; unless zone.utc_offset == previous_offset
           puts zone.name</diff>
      <filename>vendor/rails/railties/lib/tasks/misc.rake</filename>
    </modified>
    <modified>
      <diff>@@ -4,5 +4,5 @@ $VERBOSE = nil
 Dir[&quot;#{File.dirname(__FILE__)}/*.rake&quot;].each { |ext| load ext }
 
 # Load any custom rakefile extensions
-Dir[&quot;#{RAILS_ROOT}/lib/tasks/**/*.rake&quot;].sort.each { |ext| load ext }
 Dir[&quot;#{RAILS_ROOT}/vendor/plugins/*/**/tasks/**/*.rake&quot;].sort.each { |ext| load ext }
+Dir[&quot;#{RAILS_ROOT}/lib/tasks/**/*.rake&quot;].sort.each { |ext| load ext }</diff>
      <filename>vendor/rails/railties/lib/tasks/rails.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>vendor/rails/activerecord/lib/active_record/vendor/db2.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/data_timezone.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/data_timezone_info.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Algiers.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Cairo.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Casablanca.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Harare.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Johannesburg.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Monrovia.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Nairobi.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Argentina/Buenos_Aires.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Argentina/San_Juan.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Bogota.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Caracas.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Chicago.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Chihuahua.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Denver.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Godthab.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Guatemala.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Halifax.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Indiana/Indianapolis.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Juneau.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/La_Paz.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Lima.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Los_Angeles.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Mazatlan.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Mexico_City.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Monterrey.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/New_York.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Phoenix.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Regina.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Santiago.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/St_Johns.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Tijuana.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Almaty.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Baghdad.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Baku.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Bangkok.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Chongqing.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Dhaka.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Hong_Kong.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Irkutsk.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Jakarta.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Jerusalem.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kabul.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kamchatka.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Karachi.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Katmandu.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kolkata.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Krasnoyarsk.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kuala_Lumpur.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kuwait.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Magadan.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Muscat.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Novosibirsk.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Rangoon.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Riyadh.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Seoul.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Shanghai.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Singapore.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Taipei.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tashkent.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tbilisi.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tehran.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tokyo.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Ulaanbaatar.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Urumqi.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Vladivostok.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Yakutsk.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Yekaterinburg.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Yerevan.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Atlantic/Azores.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Atlantic/Cape_Verde.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Atlantic/South_Georgia.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Adelaide.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Brisbane.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Darwin.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Hobart.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Melbourne.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Perth.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Sydney.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Etc/UTC.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Amsterdam.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Athens.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Belgrade.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Berlin.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Bratislava.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Brussels.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Bucharest.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Budapest.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Copenhagen.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Dublin.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Helsinki.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Istanbul.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Kiev.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Lisbon.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Ljubljana.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/London.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Madrid.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Minsk.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Moscow.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Paris.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Prague.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Riga.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Rome.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Sarajevo.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Skopje.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Sofia.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Stockholm.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Tallinn.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Vienna.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Vilnius.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Warsaw.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Zagreb.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Auckland.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Fiji.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Guam.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Honolulu.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Majuro.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Midway.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Noumea.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Pago_Pago.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Port_Moresby.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Tongatapu.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/info_timezone.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/linked_timezone.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/linked_timezone_info.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/offset_rationals.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/time_or_datetime.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_definition.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_info.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_offset_info.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_period.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_transition_info.rb</filename>
    </removed>
    <removed>
      <filename>vendor/rails/railties/doc/README_FOR_APP</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>8982c5e2972d847ad9de1c85fdd237700281a524</id>
    </parent>
  </parents>
  <author>
    <name>Jason Cheow</name>
    <email>jason@jasoncheow.com</email>
  </author>
  <url>http://github.com/xaviershay/enki/commit/76e46a98ba55e416a4badf36c4696ed34a2fdc8d</url>
  <id>76e46a98ba55e416a4badf36c4696ed34a2fdc8d</id>
  <committed-date>2008-10-08T02:05:14-07:00</committed-date>
  <authored-date>2008-10-08T02:05:14-07:00</authored-date>
  <message>Upgrade to Rails 2.1.1.</message>
  <tree>c902a5465a5a9cd04d1f7654271fbdd1d90a8072</tree>
  <committer>
    <name>Jason Cheow</name>
    <email>jason@jasoncheow.com</email>
  </committer>
</commit>
