Permalink
Browse files

Merge commit 'mainstream/master'

  • Loading branch information...
2 parents d2f3bdd + a5cdb7a commit fa09de351c8045c7e7a0f268188ccf80c827b079 @lifo lifo committed Oct 21, 2008
Showing with 744 additions and 330 deletions.
  1. +34 −0 actionpack/CHANGELOG
  2. +45 −16 actionpack/lib/action_controller/base.rb
  3. +0 −26 actionpack/lib/action_controller/caching/fragments.rb
  4. +2 −1 actionpack/lib/action_controller/dispatcher.rb
  5. +12 −2 actionpack/lib/action_controller/request.rb
  6. +2 −2 actionpack/lib/action_controller/response.rb
  7. +0 −16 actionpack/lib/action_view/base.rb
  8. +9 −1 actionpack/test/controller/dispatcher_test.rb
  9. +12 −11 actionpack/test/controller/render_test.rb
  10. +2 −2 activerecord/lib/active_record/associations/association_collection.rb
  11. +8 −2 activerecord/test/cases/associations/has_many_associations_test.rb
  12. +8 −0 activerecord/test/models/company.rb
  13. +4 −0 activesupport/CHANGELOG
  14. +0 −4 activesupport/lib/active_support.rb
  15. +7 −2 activesupport/lib/active_support/cache/compressed_mem_cache_store.rb
  16. +1 −0 activesupport/lib/active_support/cache/file_store.rb
  17. +3 −0 activesupport/lib/active_support/cache/mem_cache_store.rb
  18. +28 −1 activesupport/lib/active_support/core_ext/module/delegation.rb
  19. +2 −2 activesupport/lib/active_support/time_with_zone.rb
  20. +1 −1 activesupport/lib/active_support/values/time_zone.rb
  21. +2 −2 activesupport/lib/active_support/vendor.rb
  22. 0 activesupport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo.rb
  23. +1 −1 activesupport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/data_timezone.rb
  24. +1 −1 activesupport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/data_timezone_info.rb
  25. 0 ...ort/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Africa/Algiers.rb
  26. 0 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Africa/Cairo.rb
  27. +1 −1 .../lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Africa/Casablanca.rb
  28. 0 ...port/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Africa/Harare.rb
  29. 0 ...ib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Africa/Johannesburg.rb
  30. 0 ...rt/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Africa/Monrovia.rb
  31. 0 ...ort/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Africa/Nairobi.rb
  32. +42 −42 ...upport/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Argentina/Buenos_Aires.rb
  33. +42 −42 ...ve_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Argentina/San_Juan.rb
  34. 0 ...ort/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Bogota.rb
  35. 0 ...rt/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Caracas.rb
  36. 0 ...rt/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Chicago.rb
  37. 0 .../lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Chihuahua.rb
  38. 0 ...ort/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Denver.rb
  39. 0 ...rt/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Godthab.rb
  40. 0 .../lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Guatemala.rb
  41. 0 ...rt/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Halifax.rb
  42. 0 ..._support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Indiana/Indianapolis.rb
  43. 0 ...ort/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Juneau.rb
  44. 0 ...ort/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/La_Paz.rb
  45. 0 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Lima.rb
  46. 0 ...ib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Los_Angeles.rb
  47. 0 ...t/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Mazatlan.rb
  48. 0 ...ib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Mexico_City.rb
  49. 0 .../lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Monterrey.rb
  50. 0 ...t/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/New_York.rb
  51. 0 ...rt/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Phoenix.rb
  52. 0 ...ort/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Regina.rb
  53. 0 ...t/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Santiago.rb
  54. +171 −0 activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Sao_Paulo.rb
  55. 0 ...t/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/St_Johns.rb
  56. 0 ...rt/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/America/Tijuana.rb
  57. 0 ...upport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Almaty.rb
  58. 0 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Baghdad.rb
  59. 0 ...esupport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Baku.rb
  60. 0 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Bangkok.rb
  61. 0 ...ort/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Chongqing.rb
  62. 0 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Colombo.rb
  63. 0 ...support/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Dhaka.rb
  64. 0 ...ort/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Hong_Kong.rb
  65. 0 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Irkutsk.rb
  66. 0 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Jakarta.rb
  67. 0 ...ort/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Jerusalem.rb
  68. 0 ...support/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Kabul.rb
  69. 0 ...ort/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Kamchatka.rb
  70. +1 −1 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Karachi.rb
  71. 0 ...port/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Katmandu.rb
  72. 0 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Kolkata.rb
  73. 0 ...t/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Krasnoyarsk.rb
  74. 0 .../lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Kuala_Lumpur.rb
  75. 0 ...upport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Kuwait.rb
  76. 0 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Magadan.rb
  77. 0 ...upport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Muscat.rb
  78. 0 ...t/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Novosibirsk.rb
  79. 0 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Rangoon.rb
  80. 0 ...upport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Riyadh.rb
  81. 0 ...support/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Seoul.rb
  82. 0 ...port/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Shanghai.rb
  83. 0 ...ort/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Singapore.rb
  84. 0 ...upport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Taipei.rb
  85. 0 ...port/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Tashkent.rb
  86. 0 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Tbilisi.rb
  87. 0 ...upport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Tehran.rb
  88. 0 ...support/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Tokyo.rb
  89. 0 ...t/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Ulaanbaatar.rb
  90. 0 ...upport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Urumqi.rb
  91. 0 ...t/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Vladivostok.rb
  92. 0 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Yakutsk.rb
  93. 0 ...lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Yekaterinburg.rb
  94. 0 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Asia/Yerevan.rb
  95. 0 ...rt/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Atlantic/Azores.rb
  96. 0 ...ib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Atlantic/Cape_Verde.rb
  97. 0 ...active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Atlantic/South_Georgia.rb
  98. 0 ...lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Australia/Adelaide.rb
  99. 0 ...lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Australia/Brisbane.rb
  100. 0 ...t/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Australia/Darwin.rb
  101. 0 ...t/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Australia/Hobart.rb
  102. 0 ...ib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Australia/Melbourne.rb
  103. 0 ...rt/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Australia/Perth.rb
  104. 0 ...t/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Australia/Sydney.rb
  105. 0 activesupport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Etc/UTC.rb
  106. 0 ...t/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Amsterdam.rb
  107. 0 ...port/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Athens.rb
  108. 0 ...rt/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Belgrade.rb
  109. +1 −1 ...port/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Berlin.rb
  110. 0 .../lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Bratislava.rb
  111. 0 ...rt/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Brussels.rb
  112. 0 ...t/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Bucharest.rb
  113. 0 ...rt/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Budapest.rb
  114. 0 .../lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Copenhagen.rb
  115. 0 ...port/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Dublin.rb
  116. 0 ...rt/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Helsinki.rb
  117. 0 ...rt/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Istanbul.rb
  118. 0 ...upport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Kiev.rb
  119. 0 ...port/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Lisbon.rb
  120. 0 ...t/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Ljubljana.rb
  121. 0 ...port/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/London.rb
  122. 0 ...port/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Madrid.rb
  123. 0 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Minsk.rb
  124. 0 ...port/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Moscow.rb
  125. 0 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Paris.rb
  126. 0 ...port/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Prague.rb
  127. 0 ...upport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Riga.rb
  128. 0 ...upport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Rome.rb
  129. 0 ...rt/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Sarajevo.rb
  130. 0 ...port/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Skopje.rb
  131. 0 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Sofia.rb
  132. 0 ...t/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Stockholm.rb
  133. 0 ...ort/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Tallinn.rb
  134. 0 ...port/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Vienna.rb
  135. 0 ...ort/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Vilnius.rb
  136. 0 ...port/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Warsaw.rb
  137. 0 ...port/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Europe/Zagreb.rb
  138. 0 ...t/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Pacific/Auckland.rb
  139. 0 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Pacific/Fiji.rb
  140. 0 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Pacific/Guam.rb
  141. 0 ...t/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Pacific/Honolulu.rb
  142. 0 ...ort/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Pacific/Majuro.rb
  143. 0 ...ort/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Pacific/Midway.rb
  144. 0 ...ort/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Pacific/Noumea.rb
  145. 0 .../lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Pacific/Pago_Pago.rb
  146. 0 ...b/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Pacific/Port_Moresby.rb
  147. 0 .../lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/definitions/Pacific/Tongatapu.rb
  148. 0 activesupport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/info_timezone.rb
  149. +1 −1 activesupport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/linked_timezone.rb
  150. 0 ...vesupport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/linked_timezone_info.rb
  151. +98 −0 activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/offset_rationals.rb
  152. +56 −0 activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/ruby_core_support.rb
  153. 0 activesupport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/time_or_datetime.rb
  154. +1 −1 activesupport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/timezone.rb
  155. 0 activesupport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/timezone_definition.rb
  156. 0 activesupport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/timezone_info.rb
  157. 0 ...vesupport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/timezone_offset_info.rb
  158. 0 activesupport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/timezone_period.rb
  159. +3 −12 ...pport/lib/active_support/vendor/{tzinfo-0.3.9 → tzinfo-0.3.11}/tzinfo/timezone_transition_info.rb
  160. +0 −95 activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/offset_rationals.rb
  161. +11 −1 activesupport/test/abstract_unit.rb
  162. +66 −22 activesupport/test/caching_test.rb
  163. +2 −2 activesupport/test/core_ext/duration_test.rb
  164. +26 −5 activesupport/test/core_ext/module_test.rb
  165. +13 −0 activesupport/test/core_ext/time_with_zone_test.rb
  166. +0 −1 activesupport/test/dependencies_test.rb
  167. +3 −0 railties/configs/databases/mysql.yml
  168. +3 −0 railties/configs/databases/postgresql.yml
  169. +3 −0 railties/configs/databases/sqlite2.yml
  170. +3 −0 railties/configs/databases/sqlite3.yml
  171. +2 −1 railties/helpers/performance_test.rb
  172. +0 −2 railties/helpers/performance_test_helper.rb
  173. +4 −2 railties/lib/initializer.rb
  174. +1 −1 railties/lib/rails/gem_dependency.rb
  175. +0 −1 railties/lib/rails_generator/generators/applications/app/app_generator.rb
  176. +2 −1 railties/lib/rails_generator/generators/components/performance_test/templates/performance_test.rb
  177. +2 −1 railties/lib/rails_generator/lookup.rb
  178. +2 −1 railties/lib/tasks/gems.rake
