radiant 0.9.0.rc2 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of radiant might be problematic. Click here for more details.

Files changed (946) hide show
  1. data/CHANGELOG +18 -6
  2. data/CONTRIBUTORS +7 -1
  3. data/INSTALL +0 -5
  4. data/README +21 -0
  5. data/app/controllers/admin/layouts_controller.rb +1 -0
  6. data/app/controllers/admin/preferences_controller.rb +4 -3
  7. data/app/controllers/admin/resource_controller.rb +62 -8
  8. data/app/controllers/admin/snippets_controller.rb +1 -0
  9. data/app/controllers/admin/users_controller.rb +1 -0
  10. data/app/controllers/application_controller.rb +0 -17
  11. data/app/controllers/site_controller.rb +6 -4
  12. data/app/helpers/application_helper.rb +19 -0
  13. data/app/models/standard_tags.rb +212 -18
  14. data/app/models/status.rb +1 -1
  15. data/app/models/user.rb +2 -2
  16. data/app/views/admin/extensions/index.html.haml +1 -1
  17. data/app/views/admin/layouts/_form.html.haml +4 -4
  18. data/app/views/admin/layouts/index.html.haml +2 -2
  19. data/app/views/admin/page_parts/_page_part.html.haml +2 -2
  20. data/app/views/admin/pages/_fields.html.haml +5 -5
  21. data/app/views/admin/preferences/edit.html.haml +3 -3
  22. data/app/views/admin/snippets/_form.html.haml +5 -5
  23. data/app/views/admin/snippets/index.html.haml +3 -3
  24. data/app/views/admin/users/_form.html.haml +3 -4
  25. data/app/views/admin/users/index.html.haml +2 -1
  26. data/app/views/layouts/application.html.haml +1 -1
  27. data/config/environment.rb +2 -2
  28. data/config/environments/cucumber.rb +3 -3
  29. data/config/locales/en.yml +10 -10
  30. data/config/locales/en_available_tags.yml +80 -1
  31. data/db/migrate/20081203140407_add_indexes.rb +10 -10
  32. data/db/schema.rb +1 -1
  33. data/features/admin/resource_pagination.feature +27 -0
  34. data/features/admin/user_preferences.feature +17 -0
  35. data/features/step_definitions/admin/pagination_steps.rb +46 -0
  36. data/features/step_definitions/web_steps.rb +13 -3
  37. data/features/support/env.rb +7 -3
  38. data/features/support/paths.rb +1 -1
  39. data/lib/generators/instance/templates/instance_environment.rb +2 -2
  40. data/lib/generators/language_extension/templates/lang.yml +6 -6
  41. data/lib/plugins/active_record_extensions/lib/active_record_extensions.rb +0 -29
  42. data/lib/radiant.rb +3 -3
  43. data/lib/radiant/admin_ui.rb +1 -1
  44. data/lib/radiant/extension/script.rb +20 -5
  45. data/lib/radiant/extension_loader.rb +1 -1
  46. data/lib/radiant/initializer.rb +9 -3
  47. data/lib/radiant/pagination/controller.rb +34 -0
  48. data/lib/radiant/pagination/link_renderer.rb +7 -4
  49. data/lib/task_support.rb +6 -1
  50. data/lib/tasks/cucumber.rake +1 -1
  51. data/lib/tasks/framework.rake +1 -2
  52. data/lib/tasks/release.rake +11 -3
  53. data/lib/tasks/rspec.rake +1 -1
  54. data/public/images/admin/shadow.png +0 -0
  55. data/public/images/admin/shadow_grey.png +0 -0
  56. data/public/javascripts/admin/application.js +4 -1
  57. data/public/javascripts/admin/cookie.js +2 -2
  58. data/public/javascripts/admin/validationerror.js +18 -0
  59. data/public/stylesheets/admin/main.css +110 -37
  60. data/public/stylesheets/sass/admin/main.sass +3 -2
  61. data/public/stylesheets/sass/admin/modules/_grid.sass +56 -0
  62. data/public/stylesheets/sass/admin/partials/_actions.sass +74 -34
  63. data/public/stylesheets/sass/admin/partials/{_depreciated.sass → _deprecated.sass} +1 -1
  64. data/public/stylesheets/sass/admin/partials/_popup.sass +1 -1
  65. data/public/stylesheets/sass/admin/partials/_validations.sass +21 -0
  66. data/spec/controllers/admin/paginated_controller_spec.rb +26 -0
  67. data/spec/controllers/admin/preferences_controller_spec.rb +14 -0
  68. data/spec/controllers/application_controller_spec.rb +1 -11
  69. data/spec/controllers/site_controller_spec.rb +9 -0
  70. data/spec/datasets/users_dataset.rb +1 -1
  71. data/spec/generators/instance_generator_spec.rb +1 -1
  72. data/spec/helpers/application_helper_spec.rb +38 -0
  73. data/spec/lib/radiant/extension/script_spec.rb +5 -1
  74. data/spec/lib/radiant/initializer_spec.rb +7 -0
  75. data/spec/lib/radiant_spec.rb +1 -1
  76. data/spec/lib/task_support_spec.rb +14 -0
  77. data/spec/matchers/render_matcher.rb +14 -1
  78. data/spec/models/layout_spec.rb +3 -3
  79. data/spec/models/page_part_spec.rb +3 -3
  80. data/spec/models/page_spec.rb +8 -9
  81. data/spec/models/snippet_spec.rb +3 -3
  82. data/spec/models/standard_tags_spec.rb +99 -5
  83. data/spec/models/user_spec.rb +11 -11
  84. data/vendor/extensions/archive/app/models/archive_finder.rb +5 -0
  85. data/vendor/extensions/french_language_pack/config/locales/fr.yml +31 -25
  86. data/vendor/extensions/german_language_pack/README +2 -1
  87. data/vendor/extensions/german_language_pack/config/locales/de.yml +47 -45
  88. data/vendor/extensions/german_language_pack/config/locales/de_available_tags.yml +375 -304
  89. data/vendor/extensions/german_language_pack/german_language_pack_extension.rb +2 -2
  90. data/vendor/extensions/markdown_filter/README +1 -1
  91. data/vendor/extensions/markdown_filter/lib/markdown_filter.rb +4 -4
  92. data/vendor/extensions/markdown_filter/lib/markdown_tags.rb +0 -15
  93. data/vendor/extensions/markdown_filter/markdown_filter_extension.rb +1 -10
  94. data/vendor/extensions/markdown_filter/spec/models/markdown_filter_spec.rb +1 -1
  95. data/vendor/extensions/markdown_filter/vendor/kramdown/CONTRIBUTERS +4 -0
  96. data/vendor/extensions/markdown_filter/vendor/kramdown/ChangeLog +1332 -0
  97. data/vendor/extensions/markdown_filter/vendor/kramdown/README +10 -0
  98. data/vendor/extensions/markdown_filter/vendor/kramdown/Rakefile +97 -38
  99. data/vendor/extensions/markdown_filter/vendor/kramdown/VERSION +1 -1
  100. data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/generate_data.rb +6 -4
  101. data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-jruby-1.4.0.dat +7 -7
  102. data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-ruby-1.8.6.dat +7 -7
  103. data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-ruby-1.8.7.dat +7 -7
  104. data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-ruby-1.9.1p243.dat +7 -7
  105. data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-ruby-1.9.2dev.dat +7 -7
  106. data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/testing.sh +1 -1
  107. data/vendor/extensions/markdown_filter/vendor/kramdown/bin/kramdown +11 -4
  108. data/vendor/extensions/markdown_filter/vendor/kramdown/data/kramdown/document.html +9 -0
  109. data/vendor/extensions/markdown_filter/vendor/kramdown/data/kramdown/document.latex +43 -0
  110. data/vendor/extensions/markdown_filter/vendor/kramdown/doc/default.less.css +510 -0
  111. data/vendor/extensions/markdown_filter/vendor/kramdown/doc/default.template +26 -33
  112. data/vendor/extensions/markdown_filter/vendor/kramdown/doc/documentation.page +72 -0
  113. data/vendor/extensions/markdown_filter/vendor/kramdown/doc/index.page +21 -49
  114. data/vendor/extensions/markdown_filter/vendor/kramdown/doc/installation.page +6 -6
  115. data/vendor/extensions/markdown_filter/vendor/kramdown/doc/links.markdown +6 -0
  116. data/vendor/extensions/markdown_filter/vendor/kramdown/doc/news.page +3 -2
  117. data/vendor/extensions/markdown_filter/vendor/kramdown/doc/quickref.page +140 -127
  118. data/vendor/extensions/markdown_filter/vendor/kramdown/doc/syntax.page +501 -431
  119. data/vendor/extensions/markdown_filter/vendor/kramdown/doc/tests.page +3 -3
  120. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown.rb +1 -1
  121. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/compatibility.rb +1 -1
  122. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/converter.rb +8 -3
  123. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/converter/base.rb +40 -4
  124. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/converter/html.rb +99 -27
  125. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/converter/latex.rb +57 -18
  126. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/document.rb +32 -13
  127. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/error.rb +1 -1
  128. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/options.rb +34 -14
  129. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser.rb +9 -3
  130. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/base.rb +95 -0
  131. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/html.rb +387 -0
  132. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown.rb +74 -65
  133. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/abbreviation.rb +65 -0
  134. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/attribute_list.rb +3 -2
  135. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/autolink.rb +8 -3
  136. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/blank_line.rb +2 -2
  137. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/blockquote.rb +2 -2
  138. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/codeblock.rb +3 -3
  139. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/codespan.rb +1 -1
  140. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/emphasis.rb +4 -3
  141. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/eob.rb +2 -2
  142. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/escaped_chars.rb +2 -2
  143. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/extension.rb +47 -55
  144. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/footnote.rb +1 -1
  145. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/header.rb +3 -18
  146. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/horizontal_rule.rb +2 -2
  147. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/html.rb +69 -149
  148. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/html_entity.rb +4 -4
  149. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/line_break.rb +1 -1
  150. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/link.rb +2 -2
  151. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/list.rb +12 -9
  152. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/math.rb +53 -0
  153. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/paragraph.rb +2 -2
  154. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/smart_quotes.rb +5 -4
  155. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/table.rb +4 -3
  156. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/typographic_symbol.rb +7 -3
  157. data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/version.rb +2 -2
  158. data/vendor/extensions/markdown_filter/vendor/kramdown/man/man1/kramdown.1 +222 -0
  159. data/vendor/extensions/markdown_filter/vendor/kramdown/test/run_tests.rb +1 -0
  160. data/vendor/extensions/markdown_filter/vendor/kramdown/test/test_files.rb +68 -7
  161. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/with_auto_id_prefix.html +3 -0
  162. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/with_auto_id_prefix.options +2 -0
  163. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/with_auto_id_prefix.text +3 -0
  164. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/item_ial.html +9 -0
  165. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/item_ial.text +5 -0
  166. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/mixed.html +9 -3
  167. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/special_cases.html +49 -0
  168. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/special_cases.text +29 -0
  169. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/comment.html +5 -0
  170. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/comment.text +3 -0
  171. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/content_model/tables.html +2 -2
  172. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/code.html +10 -0
  173. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/code.text +9 -0
  174. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/comment.html +7 -0
  175. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/comment.text +8 -0
  176. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/emphasis.html +1 -0
  177. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/emphasis.text +1 -0
  178. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/entity.html +1 -0
  179. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/entity.text +1 -0
  180. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/header.html +6 -0
  181. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/header.options +2 -0
  182. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/header.text +6 -0
  183. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/list_dl.html +8 -0
  184. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/list_dl.text +8 -0
  185. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/list_ol.html +15 -0
  186. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/list_ol.text +17 -0
  187. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/list_ul.html +19 -0
  188. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/list_ul.text +22 -0
  189. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/options +1 -0
  190. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/paragraph.html +3 -0
  191. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/paragraph.text +4 -0
  192. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/table_normal.html +13 -0
  193. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/table_normal.text +12 -0
  194. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/table_simple.html +10 -0
  195. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/table_simple.text +14 -0
  196. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/typography.html +1 -0
  197. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/typography.text +1 -0
  198. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_as_raw.html +3 -5
  199. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_as_raw.text +0 -1
  200. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/11_ial/auto_id_and_ial.html +1 -1
  201. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/11_ial/auto_id_and_ial.text +1 -1
  202. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/11_ial/simple.html +5 -0
  203. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/11_ial/simple.text +7 -0
  204. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/comment.text +5 -5
  205. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/ignored.html +0 -2
  206. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/ignored.text +3 -6
  207. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/nomarkdown.text +4 -4
  208. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options.html +1 -1
  209. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options.text +5 -6
  210. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options2.text +1 -1
  211. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options3.text +1 -1
  212. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/15_math/normal.html +19 -0
  213. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/15_math/normal.text +18 -0
  214. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/errors.html +1 -1
  215. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/nesting.html +4 -0
  216. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/nesting.text +3 -0
  217. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/definitions.latex +18 -0
  218. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/footnote_nr.latex +6 -0
  219. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/markers.latex +32 -0
  220. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/invalid.html +1 -0
  221. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/invalid.text +1 -0
  222. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/abbreviations/abbrev.html +8 -0
  223. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/abbreviations/abbrev.text +15 -0
  224. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/abbreviations/abbrev_defs.html +2 -0
  225. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/abbreviations/abbrev_defs.text +5 -0
  226. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/autolinks/url_links.html +3 -0
  227. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/autolinks/url_links.text +3 -0
  228. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/comment.html +6 -0
  229. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/comment.text +6 -0
  230. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/ignored.html +1 -0
  231. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/ignored.text +1 -0
  232. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/nomarkdown.html +1 -0
  233. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/nomarkdown.text +1 -0
  234. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/options.html +1 -0
  235. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/options.text +1 -0
  236. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/ial/simple.html +2 -1
  237. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/ial/simple.text +1 -0
  238. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/math/normal.html +5 -0
  239. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/math/normal.text +5 -0
  240. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/typography.html +3 -0
  241. data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/typography.text +3 -0
  242. data/vendor/extensions/smarty_pants_filter/README +1 -0
  243. data/vendor/extensions/smarty_pants_filter/Rakefile +136 -0
  244. data/vendor/extensions/{markdown_filter → smarty_pants_filter}/lib/smarty_pants_filter.rb +0 -0
  245. data/vendor/extensions/smarty_pants_filter/lib/smarty_pants_tags.rb +18 -0
  246. data/vendor/extensions/smarty_pants_filter/lib/tasks/smarty_pants_filter_extension_tasks.rake +28 -0
  247. data/vendor/extensions/smarty_pants_filter/smarty_pants_filter_extension.rb +18 -0
  248. data/vendor/extensions/{markdown_filter → smarty_pants_filter}/smartypants.html +0 -0
  249. data/vendor/extensions/{markdown_filter → smarty_pants_filter}/spec/models/smarty_pants_filter_spec.rb +0 -0
  250. data/vendor/extensions/smarty_pants_filter/spec/spec.opts +6 -0
  251. data/vendor/extensions/smarty_pants_filter/spec/spec_helper.rb +36 -0
  252. data/vendor/extensions/smarty_pants_filter/test/test_helper.rb +19 -0
  253. data/vendor/extensions/{markdown_filter → smarty_pants_filter}/test/unit/smarty_pants_filter_test.rb +0 -0
  254. data/vendor/extensions/{markdown_filter → smarty_pants_filter}/vendor/rubypants/README +0 -0
  255. data/vendor/extensions/{markdown_filter → smarty_pants_filter}/vendor/rubypants/Rakefile +0 -0
  256. data/vendor/extensions/{markdown_filter → smarty_pants_filter}/vendor/rubypants/install.rb +0 -0
  257. data/vendor/extensions/{markdown_filter → smarty_pants_filter}/vendor/rubypants/rubypants.rb +0 -0
  258. data/vendor/extensions/{markdown_filter → smarty_pants_filter}/vendor/rubypants/test_rubypants.rb +0 -0
  259. data/vendor/plugins/haml/Rakefile +84 -52
  260. data/vendor/plugins/haml/VERSION +1 -1
  261. data/vendor/plugins/haml/doc-src/HAML_CHANGELOG.md +77 -0
  262. data/vendor/plugins/haml/doc-src/SASS_CHANGELOG.md +60 -0
  263. data/vendor/plugins/haml/extra/haml-mode.el +15 -12
  264. data/vendor/plugins/haml/extra/sass-mode.el +2 -2
  265. data/vendor/plugins/haml/haml.gemspec +16 -7
  266. data/vendor/plugins/haml/init.rb +3 -1
  267. data/vendor/plugins/haml/lib/haml.rb +1 -0
  268. data/vendor/plugins/haml/lib/haml/filters.rb +14 -2
  269. data/vendor/plugins/haml/lib/haml/helpers.rb +34 -14
  270. data/vendor/plugins/haml/lib/haml/helpers/action_view_extensions.rb +6 -4
  271. data/vendor/plugins/haml/lib/haml/helpers/action_view_mods.rb +74 -34
  272. data/vendor/plugins/haml/lib/haml/helpers/xss_mods.rb +37 -8
  273. data/vendor/plugins/haml/lib/haml/html.rb +1 -1
  274. data/vendor/plugins/haml/lib/haml/precompiler.rb +3 -2
  275. data/vendor/plugins/haml/lib/haml/railtie.rb +18 -0
  276. data/vendor/plugins/haml/lib/haml/template.rb +15 -4
  277. data/vendor/plugins/haml/lib/haml/template/plugin.rb +37 -2
  278. data/vendor/plugins/haml/lib/haml/util.rb +56 -2
  279. data/vendor/plugins/haml/lib/haml/version.rb +29 -14
  280. data/vendor/plugins/haml/lib/sass/files.rb +10 -2
  281. data/vendor/plugins/haml/lib/sass/plugin.rb +7 -2
  282. data/vendor/plugins/haml/lib/sass/plugin/rack.rb +2 -2
  283. data/vendor/plugins/haml/lib/sass/plugin/rails.rb +2 -1
  284. data/vendor/plugins/haml/lib/sass/script/number.rb +2 -2
  285. data/vendor/plugins/haml/lib/sass/tree/if_node.rb +1 -0
  286. data/vendor/plugins/haml/lib/sass/tree/rule_node.rb +9 -1
  287. data/vendor/plugins/haml/test/haml/engine_test.rb +24 -2
  288. data/vendor/plugins/haml/test/haml/helper_test.rb +60 -9
  289. data/vendor/plugins/haml/test/haml/template_test.rb +80 -3
  290. data/vendor/plugins/haml/test/haml/templates/helpers.haml +26 -0
  291. data/vendor/plugins/haml/test/haml/templates/partial_layout.haml +6 -2
  292. data/vendor/plugins/haml/test/sass/engine_test.rb +6 -1
  293. data/vendor/plugins/haml/test/test_helper.rb +16 -1
  294. data/vendor/radius/LICENSE +19 -0
  295. data/vendor/radius/QUICKSTART.rdoc +7 -7
  296. data/vendor/radius/README.rdoc +9 -25
  297. data/vendor/radius/Rakefile +4 -27
  298. data/vendor/radius/VERSION +1 -0
  299. data/vendor/radius/lib/radius/parser.rb +4 -4
  300. data/vendor/radius/lib/radius/parser/scan.rb +371 -940
  301. data/vendor/radius/lib/radius/parser/scan.rl +2 -1
  302. data/vendor/radius/lib/radius/version.rb +5 -11
  303. data/vendor/radius/radius.gemspec +55 -22
  304. data/vendor/radius/tasks/jeweler.rake +21 -0
  305. data/vendor/radius/tasks/rdoc.rake +13 -0
  306. data/vendor/radius/tasks/test.rake +7 -0
  307. data/vendor/radius/test/parser_test.rb +5 -0
  308. data/vendor/radius/test/test_helper.rb +1 -0
  309. data/vendor/rails/actionmailer/CHANGELOG +18 -0
  310. data/vendor/rails/actionmailer/MIT-LICENSE +1 -1
  311. data/vendor/rails/actionmailer/Rakefile +1 -1
  312. data/vendor/rails/actionmailer/lib/action_mailer.rb +1 -1
  313. data/vendor/rails/actionmailer/lib/action_mailer/base.rb +2 -2
  314. data/vendor/rails/actionmailer/lib/action_mailer/quoting.rb +1 -0
  315. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail.rb +1 -0
  316. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/Makefile +18 -0
  317. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/address.rb +4 -38
  318. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/attachments.rb +65 -0
  319. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/base64.rb +0 -0
  320. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/compat.rb +0 -0
  321. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/config.rb +0 -0
  322. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/core_extensions.rb +0 -0
  323. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/encode.rb +9 -0
  324. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/header.rb +4 -2
  325. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/index.rb +0 -0
  326. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/interface.rb +33 -1
  327. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/loader.rb +0 -0
  328. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/mail.rb +1 -1
  329. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/mailbox.rb +3 -2
  330. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/main.rb +0 -0
  331. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/mbox.rb +0 -0
  332. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/net.rb +3 -1
  333. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/obsolete.rb +0 -0
  334. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/parser.rb +1060 -0
  335. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/parser.y +416 -0
  336. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/port.rb +0 -0
  337. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/quoting.rb +47 -1
  338. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/require_arch.rb +0 -0
  339. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/scanner.rb +0 -0
  340. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/scanner_r.rb +2 -1
  341. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/stringio.rb +0 -0
  342. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/utils.rb +50 -25
  343. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/COPYING +504 -0
  344. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/README +12 -0
  345. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet.rb +67 -0
  346. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/big5freq.rb +927 -0
  347. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/big5prober.rb +42 -0
  348. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/chardistribution.rb +238 -0
  349. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/charsetgroupprober.rb +112 -0
  350. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/charsetprober.rb +75 -0
  351. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/codingstatemachine.rb +64 -0
  352. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/constants.rb +42 -0
  353. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/escprober.rb +89 -0
  354. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/escsm.rb +244 -0
  355. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/eucjpprober.rb +88 -0
  356. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/euckrfreq.rb +596 -0
  357. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/euckrprober.rb +42 -0
  358. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/euctwfreq.rb +430 -0
  359. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/euctwprober.rb +42 -0
  360. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/gb2312freq.rb +474 -0
  361. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/gb2312prober.rb +42 -0
  362. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/hebrewprober.rb +289 -0
  363. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/jisfreq.rb +570 -0
  364. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/jpcntx.rb +229 -0
  365. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/langbulgarianmodel.rb +229 -0
  366. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/langcyrillicmodel.rb +330 -0
  367. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/langgreekmodel.rb +227 -0
  368. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/langhebrewmodel.rb +202 -0
  369. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/langhungarianmodel.rb +226 -0
  370. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/langthaimodel.rb +201 -0
  371. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/latin1prober.rb +147 -0
  372. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/mbcharsetprober.rb +89 -0
  373. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/mbcsgroupprober.rb +45 -0
  374. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/mbcssm.rb +542 -0
  375. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/sbcharsetprober.rb +124 -0
  376. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/sbcsgroupprober.rb +56 -0
  377. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/sjisprober.rb +88 -0
  378. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/universaldetector.rb +168 -0
  379. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/utf8prober.rb +87 -0
  380. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/version.rb +1 -1
  381. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail.rb +2 -2
  382. data/vendor/rails/actionmailer/lib/action_mailer/version.rb +1 -1
  383. data/vendor/rails/actionmailer/test/abstract_unit.rb +4 -4
  384. data/vendor/rails/actionmailer/test/fixtures/helpers/example_helper.rb +1 -1
  385. data/vendor/rails/actionmailer/test/mail_service_test.rb +66 -2
  386. data/vendor/rails/actionmailer/test/quoting_test.rb +10 -4
  387. data/vendor/rails/actionpack/CHANGELOG +55 -0
  388. data/vendor/rails/actionpack/MIT-LICENSE +1 -1
  389. data/vendor/rails/actionpack/README +7 -7
  390. data/vendor/rails/actionpack/Rakefile +2 -2
  391. data/vendor/rails/actionpack/lib/action_controller.rb +2 -2
  392. data/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb +18 -9
  393. data/vendor/rails/actionpack/lib/action_controller/base.rb +14 -14
  394. data/vendor/rails/actionpack/lib/action_controller/caching/fragments.rb +6 -6
  395. data/vendor/rails/actionpack/lib/action_controller/cookies.rb +96 -0
  396. data/vendor/rails/actionpack/lib/action_controller/failsafe.rb +1 -0
  397. data/vendor/rails/actionpack/lib/action_controller/flash.rb +42 -0
  398. data/vendor/rails/actionpack/lib/action_controller/integration.rb +5 -1
  399. data/vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb +1 -1
  400. data/vendor/rails/actionpack/lib/action_controller/rack_lint_patch.rb +1 -1
  401. data/vendor/rails/actionpack/lib/action_controller/rescue.rb +2 -2
  402. data/vendor/rails/actionpack/lib/action_controller/response.rb +4 -7
  403. data/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb +1 -0
  404. data/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb +6 -0
  405. data/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb +6 -0
  406. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_trace.erb +2 -2
  407. data/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb +4 -1
  408. data/vendor/rails/actionpack/lib/action_pack.rb +1 -1
  409. data/vendor/rails/actionpack/lib/action_pack/version.rb +1 -1
  410. data/vendor/rails/actionpack/lib/action_view.rb +3 -3
  411. data/vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb +11 -11
  412. data/vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb +2 -2
  413. data/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb +2 -2
  414. data/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb +12 -11
  415. data/vendor/rails/actionpack/lib/action_view/helpers/debug_helper.rb +2 -2
  416. data/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb +49 -12
  417. data/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb +3 -4
  418. data/vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb +7 -4
  419. data/vendor/rails/actionpack/lib/action_view/helpers/javascript_helper.rb +1 -1
  420. data/vendor/rails/actionpack/lib/action_view/helpers/number_helper.rb +1 -1
  421. data/vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb +2 -2
  422. data/vendor/rails/actionpack/lib/action_view/helpers/raw_output_helper.rb +2 -2
  423. data/vendor/rails/actionpack/lib/action_view/helpers/sanitize_helper.rb +2 -10
  424. data/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb +6 -5
  425. data/vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb +5 -5
  426. data/vendor/rails/actionpack/lib/action_view/helpers/translation_helper.rb +37 -9
  427. data/vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb +9 -11
  428. data/vendor/rails/actionpack/lib/action_view/partials.rb +2 -1
  429. data/vendor/rails/actionpack/lib/action_view/paths.rb +8 -0
  430. data/vendor/rails/actionpack/lib/action_view/renderable.rb +16 -2
  431. data/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb +7 -4
  432. data/vendor/rails/actionpack/lib/action_view/test_case.rb +1 -1
  433. data/vendor/rails/actionpack/test/abstract_unit.rb +8 -8
  434. data/vendor/rails/actionpack/test/active_record_unit.rb +1 -1
  435. data/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +3 -1
  436. data/vendor/rails/actionpack/test/controller/assert_select_test.rb +6 -5
  437. data/vendor/rails/actionpack/test/controller/caching_test.rb +16 -2
  438. data/vendor/rails/actionpack/test/controller/capture_test.rb +1 -1
  439. data/vendor/rails/actionpack/test/controller/cookie_test.rb +37 -1
  440. data/vendor/rails/actionpack/test/controller/flash_test.rb +28 -1
  441. data/vendor/rails/actionpack/test/controller/helper_test.rb +1 -1
  442. data/vendor/rails/actionpack/test/controller/integration_test.rb +0 -1
  443. data/vendor/rails/actionpack/test/controller/localized_templates_test.rb +24 -0
  444. data/vendor/rails/actionpack/test/controller/output_escaping_test.rb +19 -0
  445. data/vendor/rails/actionpack/test/controller/rack_test.rb +1 -4
  446. data/vendor/rails/actionpack/test/controller/render_test.rb +11 -2
  447. data/vendor/rails/actionpack/test/controller/rescue_test.rb +8 -2
  448. data/vendor/rails/actionpack/test/controller/routing_test.rb +1 -0
  449. data/vendor/rails/actionpack/test/controller/send_file_test.rb +1 -1
  450. data/vendor/rails/actionpack/test/controller/session/cookie_store_test.rb +2 -2
  451. data/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +10 -6
  452. data/vendor/rails/actionpack/test/fixtures/localized/hello_world.de.html +1 -0
  453. data/vendor/rails/actionpack/test/fixtures/localized/hello_world.en.html +1 -0
  454. data/vendor/rails/actionpack/test/fixtures/test/_customer_counter_with_as.erb +1 -0
  455. data/vendor/rails/actionpack/test/fixtures/test/_utf8_partial.html.erb +1 -0
  456. data/vendor/rails/actionpack/test/fixtures/test/_utf8_partial_magic.html.erb +2 -0
  457. data/vendor/rails/actionpack/test/fixtures/test/array_translation.erb +1 -0
  458. data/vendor/rails/actionpack/test/fixtures/test/capturing.erb +2 -2
  459. data/vendor/rails/actionpack/test/fixtures/test/scoped_array_translation.erb +1 -0
  460. data/vendor/rails/actionpack/test/fixtures/test/translation.erb +1 -0
  461. data/vendor/rails/actionpack/test/fixtures/test/utf8.html.erb +4 -2
  462. data/vendor/rails/actionpack/test/fixtures/test/utf8_magic.html.erb +5 -0
  463. data/vendor/rails/actionpack/test/fixtures/test/utf8_magic_with_bare_partial.html.erb +5 -0
  464. data/vendor/rails/actionpack/test/template/active_record_helper_i18n_test.rb +9 -2
  465. data/vendor/rails/actionpack/test/template/asset_tag_helper_test.rb +0 -1
  466. data/vendor/rails/actionpack/test/template/date_helper_test.rb +118 -0
  467. data/vendor/rails/actionpack/test/template/erb_util_test.rb +12 -0
  468. data/vendor/rails/actionpack/test/template/form_helper_test.rb +57 -3
  469. data/vendor/rails/actionpack/test/template/form_tag_helper_test.rb +21 -9
  470. data/vendor/rails/actionpack/test/template/render_test.rb +47 -8
  471. data/vendor/rails/actionpack/test/template/text_helper_test.rb +26 -1
  472. data/vendor/rails/actionpack/test/template/translation_helper_test.rb +72 -9
  473. data/vendor/rails/actionpack/test/template/url_helper_test.rb +20 -1
  474. data/vendor/rails/actionpack/test/view/test_case_test.rb +2 -2
  475. data/vendor/rails/activerecord/CHANGELOG +43 -0
  476. data/vendor/rails/activerecord/Rakefile +1 -1
  477. data/vendor/rails/activerecord/examples/performance.sql +85 -0
  478. data/vendor/rails/activerecord/lib/active_record.rb +1 -2
  479. data/vendor/rails/activerecord/lib/active_record/association_preload.rb +9 -2
  480. data/vendor/rails/activerecord/lib/active_record/associations.rb +48 -38
  481. data/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb +15 -11
  482. data/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb +16 -6
  483. data/vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb +11 -1
  484. data/vendor/rails/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb +34 -10
  485. data/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb +5 -0
  486. data/vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb +5 -5
  487. data/vendor/rails/activerecord/lib/active_record/associations/has_one_association.rb +10 -1
  488. data/vendor/rails/activerecord/lib/active_record/attribute_methods.rb +5 -1
  489. data/vendor/rails/activerecord/lib/active_record/autosave_association.rb +66 -35
  490. data/vendor/rails/activerecord/lib/active_record/base.rb +77 -36
  491. data/vendor/rails/activerecord/lib/active_record/batches.rb +13 -9
  492. data/vendor/rails/activerecord/lib/active_record/calculations.rb +6 -3
  493. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +3 -3
  494. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_limits.rb +57 -0
  495. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb +1 -1
  496. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +3 -7
  497. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +1 -1
  498. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +64 -10
  499. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +2 -0
  500. data/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +31 -1
  501. data/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +31 -66
  502. data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +5 -5
  503. data/vendor/rails/activerecord/lib/active_record/dirty.rb +2 -2
  504. data/vendor/rails/activerecord/lib/active_record/fixtures.rb +1 -0
  505. data/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb +34 -1
  506. data/vendor/rails/activerecord/lib/active_record/migration.rb +5 -0
  507. data/vendor/rails/activerecord/lib/active_record/nested_attributes.rb +64 -52
  508. data/vendor/rails/activerecord/lib/active_record/reflection.rb +66 -1
  509. data/vendor/rails/activerecord/lib/active_record/schema.rb +5 -1
  510. data/vendor/rails/activerecord/lib/active_record/schema_dumper.rb +3 -0
  511. data/vendor/rails/activerecord/lib/active_record/serializers/json_serializer.rb +1 -1
  512. data/vendor/rails/activerecord/lib/active_record/validations.rb +13 -1
  513. data/vendor/rails/activerecord/lib/active_record/version.rb +1 -1
  514. data/vendor/rails/activerecord/test/cases/active_schema_test_mysql.rb +22 -0
  515. data/vendor/rails/activerecord/test/cases/associations/belongs_to_associations_test.rb +13 -0
  516. data/vendor/rails/activerecord/test/cases/associations/eager_load_nested_include_test.rb +8 -7
  517. data/vendor/rails/activerecord/test/cases/associations/eager_test.rb +7 -1
  518. data/vendor/rails/activerecord/test/cases/associations/has_many_associations_test.rb +26 -0
  519. data/vendor/rails/activerecord/test/cases/associations/inverse_associations_test.rb +566 -0
  520. data/vendor/rails/activerecord/test/cases/associations_test.rb +10 -0
  521. data/vendor/rails/activerecord/test/cases/autosave_association_test.rb +86 -10
  522. data/vendor/rails/activerecord/test/cases/base_test.rb +29 -0
  523. data/vendor/rails/activerecord/test/cases/batches_test.rb +20 -0
  524. data/vendor/rails/activerecord/test/cases/calculations_test.rb +2 -3
  525. data/vendor/rails/activerecord/test/cases/encoding_test.rb +6 -0
  526. data/vendor/rails/activerecord/test/cases/finder_test.rb +19 -3
  527. data/vendor/rails/activerecord/test/cases/fixtures_test.rb +5 -0
  528. data/vendor/rails/activerecord/test/cases/json_serialization_test.rb +14 -0
  529. data/vendor/rails/activerecord/test/cases/locking_test.rb +48 -3
  530. data/vendor/rails/activerecord/test/cases/migration_test.rb +115 -0
  531. data/vendor/rails/activerecord/test/cases/modules_test.rb +28 -0
  532. data/vendor/rails/activerecord/test/cases/named_scope_test.rb +1 -1
  533. data/vendor/rails/activerecord/test/cases/nested_attributes_test.rb +239 -7
  534. data/vendor/rails/activerecord/test/cases/query_cache_test.rb +7 -1
  535. data/vendor/rails/activerecord/test/cases/reflection_test.rb +47 -7
  536. data/vendor/rails/activerecord/test/cases/schema_test_postgresql.rb +2 -2
  537. data/vendor/rails/activerecord/test/cases/validations_i18n_test.rb +6 -36
  538. data/vendor/rails/activerecord/test/cases/validations_test.rb +33 -1
  539. data/vendor/rails/activerecord/test/cases/yaml_serialization_test.rb +11 -0
  540. data/vendor/rails/activerecord/test/fixtures/faces.yml +11 -0
  541. data/vendor/rails/{pkg/rails-3.0.pre.gem → activerecord/test/fixtures/fixture_database.sqlite} +0 -0
  542. data/vendor/rails/activerecord/test/fixtures/fixture_database.sqlite3 +0 -0
  543. data/vendor/rails/activerecord/test/fixtures/fixture_database_2.sqlite +0 -0
  544. data/vendor/rails/activerecord/test/fixtures/fixture_database_2.sqlite3 +0 -0
  545. data/vendor/rails/activerecord/test/fixtures/interests.yml +33 -0
  546. data/vendor/rails/activerecord/test/fixtures/men.yml +5 -0
  547. data/vendor/rails/activerecord/test/fixtures/zines.yml +5 -0
  548. data/vendor/rails/activerecord/test/models/author.rb +3 -0
  549. data/vendor/rails/activerecord/test/models/bird.rb +6 -0
  550. data/vendor/rails/activerecord/test/models/company_in_module.rb +17 -0
  551. data/vendor/rails/activerecord/test/models/event_author.rb +5 -0
  552. data/vendor/rails/activerecord/test/models/face.rb +7 -0
  553. data/vendor/rails/activerecord/test/models/interest.rb +5 -0
  554. data/vendor/rails/activerecord/test/models/invoice.rb +4 -0
  555. data/vendor/rails/activerecord/test/models/line_item.rb +3 -0
  556. data/vendor/rails/activerecord/test/models/man.rb +9 -0
  557. data/vendor/rails/activerecord/test/models/parrot.rb +6 -0
  558. data/vendor/rails/activerecord/test/models/pirate.rb +10 -0
  559. data/vendor/rails/activerecord/test/models/ship.rb +10 -1
  560. data/vendor/rails/activerecord/test/models/ship_part.rb +3 -1
  561. data/vendor/rails/activerecord/test/models/zine.rb +3 -0
  562. data/vendor/rails/activerecord/test/schema/schema.rb +41 -0
  563. data/vendor/rails/activeresource/CHANGELOG +15 -0
  564. data/vendor/rails/activeresource/Rakefile +1 -1
  565. data/vendor/rails/activeresource/lib/active_resource/base.rb +11 -2
  566. data/vendor/rails/activeresource/lib/active_resource/http_mock.rb +2 -2
  567. data/vendor/rails/activeresource/lib/active_resource/validations.rb +3 -3
  568. data/vendor/rails/activeresource/lib/active_resource/version.rb +1 -1
  569. data/vendor/rails/activeresource/test/abstract_unit.rb +2 -2
  570. data/vendor/rails/activeresource/test/base_errors_test.rb +13 -0
  571. data/vendor/rails/activeresource/test/base_test.rb +49 -0
  572. data/vendor/rails/activeresource/test/debug.log +80350 -0
  573. data/vendor/rails/activesupport/CHANGELOG +37 -0
  574. data/vendor/rails/activesupport/lib/active_support.rb +1 -0
  575. data/vendor/rails/activesupport/lib/active_support/buffered_logger.rb +1 -1
  576. data/vendor/rails/activesupport/lib/active_support/cache/memory_store.rb +7 -1
  577. data/vendor/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb +1 -1
  578. data/vendor/rails/activesupport/lib/active_support/core_ext/array/conversions.rb +1 -1
  579. data/vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb +11 -1
  580. data/vendor/rails/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb +35 -28
  581. data/vendor/rails/activesupport/lib/active_support/core_ext/date/calculations.rb +14 -4
  582. data/vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb +14 -3
  583. data/vendor/rails/activesupport/lib/active_support/core_ext/enumerable.rb +6 -0
  584. data/vendor/rails/activesupport/lib/active_support/core_ext/file/atomic.rb +2 -1
  585. data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb +1 -1
  586. data/vendor/rails/activesupport/lib/active_support/core_ext/module/aliasing.rb +1 -1
  587. data/vendor/rails/activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb +1 -1
  588. data/vendor/rails/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb +33 -26
  589. data/vendor/rails/activesupport/lib/active_support/core_ext/module/synchronization.rb +1 -1
  590. data/vendor/rails/activesupport/lib/active_support/core_ext/numeric/conversions.rb +2 -2
  591. data/vendor/rails/activesupport/lib/active_support/core_ext/object.rb +1 -0
  592. data/vendor/rails/activesupport/lib/active_support/core_ext/object/blank.rb +20 -2
  593. data/vendor/rails/activesupport/lib/active_support/core_ext/object/metaclass.rb +6 -5
  594. data/vendor/rails/activesupport/lib/active_support/core_ext/object/singleton_class.rb +13 -0
  595. data/vendor/rails/activesupport/lib/active_support/core_ext/string.rb +0 -1
  596. data/vendor/rails/activesupport/lib/active_support/core_ext/string/output_safety.rb +108 -44
  597. data/vendor/rails/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb +2 -4
  598. data/vendor/rails/activesupport/lib/active_support/core_ext/time.rb +8 -4
  599. data/vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb +12 -3
  600. data/vendor/rails/activesupport/lib/active_support/deprecation.rb +3 -2
  601. data/vendor/rails/activesupport/lib/active_support/inflections.rb +1 -1
  602. data/vendor/rails/activesupport/lib/active_support/inflector.rb +5 -2
  603. data/vendor/rails/activesupport/lib/active_support/json/backends/yajl.rb +40 -0
  604. data/vendor/rails/activesupport/lib/active_support/json/backends/yaml.rb +10 -7
  605. data/vendor/rails/activesupport/lib/active_support/json/decoding.rb +16 -1
  606. data/vendor/rails/activesupport/lib/active_support/json/encoding.rb +11 -2
  607. data/vendor/rails/activesupport/lib/active_support/memoizable.rb +1 -1
  608. data/vendor/rails/activesupport/lib/active_support/multibyte/unicode_database.rb +2 -2
  609. data/vendor/rails/activesupport/lib/active_support/multibyte/utils.rb +6 -7
  610. data/vendor/rails/activesupport/lib/active_support/ordered_hash.rb +28 -11
  611. data/vendor/rails/activesupport/lib/active_support/testing/assertions.rb +14 -0
  612. data/vendor/rails/activesupport/lib/active_support/values/time_zone.rb +84 -76
  613. data/vendor/rails/activesupport/lib/active_support/vendor.rb +10 -2
  614. data/vendor/rails/activesupport/lib/active_support/vendor/{i18n-0.1.3/lib → i18n-0.3.7}/i18n.rb +175 -39
  615. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend.rb +19 -0
  616. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/active_record.rb +66 -0
  617. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/active_record/missing.rb +67 -0
  618. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/active_record/store_procs.rb +38 -0
  619. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/active_record/translation.rb +88 -0
  620. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/base.rb +266 -0
  621. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/cache.rb +76 -0
  622. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/cascade.rb +58 -0
  623. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/chain.rb +75 -0
  624. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/cldr.rb +100 -0
  625. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/fallbacks.rb +69 -0
  626. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/fast.rb +69 -0
  627. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/gettext.rb +75 -0
  628. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/helpers.rb +68 -0
  629. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/interpolation_compiler.rb +119 -0
  630. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/links.rb +34 -0
  631. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/metadata.rb +73 -0
  632. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/pluralization.rb +57 -0
  633. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/simple.rb +22 -0
  634. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/core_ext/hash/except.rb +8 -0
  635. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/core_ext/hash/slice.rb +8 -0
  636. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/core_ext/object/meta_class.rb +5 -0
  637. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/core_ext/string/interpolate.rb +99 -0
  638. data/vendor/rails/activesupport/lib/active_support/vendor/{i18n-0.1.3/lib → i18n-0.3.7}/i18n/exceptions.rb +15 -7
  639. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/gettext.rb +25 -0
  640. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/gettext/po_parser.rb +329 -0
  641. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/helpers.rb +5 -0
  642. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/helpers/gettext.rb +65 -0
  643. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale.rb +6 -0
  644. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/fallbacks.rb +98 -0
  645. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag.rb +28 -0
  646. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/parents.rb +24 -0
  647. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/rfc4646.rb +76 -0
  648. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/simple.rb +41 -0
  649. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/version.rb +3 -0
  650. data/vendor/rails/activesupport/lib/active_support/version.rb +1 -1
  651. data/vendor/rails/activesupport/lib/active_support/whiny_nil.rb +1 -1
  652. data/vendor/rails/activesupport/lib/active_support/xml_mini/libxml.rb +23 -83
  653. data/vendor/rails/activesupport/lib/active_support/xml_mini/libxmlsax.rb +74 -0
  654. data/vendor/rails/activesupport/lib/active_support/xml_mini/nokogiri.rb +25 -22
  655. data/vendor/rails/activesupport/lib/active_support/xml_mini/nokogirisax.rb +73 -0
  656. data/vendor/rails/railties/CHANGELOG +18 -2
  657. data/vendor/rails/railties/MIT-LICENSE +1 -1
  658. data/vendor/rails/railties/Rakefile +5 -5
  659. data/vendor/rails/railties/bin/rails +6 -5
  660. data/vendor/rails/railties/builtin/rails_info/rails/info.rb +1 -1
  661. data/vendor/rails/railties/configs/initializers/cookie_verification_secret.rb +7 -0
  662. data/vendor/rails/railties/guides/source/getting_started.textile +2 -2
  663. data/vendor/rails/railties/lib/commands/dbconsole.rb +1 -1
  664. data/vendor/rails/railties/lib/commands/runner.rb +1 -1
  665. data/vendor/rails/railties/lib/dispatcher.rb +1 -1
  666. data/vendor/rails/railties/lib/rails/gem_dependency.rb +11 -4
  667. data/vendor/rails/railties/lib/rails/vendor_gem_source_index.rb +1 -1
  668. data/vendor/rails/railties/lib/rails/version.rb +1 -1
  669. data/vendor/rails/railties/lib/rails_generator.rb +5 -2
  670. data/vendor/rails/railties/lib/rails_generator/generated_attribute.rb +7 -6
  671. data/vendor/rails/railties/lib/rails_generator/generators/applications/app/app_generator.rb +3 -0
  672. data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml +9 -5
  673. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/plugin_generator.rb +2 -2
  674. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb +2 -4
  675. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/layout.html.erb +1 -1
  676. data/vendor/rails/railties/lib/tasks/databases.rake +14 -14
  677. data/vendor/rails/railties/lib/tasks/framework.rake +4 -1
  678. data/vendor/rails/railties/lib/tasks/rails.rb +6 -1
  679. metadata +276 -321
  680. data/config/initializers/pagination.rb +0 -1
  681. data/vendor/extensions/markdown_filter/vendor/kramdown/doc/default.css +0 -293
  682. data/vendor/plugins/haml/FAQ +0 -138
  683. data/vendor/plugins/haml/README.rdoc +0 -319
  684. data/vendor/plugins/haml/REVISION +0 -1
  685. data/vendor/plugins/haml/lib/sass/constant.rb +0 -216
  686. data/vendor/plugins/haml/lib/sass/constant/color.rb +0 -101
  687. data/vendor/plugins/haml/lib/sass/constant/literal.rb +0 -54
  688. data/vendor/plugins/haml/lib/sass/constant/nil.rb +0 -9
  689. data/vendor/plugins/haml/lib/sass/constant/number.rb +0 -87
  690. data/vendor/plugins/haml/lib/sass/constant/operation.rb +0 -30
  691. data/vendor/plugins/haml/lib/sass/constant/string.rb +0 -22
  692. data/vendor/plugins/haml/lib/sass/tree/attr_node.rb +0 -57
  693. data/vendor/plugins/haml/lib/sass/tree/value_node.rb +0 -20
  694. data/vendor/plugins/haml/test/sass/results/constants.css +0 -16
  695. data/vendor/plugins/haml/test/sass/templates/constants.sass +0 -100
  696. data/vendor/radius/Manifest.txt +0 -21
  697. data/vendor/rails/Rakefile +0 -81
  698. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/attachments.rb +0 -46
  699. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/parser.rb +0 -1478
  700. data/vendor/rails/actionmailer/pkg/actionmailer-3.0.pre.gem +0 -0
  701. data/vendor/rails/actionpack/lib/action_view/erb/util.rb +0 -44
  702. data/vendor/rails/actionpack/lib/action_view/safe_buffer.rb +0 -28
  703. data/vendor/rails/actionpack/pkg/actionpack-3.0.pre.gem +0 -0
  704. data/vendor/rails/actionpack/test/view/safe_buffer_test.rb +0 -36
  705. data/vendor/rails/activemodel/CHANGES +0 -12
  706. data/vendor/rails/activemodel/README +0 -21
  707. data/vendor/rails/activemodel/Rakefile +0 -24
  708. data/vendor/rails/activemodel/lib/active_model.rb +0 -5
  709. data/vendor/rails/activemodel/lib/active_model/base.rb +0 -8
  710. data/vendor/rails/activemodel/lib/active_model/callbacks.rb +0 -7
  711. data/vendor/rails/activemodel/lib/active_model/core.rb +0 -7
  712. data/vendor/rails/activemodel/lib/active_model/deprecated_error_methods.rb +0 -38
  713. data/vendor/rails/activemodel/lib/active_model/errors.rb +0 -82
  714. data/vendor/rails/activemodel/lib/active_model/observing.rb +0 -98
  715. data/vendor/rails/activemodel/lib/active_model/state_machine.rb +0 -68
  716. data/vendor/rails/activemodel/lib/active_model/state_machine/event.rb +0 -64
  717. data/vendor/rails/activemodel/lib/active_model/state_machine/machine.rb +0 -78
  718. data/vendor/rails/activemodel/lib/active_model/state_machine/state.rb +0 -47
  719. data/vendor/rails/activemodel/lib/active_model/state_machine/state_transition.rb +0 -40
  720. data/vendor/rails/activemodel/lib/active_model/validations.rb +0 -126
  721. data/vendor/rails/activemodel/lib/active_model/validations/acceptance.rb +0 -45
  722. data/vendor/rails/activemodel/lib/active_model/validations/associated.rb +0 -46
  723. data/vendor/rails/activemodel/lib/active_model/validations/confirmation.rb +0 -44
  724. data/vendor/rails/activemodel/lib/active_model/validations/exclusion.rb +0 -37
  725. data/vendor/rails/activemodel/lib/active_model/validations/format.rb +0 -39
  726. data/vendor/rails/activemodel/lib/active_model/validations/inclusion.rb +0 -37
  727. data/vendor/rails/activemodel/lib/active_model/validations/length.rb +0 -95
  728. data/vendor/rails/activemodel/lib/active_model/validations/numericality.rb +0 -80
  729. data/vendor/rails/activemodel/lib/active_model/validations/presence.rb +0 -42
  730. data/vendor/rails/activemodel/lib/active_model/validations/uniqueness.rb +0 -104
  731. data/vendor/rails/activemodel/pkg/activemodel-3.0.pre.gem +0 -0
  732. data/vendor/rails/activemodel/test/observing_test.rb +0 -121
  733. data/vendor/rails/activemodel/test/state_machine/event_test.rb +0 -49
  734. data/vendor/rails/activemodel/test/state_machine/machine_test.rb +0 -43
  735. data/vendor/rails/activemodel/test/state_machine/state_test.rb +0 -72
  736. data/vendor/rails/activemodel/test/state_machine/state_transition_test.rb +0 -84
  737. data/vendor/rails/activemodel/test/state_machine_test.rb +0 -312
  738. data/vendor/rails/activemodel/test/test_helper.rb +0 -21
  739. data/vendor/rails/activerecord/MIT-LICENSE +0 -20
  740. data/vendor/rails/activerecord/lib/active_record/i18n_interpolation_deprecation.rb +0 -26
  741. data/vendor/rails/activerecord/pkg/activerecord-3.0.pre.gem +0 -0
  742. data/vendor/rails/activeresource/MIT-LICENSE +0 -20
  743. data/vendor/rails/activeresource/pkg/activeresource-3.0.pre.gem +0 -0
  744. data/vendor/rails/activesupport/MIT-LICENSE +0 -20
  745. data/vendor/rails/activesupport/Rakefile +0 -175
  746. data/vendor/rails/activesupport/bin/generate_tables +0 -147
  747. data/vendor/rails/activesupport/install.rb +0 -30
  748. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/MIT-LICENSE +0 -20
  749. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/README.textile +0 -20
  750. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/Rakefile +0 -5
  751. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/i18n.gemspec +0 -27
  752. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb +0 -214
  753. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/all.rb +0 -5
  754. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb +0 -99
  755. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/i18n_test.rb +0 -124
  756. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/locale/en.rb +0 -1
  757. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/locale/en.yml +0 -3
  758. data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb +0 -567
  759. data/vendor/rails/activesupport/pkg/activesupport-3.0.pre.gem +0 -0
  760. data/vendor/rails/activesupport/test/abstract_unit.rb +0 -36
  761. data/vendor/rails/activesupport/test/autoloading_fixtures/a/b.rb +0 -2
  762. data/vendor/rails/activesupport/test/autoloading_fixtures/a/c/d.rb +0 -2
  763. data/vendor/rails/activesupport/test/autoloading_fixtures/a/c/e/f.rb +0 -2
  764. data/vendor/rails/activesupport/test/autoloading_fixtures/application.rb +0 -1
  765. data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder.rb +0 -3
  766. data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/class_folder_subclass.rb +0 -3
  767. data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/inline_class.rb +0 -2
  768. data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/nested_class.rb +0 -7
  769. data/vendor/rails/activesupport/test/autoloading_fixtures/conflict.rb +0 -1
  770. data/vendor/rails/activesupport/test/autoloading_fixtures/counting_loader.rb +0 -5
  771. data/vendor/rails/activesupport/test/autoloading_fixtures/cross_site_dependency.rb +0 -2
  772. data/vendor/rails/activesupport/test/autoloading_fixtures/e.rb +0 -2
  773. data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/inline_class.rb +0 -2
  774. data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/nested_class.rb +0 -4
  775. data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/nested_sibling.rb +0 -2
  776. data/vendor/rails/activesupport/test/autoloading_fixtures/module_with_custom_const_missing/a/b.rb +0 -1
  777. data/vendor/rails/activesupport/test/autoloading_fixtures/multiple_constant_file.rb +0 -2
  778. data/vendor/rails/activesupport/test/autoloading_fixtures/raises_name_error.rb +0 -3
  779. data/vendor/rails/activesupport/test/autoloading_fixtures/raises_no_method_error.rb +0 -3
  780. data/vendor/rails/activesupport/test/buffered_logger_test.rb +0 -146
  781. data/vendor/rails/activesupport/test/caching_test.rb +0 -348
  782. data/vendor/rails/activesupport/test/callbacks_test.rb +0 -188
  783. data/vendor/rails/activesupport/test/clean_backtrace_test.rb +0 -47
  784. data/vendor/rails/activesupport/test/clean_logger_test.rb +0 -57
  785. data/vendor/rails/activesupport/test/core_ext/array_ext_test.rb +0 -363
  786. data/vendor/rails/activesupport/test/core_ext/base64_ext_test.rb +0 -8
  787. data/vendor/rails/activesupport/test/core_ext/bigdecimal.rb +0 -10
  788. data/vendor/rails/activesupport/test/core_ext/blank_test.rb +0 -24
  789. data/vendor/rails/activesupport/test/core_ext/cgi_ext_test.rb +0 -14
  790. data/vendor/rails/activesupport/test/core_ext/class/attribute_accessor_test.rb +0 -31
  791. data/vendor/rails/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb +0 -224
  792. data/vendor/rails/activesupport/test/core_ext/class/delegating_attributes_test.rb +0 -115
  793. data/vendor/rails/activesupport/test/core_ext/class_test.rb +0 -46
  794. data/vendor/rails/activesupport/test/core_ext/date_ext_test.rb +0 -278
  795. data/vendor/rails/activesupport/test/core_ext/date_time_ext_test.rb +0 -359
  796. data/vendor/rails/activesupport/test/core_ext/duplicable_test.rb +0 -22
  797. data/vendor/rails/activesupport/test/core_ext/duration_test.rb +0 -121
  798. data/vendor/rails/activesupport/test/core_ext/enumerable_test.rb +0 -97
  799. data/vendor/rails/activesupport/test/core_ext/exception_test.rb +0 -68
  800. data/vendor/rails/activesupport/test/core_ext/file_test.rb +0 -67
  801. data/vendor/rails/activesupport/test/core_ext/float_ext_test.rb +0 -25
  802. data/vendor/rails/activesupport/test/core_ext/hash_ext_test.rb +0 -1014
  803. data/vendor/rails/activesupport/test/core_ext/integer_ext_test.rb +0 -37
  804. data/vendor/rails/activesupport/test/core_ext/kernel_test.rb +0 -43
  805. data/vendor/rails/activesupport/test/core_ext/load_error_test.rb +0 -16
  806. data/vendor/rails/activesupport/test/core_ext/module/attr_accessor_with_default_test.rb +0 -30
  807. data/vendor/rails/activesupport/test/core_ext/module/attr_internal_test.rb +0 -52
  808. data/vendor/rails/activesupport/test/core_ext/module/attribute_accessor_test.rb +0 -33
  809. data/vendor/rails/activesupport/test/core_ext/module/attribute_aliasing_test.rb +0 -58
  810. data/vendor/rails/activesupport/test/core_ext/module/model_naming_test.rb +0 -27
  811. data/vendor/rails/activesupport/test/core_ext/module/synchronization_test.rb +0 -85
  812. data/vendor/rails/activesupport/test/core_ext/module_test.rb +0 -363
  813. data/vendor/rails/activesupport/test/core_ext/name_error_test.rb +0 -20
  814. data/vendor/rails/activesupport/test/core_ext/numeric_ext_test.rb +0 -162
  815. data/vendor/rails/activesupport/test/core_ext/object_and_class_ext_test.rb +0 -282
  816. data/vendor/rails/activesupport/test/core_ext/object_ext_test.rb +0 -8
  817. data/vendor/rails/activesupport/test/core_ext/pathname_test.rb +0 -9
  818. data/vendor/rails/activesupport/test/core_ext/proc_test.rb +0 -11
  819. data/vendor/rails/activesupport/test/core_ext/range_ext_test.rb +0 -63
  820. data/vendor/rails/activesupport/test/core_ext/string_ext_test.rb +0 -369
  821. data/vendor/rails/activesupport/test/core_ext/symbol_test.rb +0 -9
  822. data/vendor/rails/activesupport/test/core_ext/time_ext_test.rb +0 -744
  823. data/vendor/rails/activesupport/test/core_ext/time_with_zone_test.rb +0 -845
  824. data/vendor/rails/activesupport/test/core_ext/uri_ext_test.rb +0 -12
  825. data/vendor/rails/activesupport/test/dependencies/check_warnings.rb +0 -2
  826. data/vendor/rails/activesupport/test/dependencies/conflict.rb +0 -1
  827. data/vendor/rails/activesupport/test/dependencies/cross_site_depender.rb +0 -3
  828. data/vendor/rails/activesupport/test/dependencies/mutual_one.rb +0 -4
  829. data/vendor/rails/activesupport/test/dependencies/mutual_two.rb +0 -4
  830. data/vendor/rails/activesupport/test/dependencies/raises_exception.rb +0 -3
  831. data/vendor/rails/activesupport/test/dependencies/requires_nonexistent0.rb +0 -1
  832. data/vendor/rails/activesupport/test/dependencies/requires_nonexistent1.rb +0 -1
  833. data/vendor/rails/activesupport/test/dependencies/service_one.rb +0 -5
  834. data/vendor/rails/activesupport/test/dependencies/service_two.rb +0 -2
  835. data/vendor/rails/activesupport/test/dependencies_test.rb +0 -782
  836. data/vendor/rails/activesupport/test/deprecation_test.rb +0 -167
  837. data/vendor/rails/activesupport/test/flush_cache_on_private_memoization_test.rb +0 -43
  838. data/vendor/rails/activesupport/test/gzip_test.rb +0 -7
  839. data/vendor/rails/activesupport/test/i18n_test.rb +0 -98
  840. data/vendor/rails/activesupport/test/inflector_test.rb +0 -298
  841. data/vendor/rails/activesupport/test/inflector_test_cases.rb +0 -252
  842. data/vendor/rails/activesupport/test/json/decoding_test.rb +0 -73
  843. data/vendor/rails/activesupport/test/json/encoding_test.rb +0 -160
  844. data/vendor/rails/activesupport/test/memoizable_test.rb +0 -247
  845. data/vendor/rails/activesupport/test/message_encryptor_test.rb +0 -46
  846. data/vendor/rails/activesupport/test/message_verifier_test.rb +0 -31
  847. data/vendor/rails/activesupport/test/multibyte_chars_test.rb +0 -606
  848. data/vendor/rails/activesupport/test/multibyte_conformance.rb +0 -129
  849. data/vendor/rails/activesupport/test/multibyte_test_helpers.rb +0 -19
  850. data/vendor/rails/activesupport/test/multibyte_unicode_database_test.rb +0 -22
  851. data/vendor/rails/activesupport/test/multibyte_utils_test.rb +0 -137
  852. data/vendor/rails/activesupport/test/option_merger_test.rb +0 -85
  853. data/vendor/rails/activesupport/test/ordered_hash_test.rb +0 -201
  854. data/vendor/rails/activesupport/test/ordered_options_test.rb +0 -53
  855. data/vendor/rails/activesupport/test/rescuable_test.rb +0 -75
  856. data/vendor/rails/activesupport/test/secure_random_test.rb +0 -19
  857. data/vendor/rails/activesupport/test/string_inquirer_test.rb +0 -15
  858. data/vendor/rails/activesupport/test/test_test.rb +0 -148
  859. data/vendor/rails/activesupport/test/time_zone_test.rb +0 -266
  860. data/vendor/rails/activesupport/test/whiny_nil_test.rb +0 -50
  861. data/vendor/rails/activesupport/test/xml_mini/jdom_engine_test.rb +0 -153
  862. data/vendor/rails/activesupport/test/xml_mini/nokogiri_engine_test.rb +0 -168
  863. data/vendor/rails/activesupport/test/xml_mini/rexml_engine_test.rb +0 -15
  864. data/vendor/rails/ci/ci_build.rb +0 -119
  865. data/vendor/rails/ci/ci_setup_notes.txt +0 -131
  866. data/vendor/rails/ci/cruise_config.rb +0 -9
  867. data/vendor/rails/ci/geminstaller.yml +0 -24
  868. data/vendor/rails/ci/site.css +0 -13
  869. data/vendor/rails/ci/site_config.rb +0 -72
  870. data/vendor/rails/doc/template/horo.rb +0 -613
  871. data/vendor/rails/pushgems.rb +0 -14
  872. data/vendor/rails/railties/pkg/railties-3.0.pre.gem +0 -0
  873. data/vendor/rails/railties/test/abstract_unit.rb +0 -27
  874. data/vendor/rails/railties/test/backtrace_cleaner_test.rb +0 -61
  875. data/vendor/rails/railties/test/boot_test.rb +0 -178
  876. data/vendor/rails/railties/test/console_app_test.rb +0 -42
  877. data/vendor/rails/railties/test/fcgi_dispatcher_test.rb +0 -266
  878. data/vendor/rails/railties/test/fixtures/about_yml_plugins/bad_about_yml/about.yml +0 -1
  879. data/vendor/rails/railties/test/fixtures/about_yml_plugins/bad_about_yml/init.rb +0 -1
  880. data/vendor/rails/railties/test/fixtures/about_yml_plugins/plugin_without_about_yml/init.rb +0 -1
  881. data/vendor/rails/railties/test/fixtures/eager/zoo.rb +0 -3
  882. data/vendor/rails/railties/test/fixtures/eager/zoo/reptile_house.rb +0 -2
  883. data/vendor/rails/railties/test/fixtures/environment_with_constant.rb +0 -1
  884. data/vendor/rails/railties/test/fixtures/lib/generators/missing_class/missing_class_generator.rb +0 -0
  885. data/vendor/rails/railties/test/fixtures/lib/generators/working/working_generator.rb +0 -2
  886. data/vendor/rails/railties/test/fixtures/metal/multiplemetals/app/metal/metal_a.rb +0 -5
  887. data/vendor/rails/railties/test/fixtures/metal/multiplemetals/app/metal/metal_b.rb +0 -5
  888. data/vendor/rails/railties/test/fixtures/metal/pluralmetal/app/metal/legacy_routes.rb +0 -5
  889. data/vendor/rails/railties/test/fixtures/metal/singlemetal/app/metal/foo_metal.rb +0 -5
  890. data/vendor/rails/railties/test/fixtures/metal/subfolders/app/metal/Folder/metal_a.rb +0 -7
  891. data/vendor/rails/railties/test/fixtures/metal/subfolders/app/metal/Folder/metal_b.rb +0 -7
  892. data/vendor/rails/railties/test/fixtures/plugins/alternate/a/generators/a_generator/a_generator.rb +0 -4
  893. data/vendor/rails/railties/test/fixtures/plugins/default/gemlike/init.rb +0 -1
  894. data/vendor/rails/railties/test/fixtures/plugins/default/gemlike/lib/gemlike.rb +0 -2
  895. data/vendor/rails/railties/test/fixtures/plugins/default/gemlike/rails/init.rb +0 -7
  896. data/vendor/rails/railties/test/fixtures/plugins/default/plugin_with_no_lib_dir/init.rb +0 -0
  897. data/vendor/rails/railties/test/fixtures/plugins/default/stubby/about.yml +0 -2
  898. data/vendor/rails/railties/test/fixtures/plugins/default/stubby/generators/stubby_generator/stubby_generator.rb +0 -4
  899. data/vendor/rails/railties/test/fixtures/plugins/default/stubby/init.rb +0 -7
  900. data/vendor/rails/railties/test/fixtures/plugins/default/stubby/lib/stubby_mixin.rb +0 -2
  901. data/vendor/rails/railties/test/fixtures/plugins/engines/engine/app/controllers/engine_controller.rb +0 -2
  902. data/vendor/rails/railties/test/fixtures/plugins/engines/engine/app/metal/engine_metal.rb +0 -10
  903. data/vendor/rails/railties/test/fixtures/plugins/engines/engine/app/models/engine_model.rb +0 -2
  904. data/vendor/rails/railties/test/fixtures/plugins/engines/engine/config/locales/en.yml +0 -2
  905. data/vendor/rails/railties/test/fixtures/plugins/engines/engine/config/routes.rb +0 -3
  906. data/vendor/rails/railties/test/fixtures/plugins/engines/engine/init.rb +0 -3
  907. data/vendor/rails/railties/test/fixtures/public/foo/bar.html +0 -1
  908. data/vendor/rails/railties/test/fixtures/public/foo/index.html +0 -1
  909. data/vendor/rails/railties/test/fixtures/public/index.html +0 -1
  910. data/vendor/rails/railties/test/gem_dependency_test.rb +0 -219
  911. data/vendor/rails/railties/test/generator_lookup_test.rb +0 -40
  912. data/vendor/rails/railties/test/generators/generator_test_helper.rb +0 -310
  913. data/vendor/rails/railties/test/generators/rails_controller_generator_test.rb +0 -44
  914. data/vendor/rails/railties/test/generators/rails_helper_generator_test.rb +0 -36
  915. data/vendor/rails/railties/test/generators/rails_mailer_generator_test.rb +0 -29
  916. data/vendor/rails/railties/test/generators/rails_model_generator_test.rb +0 -96
  917. data/vendor/rails/railties/test/generators/rails_resource_generator_test.rb +0 -29
  918. data/vendor/rails/railties/test/generators/rails_scaffold_generator_test.rb +0 -151
  919. data/vendor/rails/railties/test/generators/rails_template_runner_test.rb +0 -216
  920. data/vendor/rails/railties/test/initializer_test.rb +0 -416
  921. data/vendor/rails/railties/test/metal_test.rb +0 -72
  922. data/vendor/rails/railties/test/mocks/routes.rb +0 -6
  923. data/vendor/rails/railties/test/plugin_loader_test.rb +0 -172
  924. data/vendor/rails/railties/test/plugin_locator_test.rb +0 -62
  925. data/vendor/rails/railties/test/plugin_test.rb +0 -162
  926. data/vendor/rails/railties/test/plugin_test_helper.rb +0 -29
  927. data/vendor/rails/railties/test/rack_static_test.rb +0 -46
  928. data/vendor/rails/railties/test/rails_generator_test.rb +0 -145
  929. data/vendor/rails/railties/test/rails_info_controller_test.rb +0 -52
  930. data/vendor/rails/railties/test/rails_info_test.rb +0 -99
  931. data/vendor/rails/railties/test/secret_key_generation_test.rb +0 -38
  932. data/vendor/rails/railties/test/vendor/gems/dummy-gem-a-0.4.0/lib/dummy-gem-a.rb +0 -1
  933. data/vendor/rails/railties/test/vendor/gems/dummy-gem-b-0.4.0/lib/dummy-gem-b.rb +0 -1
  934. data/vendor/rails/railties/test/vendor/gems/dummy-gem-b-0.6.0/lib/dummy-gem-b.rb +0 -1
  935. data/vendor/rails/railties/test/vendor/gems/dummy-gem-c-0.4.0/lib/dummy-gem-c.rb +0 -1
  936. data/vendor/rails/railties/test/vendor/gems/dummy-gem-c-0.6.0/lib/dummy-gem-c.rb +0 -1
  937. data/vendor/rails/railties/test/vendor/gems/dummy-gem-d-1.0.0/lib/dummy-gem-d.rb +0 -1
  938. data/vendor/rails/railties/test/vendor/gems/dummy-gem-e-1.0.0/lib/dummy-gem-e.rb +0 -1
  939. data/vendor/rails/railties/test/vendor/gems/dummy-gem-f-1.0.0/lib/dummy-gem-f.rb +0 -1
  940. data/vendor/rails/railties/test/vendor/gems/dummy-gem-g-1.0.0/lib/dummy-gem-g.rb +0 -1
  941. data/vendor/rails/railties/test/vendor/gems/dummy-gem-h-1.0.0/lib/dummy-gem-h.rb +0 -1
  942. data/vendor/rails/railties/test/vendor/gems/dummy-gem-i-1.0.0/ext/dummy-gem-i/Makefile +0 -0
  943. data/vendor/rails/railties/test/vendor/gems/dummy-gem-i-1.0.0/lib/dummy-gem-i.rb +0 -1
  944. data/vendor/rails/railties/test/vendor/gems/dummy-gem-j-1.0.0/lib/dummy-gem-j.rb +0 -1
  945. data/vendor/rails/railties/test/vendor/gems/dummy-gem-k-1.0.0/lib/dummy-gem-k.rb +0 -1
  946. data/vendor/rails/release.rb +0 -25
@@ -171,6 +171,9 @@ HEADER
171
171
  statment_parts << (':name => ' + index.name.inspect)
172
172
  statment_parts << ':unique => true' if index.unique
173
173
 
174
+ index_lengths = index.lengths.compact if index.lengths.is_a?(Array)
175
+ statment_parts << (':length => ' + Hash[*index.columns.zip(index.lengths).flatten].inspect) if index_lengths.present?
176
+
174
177
  ' ' + statment_parts.join(', ')
175
178
  end
176
179
 
@@ -79,7 +79,7 @@ module ActiveRecord #:nodoc:
79
79
 
80
80
  def as_json(options = nil) #:nodoc:
81
81
  hash = Serializer.new(self, options).serializable_record
82
- hash = { self.class.model_name.element => hash } if include_root_in_json
82
+ hash = { options[:root] || self.class.model_name.element => hash } if include_root_in_json
83
83
  hash
84
84
  end
85
85
 
@@ -158,7 +158,7 @@ module ActiveRecord
158
158
  # If +message+ is a Symbol, it will be translated, using the appropriate scope (see translate_error).
159
159
  #
160
160
  def add(attribute, message = nil, options = {})
161
- options[:message] = options.delete(:default) if options.has_key?(:default)
161
+ options[:message] = options.delete(:default) if options[:default].is_a?(Symbol)
162
162
  error, message = message, nil if message.is_a?(Error)