View
@@ -1,5 +1,39 @@
*Edge*
+* Added stale? and fresh_when methods to provide a layer of abstraction above request.fresh? and friends [DHH]. Example:
+
+ class ArticlesController < ApplicationController
+ def show_with_respond_to_block
+ @article = Article.find(params[:id])
+
+
+ # If the request sends headers that differs from the options provided to stale?, then
+ # the request is indeed stale and the respond_to block is triggered (and the options
+ # to the stale? call is set on the response).
+ #
+ # If the request headers match, then the request is fresh and the respond_to block is
+ # not triggered. Instead the default render will occur, which will check the last-modified
+ # and etag headers and conclude that it only needs to send a "304 Not Modified" instead
+ # of rendering the template.
+ if stale?(:last_modified => @article.published_at.utc, :etag => @article)
+ respond_to do |wants|
+ # normal response processing
+ end
+ end
+ end
+
+ def show_with_implied_render
+ @article = Article.find(params[:id])
+
+ # Sets the response headers and checks them against the request, if the request is stale
+ # (i.e. no match of either etag or last-modified), then the default render of the template happens.
+ # If the request is fresh, then the default render will return a "304 Not Modified"
+ # instead of rendering the template.
+ fresh_when(:last_modified => @article.published_at.utc, :etag => @article)
+ end
+ end
+
+
* Added inline builder yield to atom_feed_helper tags where appropriate [Sam Ruby]. Example:
entry.summary :type => 'xhtml' do |xhtml|
@@ -965,22 +965,6 @@ def head(*args)
render :nothing => true, :status => status
end
- # Sets the Last-Modified response header. Returns 304 Not Modified if the
- # If-Modified-Since request header is <= last modified.
- def last_modified!(utc_time)
- response.last_modified= utc_time
- if request.if_modified_since && request.if_modified_since <= utc_time
- head(:not_modified)
- end
- end
-
- # Sets the ETag response header. Returns 304 Not Modified if the
- # If-None-Match request header matches.
- def etag!(etag)
- response.etag = etag
- head(:not_modified) if response.etag == request.if_none_match
- end
-
# Clears the rendered results, allowing for another render to be performed.
def erase_render_results #:nodoc:
response.body = nil
@@ -1090,6 +1074,51 @@ def redirect_to_full_url(url, status)
@performed_redirect = true
end
+ # Sets the etag and/or last_modified on the response and checks it against
+ # the client request. If the request doesn't match the options provided, the
+ # request is considered stale and should be generated from scratch. Otherwise,
+ # it's fresh and we don't need to generate anything and a reply of "304 Not Modified" is sent.
+ #
+ # Example:
+ #
+ # def show
+ # @article = Article.find(params[:id])
+ #
+ # if stale?(:etag => @article, :last_modified => @article.created_at.utc)
+ # @statistics = @article.really_expensive_call
+ # respond_to do |format|
+ # # all the supported formats
+ # end
+ # end
+ # end
+ def stale?(options)
+ fresh_when(options)
+ !request.fresh?(response)
+ end
+
+ # Sets the etag, last_modified, or both on the response and renders a
+ # "304 Not Modified" response if the request is already fresh.
+ #
+ # Example:
+ #
+ # def show
+ # @article = Article.find(params[:id])
+ # fresh_when(:etag => @article, :last_modified => @article.created_at.utc)
+ # end
+ #
+ # This will render the show template if the request isn't sending a matching etag or
+ # If-Modified-Since header and just a "304 Not Modified" response if there's a match.
+ def fresh_when(options)
+ options.assert_valid_keys(:etag, :last_modified)
+
+ response.etag = options[:etag] if options[:etag]
+ response.last_modified = options[:last_modified] if options[:last_modified]
+
+ if request.fresh?(response)
+ head :not_modified
+ end
+ end
+
# Sets a HTTP 1.1 Cache-Control header. Defaults to issuing a "private" instruction, so that
# intermediate caches shouldn't cache the response.
#
@@ -26,32 +26,6 @@ module Caching
#
# expire_fragment(:controller => "topics", :action => "list", :action_suffix => "all_topics")
module Fragments
- def self.included(base) #:nodoc:
- base.class_eval do
- class << self
- def fragment_cache_store=(store_option) #:nodoc:
- ActiveSupport::Deprecation.warn('The fragment_cache_store= method is now use cache_store=')
- self.cache_store = store_option
- end
-
- def fragment_cache_store #:nodoc:
- ActiveSupport::Deprecation.warn('The fragment_cache_store method is now use cache_store')
- cache_store
- end
- end
-
- def fragment_cache_store=(store_option) #:nodoc:
- ActiveSupport::Deprecation.warn('The fragment_cache_store= method is now use cache_store=')
- self.cache_store = store_option
- end
-
- def fragment_cache_store #:nodoc:
- ActiveSupport::Deprecation.warn('The fragment_cache_store method is now use cache_store')
- cache_store
- end
- end
- end
-
# Given a key (as described in <tt>expire_fragment</tt>), returns a key suitable for use in reading,
# writing, or expiring a cached fragment. If the key is a hash, the generated key is the return
# value of url_for on that hash (without the protocol). All keys are prefixed with "views/" and uses
@@ -39,7 +39,7 @@ def dispatch(cgi = nil, session_options = CgiRequest::DEFAULT_SESSION_OPTIONS, o
# Add a preparation callback. Preparation callbacks are run before every
# request in development mode, and before the first request in production
# mode.
- #
+ #
# An optional identifier may be supplied for the callback. If provided,
# to_prepare may be called again with the same identifier to replace the
# existing callback. Passing an identifier is a suggested practice if the
@@ -144,6 +144,7 @@ def reload_application
Routing::Routes.reload
ActionController::Base.view_paths.reload!
+ ActionView::Helpers::AssetTagHelper::AssetTag::Cache.clear
end
# Cleanup the application by clearing out loaded classes so they can
@@ -120,9 +120,19 @@ def etag_matches?(etag)
end
# Check response freshness (Last-Modified and ETag) against request
- # If-Modified-Since and If-None-Match conditions.
+ # If-Modified-Since and If-None-Match conditions. If both headers are
+ # supplied, both must match, or the request is not considered fresh.
def fresh?(response)
- not_modified?(response.last_modified) || etag_matches?(response.etag)
+ case
+ when if_modified_since && if_none_match
+ not_modified?(response.last_modified) && etag_matches?(response.etag)
+ when if_modified_since
+ not_modified?(response.last_modified)
+ when if_none_match
+ etag_matches?(response.etag)
+ else
+ false
+ end
end
# Returns the Mime type for the \format used in the request.
@@ -114,8 +114,8 @@ def etag=(etag)
def redirect(url, status)
self.status = status
- self.location = url
- self.body = "<html><body>You are being <a href=\"#{url}\">redirected</a>.</body></html>"
+ self.location = url.gsub(/[\r\n]/, '')
+ self.body = "<html><body>You are being <a href=\"#{CGI.escapeHTML(url)}\">redirected</a>.</body></html>"
end
def sending_file?
@@ -172,18 +172,6 @@ class << self
delegate :logger, :to => 'ActionController::Base'
end
- def self.cache_template_loading=(*args)
- ActiveSupport::Deprecation.warn(
- "config.action_view.cache_template_loading option has been deprecated" +
- "and has no effect. Please remove it from your config files.", caller)
- end
-
- def self.cache_template_extensions=(*args)
- ActiveSupport::Deprecation.warn(
- "config.action_view.cache_template_extensions option has been" +
- "deprecated and has no effect. Please remove it from your config files.", caller)
- end
-
# Templates that are exempt from layouts
@@exempt_from_layout = Set.new([/\.rjs$/])
@@ -259,10 +247,6 @@ def render(options = {}, local_assigns = {}, &block) #:nodoc:
if options[:layout]
_render_with_layout(options, local_assigns, &block)
elsif options[:file]
- if options[:use_full_path]
- ActiveSupport::Deprecation.warn("use_full_path option has been deprecated and has no affect.", caller)
- end
-
_pick_template(options[:file]).render_template(self, options[:locals])
elsif options[:partial]
render_partial(options)
@@ -26,9 +26,17 @@ def teardown
end
def test_clears_dependencies_after_dispatch_if_in_loading_mode
- ActionController::Routing::Routes.expects(:reload).once
ActiveSupport::Dependencies.expects(:clear).once
+ dispatch(@output, false)
+ end
+
+ def test_reloads_routes_before_dispatch_if_in_loading_mode
+ ActionController::Routing::Routes.expects(:reload).once
+ dispatch(@output, false)
+ end
+ def test_clears_asset_tag_cache_before_dispatch_if_in_loading_mode
+ ActionView::Helpers::AssetTagHelper::AssetTag::Cache.expects(:clear).once
dispatch(@output, false)
end
@@ -30,24 +30,18 @@ def hello_world
end
def conditional_hello
- response.last_modified = Time.now.utc.beginning_of_day
- response.etag = [:foo, 123]
-
- if request.fresh?(response)
- head :not_modified
- else
+ if stale?(:last_modified => Time.now.utc.beginning_of_day, :etag => [:foo, 123])
render :action => 'hello_world'
end
end
-
+
def conditional_hello_with_bangs
render :action => 'hello_world'
end
before_filter :handle_last_modified_and_etags, :only=>:conditional_hello_with_bangs
def handle_last_modified_and_etags
- last_modified! Time.now.utc.beginning_of_day
- etag! [:foo, 123]
+ fresh_when(:last_modified => Time.now.utc.beginning_of_day, :etag => [ :foo, 123 ])
end
def render_hello_world
@@ -248,7 +242,7 @@ def default_render
if @alternate_default_render
@alternate_default_render.call
else
- render
+ super
end
end
@@ -1422,6 +1416,13 @@ def test_request_not_modified
assert_equal @last_modified, @response.headers['Last-Modified']
end
+ def test_request_not_modified_but_etag_differs
+ @request.if_modified_since = @last_modified
+ @request.if_none_match = "234"
+ get :conditional_hello
+ assert_response :success
+ end
+
def test_request_modified
@request.if_modified_since = 'Thu, 16 Jul 2008 00:00:00 GMT'
get :conditional_hello
@@ -1445,7 +1446,7 @@ def test_request_with_bang_obeys_last_modified
def test_last_modified_works_with_less_than_too
@request.if_modified_since = 5.years.ago.httpdate
get :conditional_hello_with_bangs
- assert_response :not_modified
+ assert_response :success
end
end
@@ -326,8 +326,8 @@ def include?(record)
exists?(record)
end
- def proxy_respond_to?(method)
- super || @reflection.klass.respond_to?(method)
+ def proxy_respond_to?(method, include_private = false)
+ super || @reflection.klass.respond_to?(method, include_private)
end
protected
@@ -1081,8 +1081,14 @@ def test_association_proxy_transaction_method_starts_transaction_in_association_
end
def test_sending_new_to_association_proxy_should_have_same_effect_as_calling_new
- clients_assoc = companies(:first_firm).clients
- assert_equal clients_assoc.new.attributes, clients_assoc.send(:new).attributes
+ client_association = companies(:first_firm).clients
+ assert_equal client_association.new.attributes, client_association.send(:new).attributes
+ end
+
+ def test_respond_to_private_class_methods
+ client_association = companies(:first_firm).clients
+ assert !client_association.respond_to?(:private_method)
+ assert client_association.respond_to?(:private_method, true)
end
end
@@ -112,6 +112,14 @@ def ruby_type
def rating?
query_attribute :rating
end
+
+ class << self
+ private
+
+ def private_method
+ "darkness"
+ end
+ end
end
View
@@ -1,5 +1,9 @@
*Edge*
+* TimeWithZone#freeze: preload instance variables so that we can actually freeze [Geoff Buesing]
+
+* Fix Brasilia timezone #1180 [Marcus Derencius, Kane]
+
* Time#advance recognizes fractional days and weeks. Deprecate Durations of fractional months and years #970 [Tom Lea]
* Add ActiveSupport::Rescuable module abstracting ActionController::Base rescue_from features. [Norbert Crombach, Pratik]
@@ -59,7 +59,3 @@
require 'active_support/rescuable'
I18n.load_path << File.dirname(__FILE__) + '/active_support/locale/en-US.yml'
-
-Inflector = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Inflector', 'ActiveSupport::Inflector')
-Dependencies = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Dependencies', 'ActiveSupport::Dependencies')
-TimeZone = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('TimeZone', 'ActiveSupport::TimeZone')
@@ -3,12 +3,17 @@ module Cache
class CompressedMemCacheStore < MemCacheStore
def read(name, options = nil)
if value = super(name, (options || {}).merge(:raw => true))
- Marshal.load(ActiveSupport::Gzip.decompress(value))
+ if raw?(options)
+ value
+ else
+ Marshal.load(ActiveSupport::Gzip.decompress(value))
+ end
end
end
def write(name, value, options = nil)
- super(name, ActiveSupport::Gzip.compress(Marshal.dump(value)), (options || {}).merge(:raw => true))
+ value = ActiveSupport::Gzip.compress(Marshal.dump(value)) unless raw?(options)
+ super(name, value, (options || {}).merge(:raw => true))
end
end
end
@@ -16,6 +16,7 @@ def write(name, value, options = nil)
super
ensure_cache_path(File.dirname(real_file_path(name)))
File.atomic_write(real_file_path(name), cache_path) { |f| Marshal.dump(value, f) }
+ value
rescue => e
logger.error "Couldn't create cache directory: #{name} (#{e.message})" if logger
end
Oops, something went wrong.

0 comments on commit fa09de3

Please sign in to comment.