163
163
 
164
164
  @errors[attribute.to_s] ||= []
@@ -239,6 +239,18 @@ module ActiveRecord
239
239
  @errors.each_key { |attr| @errors[attr].each { |error| yield attr, error.message } }
240
240
  end
241
241
 
242
+ # Yields each attribute and associated error per error added.
243
+ #
244
+ # class Company < ActiveRecord::Base
245
+ # validates_presence_of :name, :address, :email
246
+ # validates_length_of :name, :in => 5..30
247
+ # end
248
+ #
249
+ # company = Company.create(:address => '123 First St.')
250
+ # company.errors.each_error{|attr,err| puts "#{attr} - #{err.type}" }
251
+ # # => name - :too_short
252
+ # # name - :blank
253
+ # # address - :blank
242
254
  def each_error
243
255
  @errors.each_key { |attr| @errors[attr].each { |error| yield attr, error } }
244
256
  end
@@ -2,7 +2,7 @@ module ActiveRecord
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 2
4
4
  MINOR = 3
5
- TINY = 5
5
+ TINY = 8
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -15,6 +15,28 @@ class ActiveSchemaTest < ActiveRecord::TestCase
15
15
  end
16
16
  end
17
17
 
18
+ def test_add_index
19
+ # add_index calls index_exists? which can't work since execute is stubbed
20
+ ActiveRecord::ConnectionAdapters::MysqlAdapter.send(:define_method, :index_exists?) do |*|
21
+ false
22
+ end
23
+ expected = "CREATE INDEX `index_people_on_last_name` ON `people` (`last_name`)"
24
+ assert_equal expected, add_index(:people, :last_name, :length => nil)
25
+
26
+ expected = "CREATE INDEX `index_people_on_last_name` ON `people` (`last_name`(10))"
27
+ assert_equal expected, add_index(:people, :last_name, :length => 10)
28
+
29
+ expected = "CREATE INDEX `index_people_on_last_name_and_first_name` ON `people` (`last_name`(15), `first_name`(15))"
30
+ assert_equal expected, add_index(:people, [:last_name, :first_name], :length => 15)
31
+
32
+ expected = "CREATE INDEX `index_people_on_last_name_and_first_name` ON `people` (`last_name`(15), `first_name`)"
33
+ assert_equal expected, add_index(:people, [:last_name, :first_name], :length => {:last_name => 15})
34
+
35
+ expected = "CREATE INDEX `index_people_on_last_name_and_first_name` ON `people` (`last_name`(15), `first_name`(10))"
36
+ assert_equal expected, add_index(:people, [:last_name, :first_name], :length => {:last_name => 15, :first_name => 10})
37
+ ActiveRecord::ConnectionAdapters::MysqlAdapter.send(:remove_method, :index_exists?)
38
+ end
39
+
18
40
  def test_drop_table
19
41
  assert_equal "DROP TABLE `people`", drop_table(:people)
20
42
  end
@@ -31,6 +31,12 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase
31
31
  assert_equal companies(:first_firm).name, client.firm_with_primary_key.name
32
32
  end
33
33
 
34
+ def test_belongs_to_with_primary_key_joins_on_correct_column
35
+ sql = Client.send(:construct_finder_sql, :joins => :firm_with_primary_key)
36
+ assert sql !~ /\.id/
37
+ assert sql =~ /\.name/
38
+ end
39
+
34
40
  def test_proxy_assignment
35
41
  account = Account.find(1)
36
42
  assert_nothing_raised { account.firm = account.firm }
@@ -60,6 +66,13 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase
60
66
  assert_equal apple.name, citibank.firm_name
61
67
  end
62
68
 
69
+ def test_eager_loading_with_primary_key
70
+ apple = Firm.create("name" => "Apple")
71
+ citibank = Client.create("name" => "Citibank", :firm_name => "Apple")
72
+ citibank_result = Client.find(:first, :conditions => {:name => "Citibank"}, :include => :firm_with_primary_key)
73
+ assert_not_nil citibank_result.instance_variable_get("@firm_with_primary_key")
74
+ end
75
+
63
76
  def test_no_unexpected_aliasing
64
77
  first_firm = companies(:first_firm)
65
78
  another_firm = companies(:another_firm)
@@ -4,6 +4,7 @@ require 'models/author'
4
4
  require 'models/comment'
5
5
  require 'models/category'
6
6
  require 'models/categorization'
7
+ require 'active_support/core_ext/array/random_access'
7
8
 
8
9
  module Remembered
9
10
  def self.included(base)
@@ -17,7 +18,7 @@ module Remembered
17
18
 
18
19
  module ClassMethods
19
20
  def remembered; @@remembered ||= []; end
20
- def rand; @@remembered.rand; end
21
+ def random_element; @@remembered.random_element; end
21
22
  end
22
23
  end
23
24
 
@@ -81,14 +82,14 @@ class EagerLoadPolyAssocsTest < ActiveRecord::TestCase
81
82
  [Circle, Square, Triangle, NonPolyOne, NonPolyTwo].map(&:create!)
82
83
  end
83
84
  1.upto(NUM_SIMPLE_OBJS) do
84
- PaintColor.create!(:non_poly_one_id => NonPolyOne.rand.id)
85
- PaintTexture.create!(:non_poly_two_id => NonPolyTwo.rand.id)
85
+ PaintColor.create!(:non_poly_one_id => NonPolyOne.random_element.id)
86
+ PaintTexture.create!(:non_poly_two_id => NonPolyTwo.random_element.id)
86
87
  end
87
88
  1.upto(NUM_SHAPE_EXPRESSIONS) do
88
- shape_type = [Circle, Square, Triangle].rand
89
- paint_type = [PaintColor, PaintTexture].rand
90
- ShapeExpression.create!(:shape_type => shape_type.to_s, :shape_id => shape_type.rand.id,
91
- :paint_type => paint_type.to_s, :paint_id => paint_type.rand.id)
89
+ shape_type = [Circle, Square, Triangle].random_element
90
+ paint_type = [PaintColor, PaintTexture].random_element
91
+ ShapeExpression.create!(:shape_type => shape_type.to_s, :shape_id => shape_type.random_element.id,
92
+ :paint_type => paint_type.to_s, :paint_id => paint_type.random_element.id)
92
93
  end
93
94
  end
94
95
 
@@ -830,5 +830,11 @@ class EagerAssociationTest < ActiveRecord::TestCase
830
830
  assert_equal expected, firm.account_using_primary_key
831
831
  end
832
832
  end
833
-
833
+
834
+ def test_preloading_empty_polymorphic_parent
835
+ t = Tagging.create!(:taggable_type => 'Post', :taggable_id => Post.maximum(:id) + 1, :tag => tags(:general))
836
+
837
+ assert_queries(2) { @tagging = Tagging.find(t.id, :include => :taggable) }
838
+ assert_no_queries { assert ! @tagging.taggable }
839
+ end
834
840
  end
@@ -1130,5 +1130,31 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
1130
1130
  client = firm.clients_using_primary_key.create!(:name => 'test')
1131
1131
  assert_equal firm.name, client.firm_name
1132
1132
  end
1133
+
1134
+ def test_normal_method_call_in_association_proxy
1135
+ assert_equal 'Welcome to the weblog', Comment.all.map { |comment| comment.post }.sort_by(&:id).first.title
1136
+ end
1137
+
1138
+ def test_instance_eval_in_association_proxy
1139
+ assert_equal 'Welcome to the weblog', Comment.all.map { |comment| comment.post }.sort_by(&:id).first.instance_eval{title}
1140
+ end
1141
+
1142
+ def test_defining_has_many_association_with_delete_all_dependency_lazily_evaluates_target_class
1143
+ ActiveRecord::Reflection::AssociationReflection.any_instance.expects(:class_name).never
1144
+ class_eval <<-EOF
1145
+ class DeleteAllModel < ActiveRecord::Base
1146
+ has_many :nonentities, :dependent => :delete_all
1147
+ end
1148
+ EOF
1149
+ end
1150
+
1151
+ def test_defining_has_many_association_with_nullify_dependency_lazily_evaluates_target_class
1152
+ ActiveRecord::Reflection::AssociationReflection.any_instance.expects(:class_name).never
1153
+ class_eval <<-EOF
1154
+ class NullifyModel < ActiveRecord::Base
1155
+ has_many :nonentities, :dependent => :nullify
1156
+ end
1157
+ EOF
1158
+ end
1133
1159
  end
1134
1160
 
@@ -0,0 +1,566 @@
1
+ require "cases/helper"
2
+ require 'models/man'
3
+ require 'models/face'
4
+ require 'models/interest'
5
+ require 'models/zine'
6
+ require 'models/club'
7
+ require 'models/sponsor'
8
+
9
+ class InverseAssociationTests < ActiveRecord::TestCase
10
+ def test_should_allow_for_inverse_of_options_in_associations
11
+ assert_nothing_raised(ArgumentError, 'ActiveRecord should allow the inverse_of options on has_many') do
12
+ Class.new(ActiveRecord::Base).has_many(:wheels, :inverse_of => :car)
13
+ end
14
+
15
+ assert_nothing_raised(ArgumentError, 'ActiveRecord should allow the inverse_of options on has_one') do
16
+ Class.new(ActiveRecord::Base).has_one(:engine, :inverse_of => :car)
17
+ end
18
+
19
+ assert_nothing_raised(ArgumentError, 'ActiveRecord should allow the inverse_of options on belongs_to') do
20
+ Class.new(ActiveRecord::Base).belongs_to(:car, :inverse_of => :driver)
21
+ end
22
+ end
23
+
24
+ def test_should_be_able_to_ask_a_reflection_if_it_has_an_inverse
25
+ has_one_with_inverse_ref = Man.reflect_on_association(:face)
26
+ assert has_one_with_inverse_ref.respond_to?(:has_inverse?)
27
+ assert has_one_with_inverse_ref.has_inverse?
28
+
29
+ has_many_with_inverse_ref = Man.reflect_on_association(:interests)
30
+ assert has_many_with_inverse_ref.respond_to?(:has_inverse?)
31
+ assert has_many_with_inverse_ref.has_inverse?
32
+
33
+ belongs_to_with_inverse_ref = Face.reflect_on_association(:man)
34
+ assert belongs_to_with_inverse_ref.respond_to?(:has_inverse?)
35
+ assert belongs_to_with_inverse_ref.has_inverse?
36
+
37
+ has_one_without_inverse_ref = Club.reflect_on_association(:sponsor)
38
+ assert has_one_without_inverse_ref.respond_to?(:has_inverse?)
39
+ assert !has_one_without_inverse_ref.has_inverse?
40
+
41
+ has_many_without_inverse_ref = Club.reflect_on_association(:memberships)
42
+ assert has_many_without_inverse_ref.respond_to?(:has_inverse?)
43
+ assert !has_many_without_inverse_ref.has_inverse?
44
+
45
+ belongs_to_without_inverse_ref = Sponsor.reflect_on_association(:sponsor_club)
46
+ assert belongs_to_without_inverse_ref.respond_to?(:has_inverse?)
47
+ assert !belongs_to_without_inverse_ref.has_inverse?
48
+ end
49
+
50
+ def test_should_be_able_to_ask_a_reflection_what_it_is_the_inverse_of
51
+ has_one_ref = Man.reflect_on_association(:face)
52
+ assert has_one_ref.respond_to?(:inverse_of)
53
+
54
+ has_many_ref = Man.reflect_on_association(:interests)
55
+ assert has_many_ref.respond_to?(:inverse_of)
56
+
57
+ belongs_to_ref = Face.reflect_on_association(:man)
58
+ assert belongs_to_ref.respond_to?(:inverse_of)
59
+ end
60
+
61
+ def test_inverse_of_method_should_supply_the_actual_reflection_instance_it_is_the_inverse_of
62
+ has_one_ref = Man.reflect_on_association(:face)
63
+ assert_equal Face.reflect_on_association(:man), has_one_ref.inverse_of
64
+
65
+ has_many_ref = Man.reflect_on_association(:interests)
66
+ assert_equal Interest.reflect_on_association(:man), has_many_ref.inverse_of
67
+
68
+ belongs_to_ref = Face.reflect_on_association(:man)
69
+ assert_equal Man.reflect_on_association(:face), belongs_to_ref.inverse_of
70
+ end
71
+
72
+ def test_associations_with_no_inverse_of_should_return_nil
73
+ has_one_ref = Club.reflect_on_association(:sponsor)
74
+ assert_nil has_one_ref.inverse_of
75
+
76
+ has_many_ref = Club.reflect_on_association(:memberships)
77
+ assert_nil has_many_ref.inverse_of
78
+
79
+ belongs_to_ref = Sponsor.reflect_on_association(:sponsor_club)
80
+ assert_nil belongs_to_ref.inverse_of
81
+ end
82
+ end
83
+
84
+ class InverseHasOneTests < ActiveRecord::TestCase
85
+ fixtures :men, :faces
86
+
87
+ def test_parent_instance_should_be_shared_with_child_on_find
88
+ m = men(:gordon)
89
+ f = m.face
90
+ assert_equal m.name, f.man.name, "Name of man should be the same before changes to parent instance"
91
+ m.name = 'Bongo'
92
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to parent instance"
93
+ f.man.name = 'Mungo'
94
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to child-owned instance"
95
+ end
96
+
97
+ def test_parent_instance_should_be_shared_with_eager_loaded_child_on_find
98
+ m = Man.find(:first, :conditions => {:name => 'Gordon'}, :include => :face)
99
+ f = m.face
100
+ assert_equal m.name, f.man.name, "Name of man should be the same before changes to parent instance"
101
+ m.name = 'Bongo'
102
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to parent instance"
103
+ f.man.name = 'Mungo'
104
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to child-owned instance"
105
+
106
+ m = Man.find(:first, :conditions => {:name => 'Gordon'}, :include => :face, :order => 'faces.id')
107
+ f = m.face
108
+ assert_equal m.name, f.man.name, "Name of man should be the same before changes to parent instance"
109
+ m.name = 'Bongo'
110
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to parent instance"
111
+ f.man.name = 'Mungo'
112
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to child-owned instance"
113
+ end
114
+
115
+ def test_parent_instance_should_be_shared_with_newly_built_child
116
+ m = men(:gordon)
117
+ f = m.build_face(:description => 'haunted')
118
+ assert_not_nil f.man
119
+ assert_equal m.name, f.man.name, "Name of man should be the same before changes to parent instance"
120
+ m.name = 'Bongo'
121
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to parent instance"
122
+ f.man.name = 'Mungo'
123
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to just-built-child-owned instance"
124
+ end
125
+
126
+ def test_parent_instance_should_be_shared_with_newly_created_child
127
+ m = men(:gordon)
128
+ f = m.create_face(:description => 'haunted')
129
+ assert_not_nil f.man
130
+ assert_equal m.name, f.man.name, "Name of man should be the same before changes to parent instance"
131
+ m.name = 'Bongo'
132
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to parent instance"
133
+ f.man.name = 'Mungo'
134
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to newly-created-child-owned instance"
135
+ end
136
+
137
+ def test_parent_instance_should_be_shared_with_newly_created_child_via_bang_method
138
+ m = Man.find(:first)
139
+ f = m.face.create!(:description => 'haunted')
140
+ assert_not_nil f.man
141
+ assert_equal m.name, f.man.name, "Name of man should be the same before changes to parent instance"
142
+ m.name = 'Bongo'
143
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to parent instance"
144
+ f.man.name = 'Mungo'
145
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to newly-created-child-owned instance"
146
+ end
147
+
148
+ def test_parent_instance_should_be_shared_with_newly_built_child_when_we_dont_replace_existing
149
+ m = Man.find(:first)
150
+ f = m.build_face({:description => 'haunted'}, false)
151
+ assert_not_nil f.man
152
+ assert_equal m.name, f.man.name, "Name of man should be the same before changes to parent instance"
153
+ m.name = 'Bongo'
154
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to parent instance"
155
+ f.man.name = 'Mungo'
156
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to just-built-child-owned instance"
157
+ end
158
+
159
+ def test_parent_instance_should_be_shared_with_newly_created_child_when_we_dont_replace_existing
160
+ m = Man.find(:first)
161
+ f = m.create_face({:description => 'haunted'}, false)
162
+ assert_not_nil f.man
163
+ assert_equal m.name, f.man.name, "Name of man should be the same before changes to parent instance"
164
+ m.name = 'Bongo'
165
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to parent instance"
166
+ f.man.name = 'Mungo'
167
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to newly-created-child-owned instance"
168
+ end
169
+
170
+ def test_parent_instance_should_be_shared_with_newly_created_child_via_bang_method_when_we_dont_replace_existing
171
+ m = Man.find(:first)
172
+ f = m.face.create!({:description => 'haunted'}, false)
173
+ assert_not_nil f.man
174
+ assert_equal m.name, f.man.name, "Name of man should be the same before changes to parent instance"
175
+ m.name = 'Bongo'
176
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to parent instance"
177
+ f.man.name = 'Mungo'
178
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to newly-created-child-owned instance"
179
+ end
180
+
181
+ def test_parent_instance_should_be_shared_with_replaced_via_accessor_child
182
+ m = Man.find(:first)
183
+ f = Face.new(:description => 'haunted')
184
+ m.face = f
185
+ assert_not_nil f.man
186
+ assert_equal m.name, f.man.name, "Name of man should be the same before changes to parent instance"
187
+ m.name = 'Bongo'
188
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to parent instance"
189
+ f.man.name = 'Mungo'
190
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to replaced-child-owned instance"
191
+ end
192
+
193
+ def test_parent_instance_should_be_shared_with_replaced_via_method_child
194
+ m = Man.find(:first)
195
+ f = Face.new(:description => 'haunted')
196
+ m.face.replace(f)
197
+ assert_not_nil f.man
198
+ assert_equal m.name, f.man.name, "Name of man should be the same before changes to parent instance"
199
+ m.name = 'Bongo'
200
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to parent instance"
201
+ f.man.name = 'Mungo'
202
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to replaced-child-owned instance"
203
+ end
204
+
205
+ def test_parent_instance_should_be_shared_with_replaced_via_method_child_when_we_dont_replace_existing
206
+ m = Man.find(:first)
207
+ f = Face.new(:description => 'haunted')
208
+ m.face.replace(f, false)
209
+ assert_not_nil f.man
210
+ assert_equal m.name, f.man.name, "Name of man should be the same before changes to parent instance"
211
+ m.name = 'Bongo'
212
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to parent instance"
213
+ f.man.name = 'Mungo'
214
+ assert_equal m.name, f.man.name, "Name of man should be the same after changes to replaced-child-owned instance"
215
+ end
216
+
217
+ def test_trying_to_use_inverses_that_dont_exist_should_raise_an_error
218
+ assert_raise(ActiveRecord::InverseOfAssociationNotFoundError) { Man.find(:first).dirty_face }
219
+ end
220
+ end
221
+
222
+ class InverseHasManyTests < ActiveRecord::TestCase
223
+ fixtures :men, :interests
224
+
225
+ def test_parent_instance_should_be_shared_with_every_child_on_find
226
+ m = men(:gordon)
227
+ is = m.interests
228
+ is.each do |i|
229
+ assert_equal m.name, i.man.name, "Name of man should be the same before changes to parent instance"
230
+ m.name = 'Bongo'
231
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to parent instance"
232
+ i.man.name = 'Mungo'
233
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to child-owned instance"
234
+ end
235
+ end
236
+
237
+ def test_parent_instance_should_be_shared_with_eager_loaded_children
238
+ m = Man.find(:first, :conditions => {:name => 'Gordon'}, :include => :interests)
239
+ is = m.interests
240
+ is.each do |i|
241
+ assert_equal m.name, i.man.name, "Name of man should be the same before changes to parent instance"
242
+ m.name = 'Bongo'
243
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to parent instance"
244
+ i.man.name = 'Mungo'
245
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to child-owned instance"
246
+ end
247
+
248
+ m = Man.find(:first, :conditions => {:name => 'Gordon'}, :include => :interests, :order => 'interests.id')
249
+ is = m.interests
250
+ is.each do |i|
251
+ assert_equal m.name, i.man.name, "Name of man should be the same before changes to parent instance"
252
+ m.name = 'Bongo'
253
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to parent instance"
254
+ i.man.name = 'Mungo'
255
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to child-owned instance"
256
+ end
257
+ end
258
+
259
+ def test_parent_instance_should_be_shared_with_newly_built_child
260
+ m = men(:gordon)
261
+ i = m.interests.build(:topic => 'Industrial Revolution Re-enactment')
262
+ assert_not_nil i.man
263
+ assert_equal m.name, i.man.name, "Name of man should be the same before changes to parent instance"
264
+ m.name = 'Bongo'
265
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to parent instance"
266
+ i.man.name = 'Mungo'
267
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to just-built-child-owned instance"
268
+ end
269
+
270
+ def test_parent_instance_should_be_shared_with_newly_block_style_built_child
271
+ m = Man.find(:first)
272
+ i = m.interests.build {|ii| ii.topic = 'Industrial Revolution Re-enactment'}
273
+ assert_not_nil i.topic, "Child attributes supplied to build via blocks should be populated"
274
+ assert_not_nil i.man
275
+ assert_equal m.name, i.man.name, "Name of man should be the same before changes to parent instance"
276
+ m.name = 'Bongo'
277
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to parent instance"
278
+ i.man.name = 'Mungo'
279
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to just-built-child-owned instance"
280
+ end
281
+
282
+ def test_parent_instance_should_be_shared_with_newly_created_child
283
+ m = men(:gordon)
284
+ i = m.interests.create(:topic => 'Industrial Revolution Re-enactment')
285
+ assert_not_nil i.man
286
+ assert_equal m.name, i.man.name, "Name of man should be the same before changes to parent instance"
287
+ m.name = 'Bongo'
288
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to parent instance"
289
+ i.man.name = 'Mungo'
290
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to newly-created-child-owned instance"
291
+ end
292
+
293
+ def test_parent_instance_should_be_shared_with_newly_created_via_bang_method_child
294
+ m = Man.find(:first)
295
+ i = m.interests.create!(:topic => 'Industrial Revolution Re-enactment')
296
+ assert_not_nil i.man
297
+ assert_equal m.name, i.man.name, "Name of man should be the same before changes to parent instance"
298
+ m.name = 'Bongo'
299
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to parent instance"
300
+ i.man.name = 'Mungo'
301
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to newly-created-child-owned instance"
302
+ end
303
+
304
+ def test_parent_instance_should_be_shared_with_newly_block_style_created_child
305
+ m = Man.find(:first)
306
+ i = m.interests.create {|ii| ii.topic = 'Industrial Revolution Re-enactment'}
307
+ assert_not_nil i.topic, "Child attributes supplied to create via blocks should be populated"
308
+ assert_not_nil i.man
309
+ assert_equal m.name, i.man.name, "Name of man should be the same before changes to parent instance"
310
+ m.name = 'Bongo'
311
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to parent instance"
312
+ i.man.name = 'Mungo'
313
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to newly-created-child-owned instance"
314
+ end
315
+
316
+ def test_parent_instance_should_be_shared_with_poked_in_child
317
+ m = men(:gordon)
318
+ i = Interest.create(:topic => 'Industrial Revolution Re-enactment')
319
+ m.interests << i
320
+ assert_not_nil i.man
321
+ assert_equal m.name, i.man.name, "Name of man should be the same before changes to parent instance"
322
+ m.name = 'Bongo'
323
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to parent instance"
324
+ i.man.name = 'Mungo'
325
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to newly-created-child-owned instance"
326
+ end
327
+
328
+ def test_parent_instance_should_be_shared_with_replaced_via_accessor_children
329
+ m = Man.find(:first)
330
+ i = Interest.new(:topic => 'Industrial Revolution Re-enactment')
331
+ m.interests = [i]
332
+ assert_not_nil i.man
333
+ assert_equal m.name, i.man.name, "Name of man should be the same before changes to parent instance"
334
+ m.name = 'Bongo'
335
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to parent instance"
336
+ i.man.name = 'Mungo'
337
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to replaced-child-owned instance"
338
+ end
339
+
340
+ def test_parent_instance_should_be_shared_with_replaced_via_method_children
341
+ m = Man.find(:first)
342
+ i = Interest.new(:topic => 'Industrial Revolution Re-enactment')
343
+ m.interests.replace([i])
344
+ assert_not_nil i.man
345
+ assert_equal m.name, i.man.name, "Name of man should be the same before changes to parent instance"
346
+ m.name = 'Bongo'
347
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to parent instance"
348
+ i.man.name = 'Mungo'
349
+ assert_equal m.name, i.man.name, "Name of man should be the same after changes to replaced-child-owned instance"
350
+ end
351
+
352
+ def test_trying_to_use_inverses_that_dont_exist_should_raise_an_error
353
+ assert_raise(ActiveRecord::InverseOfAssociationNotFoundError) { Man.find(:first).secret_interests }
354
+ end
355
+ end
356
+
357
+ class InverseBelongsToTests < ActiveRecord::TestCase
358
+ fixtures :men, :faces, :interests
359
+
360
+ def test_child_instance_should_be_shared_with_parent_on_find
361
+ f = faces(:trusting)
362
+ m = f.man
363
+ assert_equal f.description, m.face.description, "Description of face should be the same before changes to child instance"
364
+ f.description = 'gormless'
365
+ assert_equal f.description, m.face.description, "Description of face should be the same after changes to child instance"
366
+ m.face.description = 'pleasing'
367
+ assert_equal f.description, m.face.description, "Description of face should be the same after changes to parent-owned instance"
368
+ end
369
+
370
+ def test_eager_loaded_child_instance_should_be_shared_with_parent_on_find
371
+ f = Face.find(:first, :include => :man, :conditions => {:description => 'trusting'})
372
+ m = f.man
373
+ assert_equal f.description, m.face.description, "Description of face should be the same before changes to child instance"
374
+ f.description = 'gormless'
375
+ assert_equal f.description, m.face.description, "Description of face should be the same after changes to child instance"
376
+ m.face.description = 'pleasing'
377
+ assert_equal f.description, m.face.description, "Description of face should be the same after changes to parent-owned instance"
378
+
379
+ f = Face.find(:first, :include => :man, :order => 'men.id', :conditions => {:description => 'trusting'})
380
+ m = f.man
381
+ assert_equal f.description, m.face.description, "Description of face should be the same before changes to child instance"
382
+ f.description = 'gormless'
383
+ assert_equal f.description, m.face.description, "Description of face should be the same after changes to child instance"
384
+ m.face.description = 'pleasing'
385
+ assert_equal f.description, m.face.description, "Description of face should be the same after changes to parent-owned instance"
386
+ end
387
+
388
+ def test_child_instance_should_be_shared_with_newly_built_parent
389
+ f = faces(:trusting)
390
+ m = f.build_man(:name => 'Charles')
391
+ assert_not_nil m.face
392
+ assert_equal f.description, m.face.description, "Description of face should be the same before changes to child instance"
393
+ f.description = 'gormless'
394
+ assert_equal f.description, m.face.description, "Description of face should be the same after changes to child instance"
395
+ m.face.description = 'pleasing'
396
+ assert_equal f.description, m.face.description, "Description of face should be the same after changes to just-built-parent-owned instance"
397
+ end
398
+
399
+ def test_child_instance_should_be_shared_with_newly_created_parent
400
+ f = faces(:trusting)
401
+ m = f.create_man(:name => 'Charles')
402
+ assert_not_nil m.face
403
+ assert_equal f.description, m.face.description, "Description of face should be the same before changes to child instance"
404
+ f.description = 'gormless'
405
+ assert_equal f.description, m.face.description, "Description of face should be the same after changes to child instance"
406
+ m.face.description = 'pleasing'
407
+ assert_equal f.description, m.face.description, "Description of face should be the same after changes to newly-created-parent-owned instance"
408
+ end
409
+
410
+ def test_should_not_try_to_set_inverse_instances_when_the_inverse_is_a_has_many
411
+ i = interests(:trainspotting)
412
+ m = i.man
413
+ assert_not_nil m.interests
414
+ iz = m.interests.detect {|iz| iz.id == i.id}
415
+ assert_not_nil iz
416
+ assert_equal i.topic, iz.topic, "Interest topics should be the same before changes to child"
417
+ i.topic = 'Eating cheese with a spoon'
418
+ assert_not_equal i.topic, iz.topic, "Interest topics should not be the same after changes to child"
419
+ iz.topic = 'Cow tipping'
420
+ assert_not_equal i.topic, iz.topic, "Interest topics should not be the same after changes to parent-owned instance"
421
+ end
422
+
423
+ def test_child_instance_should_be_shared_with_replaced_via_accessor_parent
424
+ f = Face.find(:first)
425
+ m = Man.new(:name => 'Charles')
426
+ f.man = m
427
+ assert_not_nil m.face
428
+ assert_equal f.description, m.face.description, "Description of face should be the same before changes to child instance"
429
+ f.description = 'gormless'
430
+ assert_equal f.description, m.face.description, "Description of face should be the same after changes to child instance"
431
+ m.face.description = 'pleasing'
432
+ assert_equal f.description, m.face.description, "Description of face should be the same after changes to replaced-parent-owned instance"
433
+ end
434
+
435
+ def test_child_instance_should_be_shared_with_replaced_via_method_parent
436
+ f = faces(:trusting)
437
+ assert_not_nil f.man
438
+ m = Man.new(:name => 'Charles')
439
+ f.man.replace(m)
440
+ assert_not_nil m.face
441
+ assert_equal f.description, m.face.description, "Description of face should be the same before changes to child instance"
442
+ f.description = 'gormless'
443
+ assert_equal f.description, m.face.description, "Description of face should be the same after changes to child instance"
444
+ m.face.description = 'pleasing'
445
+ assert_equal f.description, m.face.description, "Description of face should be the same after changes to replaced-parent-owned instance"
446
+ end
447
+
448
+ def test_trying_to_use_inverses_that_dont_exist_should_raise_an_error
449
+ assert_raise(ActiveRecord::InverseOfAssociationNotFoundError) { Face.find(:first).horrible_man }
450
+ end
451
+ end
452
+
453
+ class InversePolymorphicBelongsToTests < ActiveRecord::TestCase
454
+ fixtures :men, :faces, :interests
455
+
456
+ def test_child_instance_should_be_shared_with_parent_on_find
457
+ f = Face.find(:first, :conditions => {:description => 'confused'})
458
+ m = f.polymorphic_man
459
+ assert_equal f.description, m.polymorphic_face.description, "Description of face should be the same before changes to child instance"
460
+ f.description = 'gormless'
461
+ assert_equal f.description, m.polymorphic_face.description, "Description of face should be the same after changes to child instance"
462
+ m.polymorphic_face.description = 'pleasing'
463
+ assert_equal f.description, m.polymorphic_face.description, "Description of face should be the same after changes to parent-owned instance"
464
+ end
465
+
466
+ def test_eager_loaded_child_instance_should_be_shared_with_parent_on_find
467
+ f = Face.find(:first, :conditions => {:description => 'confused'}, :include => :man)
468
+ m = f.polymorphic_man
469
+ assert_equal f.description, m.polymorphic_face.description, "Description of face should be the same before changes to child instance"
470
+ f.description = 'gormless'
471
+ assert_equal f.description, m.polymorphic_face.description, "Description of face should be the same after changes to child instance"
472
+ m.polymorphic_face.description = 'pleasing'
473
+ assert_equal f.description, m.polymorphic_face.description, "Description of face should be the same after changes to parent-owned instance"
474
+
475
+ f = Face.find(:first, :conditions => {:description => 'confused'}, :include => :man, :order => 'men.id')
476
+ m = f.polymorphic_man
477
+ assert_equal f.description, m.polymorphic_face.description, "Description of face should be the same before changes to child instance"
478
+ f.description = 'gormless'
479
+ assert_equal f.description, m.polymorphic_face.description, "Description of face should be the same after changes to child instance"
480
+ m.polymorphic_face.description = 'pleasing'
481
+ assert_equal f.description, m.polymorphic_face.description, "Description of face should be the same after changes to parent-owned instance"
482
+ end
483
+
484
+ def test_child_instance_should_be_shared_with_replaced_via_accessor_parent
485
+ face = faces(:confused)
486
+ old_man = face.polymorphic_man
487
+ new_man = Man.new
488
+
489
+ assert_not_nil face.polymorphic_man
490
+ face.polymorphic_man = new_man
491
+
492
+ assert_equal face.description, new_man.polymorphic_face.description, "Description of face should be the same before changes to parent instance"
493
+ face.description = 'Bongo'
494
+ assert_equal face.description, new_man.polymorphic_face.description, "Description of face should be the same after changes to parent instance"
495
+ new_man.polymorphic_face.description = 'Mungo'
496
+ assert_equal face.description, new_man.polymorphic_face.description, "Description of face should be the same after changes to replaced-parent-owned instance"
497
+ end
498
+
499
+ def test_child_instance_should_be_shared_with_replaced_via_method_parent
500
+ face = faces(:confused)
501
+ old_man = face.polymorphic_man
502
+ new_man = Man.new
503
+
504
+ assert_not_nil face.polymorphic_man
505
+ face.polymorphic_man.replace(new_man)
506
+
507
+ assert_equal face.description, new_man.polymorphic_face.description, "Description of face should be the same before changes to parent instance"
508
+ face.description = 'Bongo'
509
+ assert_equal face.description, new_man.polymorphic_face.description, "Description of face should be the same after changes to parent instance"
510
+ new_man.polymorphic_face.description = 'Mungo'
511
+ assert_equal face.description, new_man.polymorphic_face.description, "Description of face should be the same after changes to replaced-parent-owned instance"
512
+ end
513
+
514
+ def test_should_not_try_to_set_inverse_instances_when_the_inverse_is_a_has_many
515
+ i = interests(:llama_wrangling)
516
+ m = i.polymorphic_man
517
+ assert_not_nil m.polymorphic_interests
518
+ iz = m.polymorphic_interests.detect {|iz| iz.id == i.id}
519
+ assert_not_nil iz
520
+ assert_equal i.topic, iz.topic, "Interest topics should be the same before changes to child"
521
+ i.topic = 'Eating cheese with a spoon'
522
+ assert_not_equal i.topic, iz.topic, "Interest topics should not be the same after changes to child"
523
+ iz.topic = 'Cow tipping'
524
+ assert_not_equal i.topic, iz.topic, "Interest topics should not be the same after changes to parent-owned instance"
525
+ end
526
+
527
+ def test_trying_to_access_inverses_that_dont_exist_shouldnt_raise_an_error
528
+ # Ideally this would, if only for symmetry's sake with other association types
529
+ assert_nothing_raised(ActiveRecord::InverseOfAssociationNotFoundError) { Face.find(:first).horrible_polymorphic_man }
530
+ end
531
+
532
+ def test_trying_to_set_polymorphic_inverses_that_dont_exist_at_all_should_raise_an_error
533
+ # fails because no class has the correct inverse_of for horrible_polymorphic_man
534
+ assert_raise(ActiveRecord::InverseOfAssociationNotFoundError) { Face.find(:first).horrible_polymorphic_man = Man.first }
535
+ end
536
+
537
+ def test_trying_to_set_polymorphic_inverses_that_dont_exist_on_the_instance_being_set_should_raise_an_error
538
+ # passes because Man does have the correct inverse_of
539
+ assert_nothing_raised(ActiveRecord::InverseOfAssociationNotFoundError) { Face.find(:first).polymorphic_man = Man.first }
540
+ # fails because Interest does have the correct inverse_of
541
+ assert_raise(ActiveRecord::InverseOfAssociationNotFoundError) { Face.find(:first).polymorphic_man = Interest.first }
542
+ end
543
+ end
544
+
545
+ # NOTE - these tests might not be meaningful, ripped as they were from the parental_control plugin
546
+ # which would guess the inverse rather than look for an explicit configuration option.
547
+ class InverseMultipleHasManyInversesForSameModel < ActiveRecord::TestCase
548
+ fixtures :men, :interests, :zines
549
+
550
+ def test_that_we_can_load_associations_that_have_the_same_reciprocal_name_from_different_models
551
+ assert_nothing_raised(ActiveRecord::AssociationTypeMismatch) do
552
+ i = Interest.find(:first)
553
+ z = i.zine
554
+ m = i.man
555
+ end
556
+ end
557
+
558
+ def test_that_we_can_create_associations_that_have_the_same_reciprocal_name_from_different_models
559
+ assert_nothing_raised(ActiveRecord::AssociationTypeMismatch) do
560
+ i = Interest.find(:first)
561
+ i.build_zine(:title => 'Get Some in Winter! 2008')
562
+ i.build_man(:name => 'Gordon')
563
+ i.save!
564
+ end
565
+ end
566
+ end