antfarm 0.4.0 → 0.5.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1694) hide show
  1. data/README.md +160 -0
  2. data/bin/antfarm +134 -152
  3. data/lib/antfarm.rb +32 -246
  4. data/lib/antfarm/cli.rb +36 -0
  5. data/lib/antfarm/cli/console.rb +57 -0
  6. data/lib/antfarm/cli/framework.rb +136 -0
  7. data/lib/antfarm/cli/plugin.rb +64 -0
  8. data/lib/antfarm/cli/ui.rb +32 -0
  9. data/lib/antfarm/cli/ui/console.rb +32 -0
  10. data/lib/antfarm/cli/ui/console/table.rb +113 -0
  11. data/lib/antfarm/cli/version.rb +11 -0
  12. data/man/antfarm.1 +200 -0
  13. data/man/antfarm.1.ronn +132 -0
  14. metadata +83 -2072
  15. data/CHANGELOG +0 -29
  16. data/LICENSE +0 -504
  17. data/README.rdoc +0 -217
  18. data/config/boot.rb +0 -43
  19. data/config/environment.rb +0 -29
  20. data/db/migrate/001_create_nodes.rb +0 -33
  21. data/db/migrate/002_create_layer2_interfaces.rb +0 -33
  22. data/db/migrate/003_create_layer3_interfaces.rb +0 -34
  23. data/db/migrate/004_create_layer3_networks.rb +0 -32
  24. data/db/migrate/005_create_ethernet_interfaces.rb +0 -31
  25. data/db/migrate/006_create_ip_interfaces.rb +0 -31
  26. data/db/migrate/007_create_ip_networks.rb +0 -33
  27. data/db/migrate/008_create_private_networks.rb +0 -31
  28. data/db/migrate/009_create_traffic.rb +0 -35
  29. data/db/migrate/010_create_dns_entries.rb +0 -32
  30. data/db/migrate/011_create_actions.rb +0 -34
  31. data/db/migrate/012_create_services.rb +0 -36
  32. data/db/migrate/013_create_operating_systems.rb +0 -34
  33. data/db/schema.rb +0 -92
  34. data/lib/antfarm.jar +0 -0
  35. data/lib/antfarm/action.rb +0 -29
  36. data/lib/antfarm/dns_entry.rb +0 -23
  37. data/lib/antfarm/ethernet_interface.rb +0 -91
  38. data/lib/antfarm/ip_interface.rb +0 -189
  39. data/lib/antfarm/ip_network.rb +0 -109
  40. data/lib/antfarm/layer2_interface.rb +0 -111
  41. data/lib/antfarm/layer3_interface.rb +0 -140
  42. data/lib/antfarm/layer3_network.rb +0 -126
  43. data/lib/antfarm/node.rb +0 -84
  44. data/lib/antfarm/operating_system.rb +0 -25
  45. data/lib/antfarm/private_network.rb +0 -34
  46. data/lib/antfarm/service.rb +0 -25
  47. data/lib/antfarm/traffic.rb +0 -32
  48. data/lib/console.rb +0 -9
  49. data/lib/cpscript.rb +0 -70
  50. data/lib/dbmanage.rb +0 -164
  51. data/lib/init/initializer.rb +0 -129
  52. data/lib/scparse.rb +0 -345
  53. data/lib/scripts/cisco/parse-arp.rb +0 -66
  54. data/lib/scripts/cisco/parse-ip-ifaces.rb +0 -116
  55. data/lib/scripts/cisco/parse-network-objects.rb +0 -80
  56. data/lib/scripts/cisco/parse-pix-config.rb +0 -254
  57. data/lib/scripts/cisco/parse-routes.rb +0 -84
  58. data/lib/scripts/load-host.rb +0 -51
  59. data/lib/scripts/load-network.rb +0 -51
  60. data/lib/scripts/manipulate-dns.rb +0 -87
  61. data/lib/scripts/nmap/parse-xml.rb +0 -147
  62. data/lib/scripts/pcap/parse-pcap-file.rb +0 -126
  63. data/lib/scripts/viz/display-networks.rb +0 -88
  64. data/lib/scripts/viz/display-traffic.rb +0 -111
  65. data/lib/scripts/viz/dump-graphml.rb +0 -219
  66. data/lib/scripts/viz/dump-graphviz.rb +0 -136
  67. data/lib/version.rb +0 -5
  68. data/log/antfarm.log +0 -0
  69. data/rails/app/controllers/actions_controller.rb +0 -5
  70. data/rails/app/controllers/application.rb +0 -10
  71. data/rails/app/controllers/dns_entries_controller.rb +0 -4
  72. data/rails/app/controllers/ethernet_interfaces_controller.rb +0 -4
  73. data/rails/app/controllers/ip_interfaces_controller.rb +0 -4
  74. data/rails/app/controllers/ip_networks_controller.rb +0 -4
  75. data/rails/app/controllers/layer2_interfaces_controller.rb +0 -6
  76. data/rails/app/controllers/layer3_interfaces_controller.rb +0 -6
  77. data/rails/app/controllers/layer3_networks_controller.rb +0 -4
  78. data/rails/app/controllers/nodes_controller.rb +0 -9
  79. data/rails/app/controllers/operating_systems_controller.rb +0 -5
  80. data/rails/app/controllers/private_networks_controller.rb +0 -4
  81. data/rails/app/controllers/services_controller.rb +0 -5
  82. data/rails/app/controllers/traffic_controller.rb +0 -5
  83. data/rails/app/views/layouts/application.html.erb +0 -35
  84. data/rails/config/boot.rb +0 -145
  85. data/rails/config/environment.rb +0 -62
  86. data/rails/config/environments/development.rb +0 -17
  87. data/rails/config/initializers/inflections.rb +0 -10
  88. data/rails/config/initializers/mime_types.rb +0 -5
  89. data/rails/config/routes.rb +0 -36
  90. data/rails/public/404.html +0 -30
  91. data/rails/public/422.html +0 -30
  92. data/rails/public/500.html +0 -30
  93. data/rails/public/blank.html +0 -33
  94. data/rails/public/dispatch.cgi +0 -10
  95. data/rails/public/dispatch.fcgi +0 -24
  96. data/rails/public/dispatch.rb +0 -10
  97. data/rails/public/favicon.ico +0 -0
  98. data/rails/public/images/active_scaffold/DO_NOT_EDIT +0 -2
  99. data/rails/public/images/active_scaffold/default/add.gif +0 -0
  100. data/rails/public/images/active_scaffold/default/arrow_down.gif +0 -0
  101. data/rails/public/images/active_scaffold/default/arrow_up.gif +0 -0
  102. data/rails/public/images/active_scaffold/default/close.gif +0 -0
  103. data/rails/public/images/active_scaffold/default/cross.png +0 -0
  104. data/rails/public/images/active_scaffold/default/indicator-small.gif +0 -0
  105. data/rails/public/images/active_scaffold/default/indicator.gif +0 -0
  106. data/rails/public/images/active_scaffold/default/magnifier.png +0 -0
  107. data/rails/public/images/rails.png +0 -0
  108. data/rails/public/javascripts/active_scaffold/DO_NOT_EDIT +0 -2
  109. data/rails/public/javascripts/active_scaffold/default/active_scaffold.js +0 -418
  110. data/rails/public/javascripts/active_scaffold/default/dhtml_history.js +0 -942
  111. data/rails/public/javascripts/active_scaffold/default/form_enhancements.js +0 -89
  112. data/rails/public/javascripts/active_scaffold/default/rico_corner.js +0 -370
  113. data/rails/public/javascripts/application.js +0 -2
  114. data/rails/public/javascripts/controls.js +0 -963
  115. data/rails/public/javascripts/dragdrop.js +0 -972
  116. data/rails/public/javascripts/effects.js +0 -1120
  117. data/rails/public/javascripts/prototype.js +0 -4225
  118. data/rails/public/robots.txt +0 -5
  119. data/rails/public/stylesheets/active_scaffold/DO_NOT_EDIT +0 -2
  120. data/rails/public/stylesheets/active_scaffold/default/stylesheet-ie.css +0 -35
  121. data/rails/public/stylesheets/active_scaffold/default/stylesheet.css +0 -770
  122. data/rails/public/stylesheets/site.css +0 -11
  123. data/rails/script/server +0 -3
  124. data/rails/vendor/plugins/active_scaffold/CHANGELOG +0 -151
  125. data/rails/vendor/plugins/active_scaffold/MIT-LICENSE +0 -20
  126. data/rails/vendor/plugins/active_scaffold/README +0 -19
  127. data/rails/vendor/plugins/active_scaffold/Rakefile +0 -24
  128. data/rails/vendor/plugins/active_scaffold/environment.rb +0 -83
  129. data/rails/vendor/plugins/active_scaffold/frontends/default/images/add.gif +0 -0
  130. data/rails/vendor/plugins/active_scaffold/frontends/default/images/arrow_down.gif +0 -0
  131. data/rails/vendor/plugins/active_scaffold/frontends/default/images/arrow_up.gif +0 -0
  132. data/rails/vendor/plugins/active_scaffold/frontends/default/images/close.gif +0 -0
  133. data/rails/vendor/plugins/active_scaffold/frontends/default/images/cross.png +0 -0
  134. data/rails/vendor/plugins/active_scaffold/frontends/default/images/indicator-small.gif +0 -0
  135. data/rails/vendor/plugins/active_scaffold/frontends/default/images/indicator.gif +0 -0
  136. data/rails/vendor/plugins/active_scaffold/frontends/default/images/magnifier.png +0 -0
  137. data/rails/vendor/plugins/active_scaffold/frontends/default/javascripts/active_scaffold.js +0 -418
  138. data/rails/vendor/plugins/active_scaffold/frontends/default/javascripts/dhtml_history.js +0 -942
  139. data/rails/vendor/plugins/active_scaffold/frontends/default/javascripts/form_enhancements.js +0 -89
  140. data/rails/vendor/plugins/active_scaffold/frontends/default/javascripts/rico_corner.js +0 -370
  141. data/rails/vendor/plugins/active_scaffold/frontends/default/stylesheets/stylesheet-ie.css +0 -35
  142. data/rails/vendor/plugins/active_scaffold/frontends/default/stylesheets/stylesheet.css +0 -770
  143. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_add_existing_form.rhtml +0 -40
  144. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_create_form.rhtml +0 -45
  145. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_field_search.rhtml +0 -55
  146. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_form.rhtml +0 -18
  147. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_form_association.rhtml +0 -44
  148. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_form_association_footer.rhtml +0 -42
  149. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_form_association_header.rhtml +0 -10
  150. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_form_association_record.rhtml +0 -22
  151. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_form_attribute.rhtml +0 -12
  152. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_form_hidden_attribute.rhtml +0 -1
  153. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_form_messages.rhtml +0 -5
  154. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_list.rhtml +0 -34
  155. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_list_actions.rhtml +0 -13
  156. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_list_calculations.rhtml +0 -22
  157. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_list_column_headings.rhtml +0 -32
  158. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_list_header.rhtml +0 -12
  159. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_list_inline_adapter.rhtml +0 -9
  160. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_list_pagination_links.rhtml +0 -30
  161. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_list_record.rhtml +0 -31
  162. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_live_search.rhtml +0 -25
  163. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_messages.rhtml +0 -10
  164. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_nested.rhtml +0 -44
  165. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_search.rhtml +0 -21
  166. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_show.rhtml +0 -8
  167. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_show_columns.rhtml +0 -11
  168. data/rails/vendor/plugins/active_scaffold/frontends/default/views/_update_form.rhtml +0 -49
  169. data/rails/vendor/plugins/active_scaffold/frontends/default/views/add_existing.rjs +0 -16
  170. data/rails/vendor/plugins/active_scaffold/frontends/default/views/add_existing_form.rhtml +0 -5
  171. data/rails/vendor/plugins/active_scaffold/frontends/default/views/create.rjs +0 -19
  172. data/rails/vendor/plugins/active_scaffold/frontends/default/views/create_form.rhtml +0 -5
  173. data/rails/vendor/plugins/active_scaffold/frontends/default/views/delete.rhtml +0 -13
  174. data/rails/vendor/plugins/active_scaffold/frontends/default/views/destroy.rjs +0 -9
  175. data/rails/vendor/plugins/active_scaffold/frontends/default/views/edit_associated.rjs +0 -15
  176. data/rails/vendor/plugins/active_scaffold/frontends/default/views/field_search.rhtml +0 -5
  177. data/rails/vendor/plugins/active_scaffold/frontends/default/views/form_messages.rjs +0 -1
  178. data/rails/vendor/plugins/active_scaffold/frontends/default/views/list.rhtml +0 -25
  179. data/rails/vendor/plugins/active_scaffold/frontends/default/views/search.rhtml +0 -5
  180. data/rails/vendor/plugins/active_scaffold/frontends/default/views/show.rhtml +0 -5
  181. data/rails/vendor/plugins/active_scaffold/frontends/default/views/update.rjs +0 -10
  182. data/rails/vendor/plugins/active_scaffold/frontends/default/views/update_column.rjs +0 -12
  183. data/rails/vendor/plugins/active_scaffold/frontends/default/views/update_form.rhtml +0 -5
  184. data/rails/vendor/plugins/active_scaffold/init.rb +0 -16
  185. data/rails/vendor/plugins/active_scaffold/install.rb +0 -40
  186. data/rails/vendor/plugins/active_scaffold/install_assets.rb +0 -36
  187. data/rails/vendor/plugins/active_scaffold/lib/actions/core.rb +0 -87
  188. data/rails/vendor/plugins/active_scaffold/lib/actions/create.rb +0 -98
  189. data/rails/vendor/plugins/active_scaffold/lib/actions/delete.rb +0 -46
  190. data/rails/vendor/plugins/active_scaffold/lib/actions/field_search.rb +0 -51
  191. data/rails/vendor/plugins/active_scaffold/lib/actions/list.rb +0 -75
  192. data/rails/vendor/plugins/active_scaffold/lib/actions/live_search.rb +0 -44
  193. data/rails/vendor/plugins/active_scaffold/lib/actions/nested.rb +0 -211
  194. data/rails/vendor/plugins/active_scaffold/lib/actions/search.rb +0 -38
  195. data/rails/vendor/plugins/active_scaffold/lib/actions/show.rb +0 -34
  196. data/rails/vendor/plugins/active_scaffold/lib/actions/subform.rb +0 -17
  197. data/rails/vendor/plugins/active_scaffold/lib/actions/update.rb +0 -112
  198. data/rails/vendor/plugins/active_scaffold/lib/active_record_permissions.rb +0 -127
  199. data/rails/vendor/plugins/active_scaffold/lib/active_scaffold.rb +0 -141
  200. data/rails/vendor/plugins/active_scaffold/lib/attribute_params.rb +0 -184
  201. data/rails/vendor/plugins/active_scaffold/lib/bridges/bridge.rb +0 -52
  202. data/rails/vendor/plugins/active_scaffold/lib/bridges/calendar_date_select/bridge.rb +0 -11
  203. data/rails/vendor/plugins/active_scaffold/lib/bridges/calendar_date_select/lib/as_cds_bridge.rb +0 -46
  204. data/rails/vendor/plugins/active_scaffold/lib/bridges/file_column/bridge.rb +0 -12
  205. data/rails/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/as_file_column_bridge.rb +0 -48
  206. data/rails/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/file_column_helpers.rb +0 -51
  207. data/rails/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/form_ui.rb +0 -32
  208. data/rails/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/list_ui.rb +0 -26
  209. data/rails/vendor/plugins/active_scaffold/lib/bridges/file_column/test/functional/file_column_keep_test.rb +0 -43
  210. data/rails/vendor/plugins/active_scaffold/lib/bridges/file_column/test/mock_model.rb +0 -9
  211. data/rails/vendor/plugins/active_scaffold/lib/bridges/file_column/test/test_helper.rb +0 -15
  212. data/rails/vendor/plugins/active_scaffold/lib/config/base.rb +0 -37
  213. data/rails/vendor/plugins/active_scaffold/lib/config/core.rb +0 -203
  214. data/rails/vendor/plugins/active_scaffold/lib/config/create.rb +0 -34
  215. data/rails/vendor/plugins/active_scaffold/lib/config/delete.rb +0 -25
  216. data/rails/vendor/plugins/active_scaffold/lib/config/field_search.rb +0 -53
  217. data/rails/vendor/plugins/active_scaffold/lib/config/form.rb +0 -49
  218. data/rails/vendor/plugins/active_scaffold/lib/config/list.rb +0 -100
  219. data/rails/vendor/plugins/active_scaffold/lib/config/live_search.rb +0 -52
  220. data/rails/vendor/plugins/active_scaffold/lib/config/nested.rb +0 -30
  221. data/rails/vendor/plugins/active_scaffold/lib/config/search.rb +0 -52
  222. data/rails/vendor/plugins/active_scaffold/lib/config/show.rb +0 -39
  223. data/rails/vendor/plugins/active_scaffold/lib/config/subform.rb +0 -33
  224. data/rails/vendor/plugins/active_scaffold/lib/config/update.rb +0 -24
  225. data/rails/vendor/plugins/active_scaffold/lib/configurable.rb +0 -29
  226. data/rails/vendor/plugins/active_scaffold/lib/constraints.rb +0 -174
  227. data/rails/vendor/plugins/active_scaffold/lib/data_structures/action_columns.rb +0 -92
  228. data/rails/vendor/plugins/active_scaffold/lib/data_structures/action_link.rb +0 -133
  229. data/rails/vendor/plugins/active_scaffold/lib/data_structures/action_links.rb +0 -49
  230. data/rails/vendor/plugins/active_scaffold/lib/data_structures/actions.rb +0 -45
  231. data/rails/vendor/plugins/active_scaffold/lib/data_structures/column.rb +0 -247
  232. data/rails/vendor/plugins/active_scaffold/lib/data_structures/columns.rb +0 -62
  233. data/rails/vendor/plugins/active_scaffold/lib/data_structures/error_message.rb +0 -24
  234. data/rails/vendor/plugins/active_scaffold/lib/data_structures/set.rb +0 -61
  235. data/rails/vendor/plugins/active_scaffold/lib/data_structures/sorting.rb +0 -89
  236. data/rails/vendor/plugins/active_scaffold/lib/dhtml_confirm.rb +0 -54
  237. data/rails/vendor/plugins/active_scaffold/lib/exceptions.rb +0 -7
  238. data/rails/vendor/plugins/active_scaffold/lib/extensions/action_controller_rendering.rb +0 -33
  239. data/rails/vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb +0 -94
  240. data/rails/vendor/plugins/active_scaffold/lib/extensions/array.rb +0 -7
  241. data/rails/vendor/plugins/active_scaffold/lib/extensions/component_response_with_namespacing.rb +0 -17
  242. data/rails/vendor/plugins/active_scaffold/lib/extensions/error_messages.rb +0 -65
  243. data/rails/vendor/plugins/active_scaffold/lib/extensions/generic_view_paths.rb +0 -62
  244. data/rails/vendor/plugins/active_scaffold/lib/extensions/hashes_in_url_for.rb +0 -61
  245. data/rails/vendor/plugins/active_scaffold/lib/extensions/json_mime_type.rb +0 -28
  246. data/rails/vendor/plugins/active_scaffold/lib/extensions/localize.rb +0 -5
  247. data/rails/vendor/plugins/active_scaffold/lib/extensions/name_option_for_datetime.rb +0 -33
  248. data/rails/vendor/plugins/active_scaffold/lib/extensions/nil_id_in_url_params.rb +0 -7
  249. data/rails/vendor/plugins/active_scaffold/lib/extensions/resources.rb +0 -26
  250. data/rails/vendor/plugins/active_scaffold/lib/extensions/reverse_associations.rb +0 -56
  251. data/rails/vendor/plugins/active_scaffold/lib/extensions/to_label.rb +0 -8
  252. data/rails/vendor/plugins/active_scaffold/lib/extensions/unsaved_associated.rb +0 -61
  253. data/rails/vendor/plugins/active_scaffold/lib/extensions/unsaved_record.rb +0 -20
  254. data/rails/vendor/plugins/active_scaffold/lib/finder.rb +0 -149
  255. data/rails/vendor/plugins/active_scaffold/lib/helpers/association_helpers.rb +0 -40
  256. data/rails/vendor/plugins/active_scaffold/lib/helpers/controller_helpers.rb +0 -7
  257. data/rails/vendor/plugins/active_scaffold/lib/helpers/form_column_helpers.rb +0 -251
  258. data/rails/vendor/plugins/active_scaffold/lib/helpers/id_helpers.rb +0 -119
  259. data/rails/vendor/plugins/active_scaffold/lib/helpers/list_column_helpers.rb +0 -187
  260. data/rails/vendor/plugins/active_scaffold/lib/helpers/pagination_helpers.rb +0 -37
  261. data/rails/vendor/plugins/active_scaffold/lib/helpers/usa_state.rb +0 -46
  262. data/rails/vendor/plugins/active_scaffold/lib/helpers/view_helpers.rb +0 -205
  263. data/rails/vendor/plugins/active_scaffold/lib/paginator.rb +0 -136
  264. data/rails/vendor/plugins/active_scaffold/lib/responds_to_parent.rb +0 -68
  265. data/rails/vendor/plugins/active_scaffold/public/blank.html +0 -33
  266. data/rails/vendor/plugins/active_scaffold/test/bridges/bridge_test.rb +0 -47
  267. data/rails/vendor/plugins/active_scaffold/test/config/update_test.rb +0 -17
  268. data/rails/vendor/plugins/active_scaffold/test/const_mocker.rb +0 -36
  269. data/rails/vendor/plugins/active_scaffold/test/data_structures/action_columns_test.rb +0 -119
  270. data/rails/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb +0 -78
  271. data/rails/vendor/plugins/active_scaffold/test/data_structures/action_links_test.rb +0 -63
  272. data/rails/vendor/plugins/active_scaffold/test/data_structures/actions_test.rb +0 -25
  273. data/rails/vendor/plugins/active_scaffold/test/data_structures/association_column_test.rb +0 -41
  274. data/rails/vendor/plugins/active_scaffold/test/data_structures/column_test.rb +0 -161
  275. data/rails/vendor/plugins/active_scaffold/test/data_structures/columns_test.rb +0 -69
  276. data/rails/vendor/plugins/active_scaffold/test/data_structures/error_message_test.rb +0 -28
  277. data/rails/vendor/plugins/active_scaffold/test/data_structures/set_test.rb +0 -86
  278. data/rails/vendor/plugins/active_scaffold/test/data_structures/sorting_test.rb +0 -96
  279. data/rails/vendor/plugins/active_scaffold/test/data_structures/standard_column_test.rb +0 -34
  280. data/rails/vendor/plugins/active_scaffold/test/data_structures/virtual_column_test.rb +0 -34
  281. data/rails/vendor/plugins/active_scaffold/test/extensions/active_record_test.rb +0 -45
  282. data/rails/vendor/plugins/active_scaffold/test/extensions/array.rb +0 -12
  283. data/rails/vendor/plugins/active_scaffold/test/misc/active_record_permissions.rb +0 -154
  284. data/rails/vendor/plugins/active_scaffold/test/misc/configurable_test.rb +0 -96
  285. data/rails/vendor/plugins/active_scaffold/test/misc/constraints_test.rb +0 -175
  286. data/rails/vendor/plugins/active_scaffold/test/misc/finder_test.rb +0 -70
  287. data/rails/vendor/plugins/active_scaffold/test/misc/lang_test.rb +0 -12
  288. data/rails/vendor/plugins/active_scaffold/test/model_stub.rb +0 -39
  289. data/rails/vendor/plugins/active_scaffold/test/run_all.rb +0 -8
  290. data/rails/vendor/plugins/active_scaffold/test/test_helper.rb +0 -13
  291. data/rails/vendor/plugins/active_scaffold/uninstall.rb +0 -12
  292. data/rails/vendor/rails/actionmailer/CHANGELOG +0 -336
  293. data/rails/vendor/rails/actionmailer/MIT-LICENSE +0 -21
  294. data/rails/vendor/rails/actionmailer/README +0 -149
  295. data/rails/vendor/rails/actionmailer/Rakefile +0 -97
  296. data/rails/vendor/rails/actionmailer/install.rb +0 -30
  297. data/rails/vendor/rails/actionmailer/lib/action_mailer.rb +0 -52
  298. data/rails/vendor/rails/actionmailer/lib/action_mailer/adv_attr_accessor.rb +0 -30
  299. data/rails/vendor/rails/actionmailer/lib/action_mailer/base.rb +0 -646
  300. data/rails/vendor/rails/actionmailer/lib/action_mailer/helpers.rb +0 -111
  301. data/rails/vendor/rails/actionmailer/lib/action_mailer/mail_helper.rb +0 -19
  302. data/rails/vendor/rails/actionmailer/lib/action_mailer/part.rb +0 -110
  303. data/rails/vendor/rails/actionmailer/lib/action_mailer/part_container.rb +0 -51
  304. data/rails/vendor/rails/actionmailer/lib/action_mailer/quoting.rb +0 -61
  305. data/rails/vendor/rails/actionmailer/lib/action_mailer/test_case.rb +0 -64
  306. data/rails/vendor/rails/actionmailer/lib/action_mailer/test_helper.rb +0 -67
  307. data/rails/vendor/rails/actionmailer/lib/action_mailer/utils.rb +0 -8
  308. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor.rb +0 -14
  309. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/text-format-0.6.3/text/format.rb +0 -1466
  310. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail.rb +0 -5
  311. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb +0 -426
  312. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/attachments.rb +0 -46
  313. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/base64.rb +0 -46
  314. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/compat.rb +0 -41
  315. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/config.rb +0 -67
  316. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/core_extensions.rb +0 -63
  317. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/encode.rb +0 -581
  318. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/header.rb +0 -960
  319. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/index.rb +0 -9
  320. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb +0 -1130
  321. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/loader.rb +0 -3
  322. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mail.rb +0 -578
  323. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mailbox.rb +0 -495
  324. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/main.rb +0 -6
  325. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mbox.rb +0 -3
  326. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/net.rb +0 -248
  327. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/obsolete.rb +0 -132
  328. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/parser.rb +0 -1476
  329. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/port.rb +0 -379
  330. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/quoting.rb +0 -118
  331. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/require_arch.rb +0 -58
  332. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner.rb +0 -49
  333. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner_r.rb +0 -261
  334. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/stringio.rb +0 -280
  335. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/utils.rb +0 -337
  336. data/rails/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/version.rb +0 -39
  337. data/rails/vendor/rails/actionmailer/lib/action_mailer/version.rb +0 -9
  338. data/rails/vendor/rails/actionmailer/lib/actionmailer.rb +0 -1
  339. data/rails/vendor/rails/actionmailer/test/abstract_unit.rb +0 -49
  340. data/rails/vendor/rails/actionmailer/test/delivery_method_test.rb +0 -51
  341. data/rails/vendor/rails/actionmailer/test/fixtures/first_mailer/share.erb +0 -1
  342. data/rails/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.erb +0 -1
  343. data/rails/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.erb +0 -1
  344. data/rails/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.erb +0 -1
  345. data/rails/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb +0 -5
  346. data/rails/vendor/rails/actionmailer/test/fixtures/helpers/example_helper.rb +0 -5
  347. data/rails/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb +0 -1
  348. data/rails/vendor/rails/actionmailer/test/fixtures/raw_email +0 -14
  349. data/rails/vendor/rails/actionmailer/test/fixtures/raw_email10 +0 -20
  350. data/rails/vendor/rails/actionmailer/test/fixtures/raw_email12 +0 -32
  351. data/rails/vendor/rails/actionmailer/test/fixtures/raw_email13 +0 -29
  352. data/rails/vendor/rails/actionmailer/test/fixtures/raw_email2 +0 -114
  353. data/rails/vendor/rails/actionmailer/test/fixtures/raw_email3 +0 -70
  354. data/rails/vendor/rails/actionmailer/test/fixtures/raw_email4 +0 -59
  355. data/rails/vendor/rails/actionmailer/test/fixtures/raw_email5 +0 -19
  356. data/rails/vendor/rails/actionmailer/test/fixtures/raw_email6 +0 -20
  357. data/rails/vendor/rails/actionmailer/test/fixtures/raw_email7 +0 -66
  358. data/rails/vendor/rails/actionmailer/test/fixtures/raw_email8 +0 -47
  359. data/rails/vendor/rails/actionmailer/test/fixtures/raw_email9 +0 -28
  360. data/rails/vendor/rails/actionmailer/test/fixtures/raw_email_quoted_with_0d0a +0 -14
  361. data/rails/vendor/rails/actionmailer/test/fixtures/raw_email_with_invalid_characters_in_content_type +0 -104
  362. data/rails/vendor/rails/actionmailer/test/fixtures/raw_email_with_nested_attachment +0 -100
  363. data/rails/vendor/rails/actionmailer/test/fixtures/raw_email_with_partially_quoted_subject +0 -14
  364. data/rails/vendor/rails/actionmailer/test/fixtures/second_mailer/share.erb +0 -1
  365. data/rails/vendor/rails/actionmailer/test/fixtures/templates/signed_up.erb +0 -3
  366. data/rails/vendor/rails/actionmailer/test/fixtures/test_mailer/_subtemplate.text.plain.erb +0 -1
  367. data/rails/vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.html.haml +0 -6
  368. data/rails/vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.plain.haml +0 -6
  369. data/rails/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb +0 -1
  370. data/rails/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb +0 -10
  371. data/rails/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb +0 -2
  372. data/rails/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb +0 -1
  373. data/rails/vendor/rails/actionmailer/test/fixtures/test_mailer/included_subtemplate.text.plain.erb +0 -1
  374. data/rails/vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.builder +0 -2
  375. data/rails/vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.rxml +0 -2
  376. data/rails/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.erb +0 -3
  377. data/rails/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb +0 -5
  378. data/rails/vendor/rails/actionmailer/test/mail_helper_test.rb +0 -95
  379. data/rails/vendor/rails/actionmailer/test/mail_render_test.rb +0 -122
  380. data/rails/vendor/rails/actionmailer/test/mail_service_test.rb +0 -979
  381. data/rails/vendor/rails/actionmailer/test/quoting_test.rb +0 -98
  382. data/rails/vendor/rails/actionmailer/test/test_helper_test.rb +0 -129
  383. data/rails/vendor/rails/actionmailer/test/tmail_test.rb +0 -22
  384. data/rails/vendor/rails/actionmailer/test/url_test.rb +0 -76
  385. data/rails/vendor/rails/actionpack/CHANGELOG +0 -4798
  386. data/rails/vendor/rails/actionpack/MIT-LICENSE +0 -21
  387. data/rails/vendor/rails/actionpack/README +0 -469
  388. data/rails/vendor/rails/actionpack/RUNNING_UNIT_TESTS +0 -24
  389. data/rails/vendor/rails/actionpack/Rakefile +0 -154
  390. data/rails/vendor/rails/actionpack/install.rb +0 -30
  391. data/rails/vendor/rails/actionpack/lib/action_controller.rb +0 -79
  392. data/rails/vendor/rails/actionpack/lib/action_controller/assertions.rb +0 -69
  393. data/rails/vendor/rails/actionpack/lib/action_controller/assertions/dom_assertions.rb +0 -39
  394. data/rails/vendor/rails/actionpack/lib/action_controller/assertions/model_assertions.rb +0 -20
  395. data/rails/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb +0 -172
  396. data/rails/vendor/rails/actionpack/lib/action_controller/assertions/routing_assertions.rb +0 -146
  397. data/rails/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb +0 -643
  398. data/rails/vendor/rails/actionpack/lib/action_controller/assertions/tag_assertions.rb +0 -130
  399. data/rails/vendor/rails/actionpack/lib/action_controller/base.rb +0 -1270
  400. data/rails/vendor/rails/actionpack/lib/action_controller/benchmarking.rb +0 -94
  401. data/rails/vendor/rails/actionpack/lib/action_controller/caching.rb +0 -72
  402. data/rails/vendor/rails/actionpack/lib/action_controller/caching/actions.rb +0 -144
  403. data/rails/vendor/rails/actionpack/lib/action_controller/caching/fragments.rb +0 -138
  404. data/rails/vendor/rails/actionpack/lib/action_controller/caching/pages.rb +0 -154
  405. data/rails/vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb +0 -18
  406. data/rails/vendor/rails/actionpack/lib/action_controller/caching/sweeping.rb +0 -97
  407. data/rails/vendor/rails/actionpack/lib/action_controller/cgi_ext.rb +0 -16
  408. data/rails/vendor/rails/actionpack/lib/action_controller/cgi_ext/cookie.rb +0 -110
  409. data/rails/vendor/rails/actionpack/lib/action_controller/cgi_ext/query_extension.rb +0 -22
  410. data/rails/vendor/rails/actionpack/lib/action_controller/cgi_ext/session.rb +0 -73
  411. data/rails/vendor/rails/actionpack/lib/action_controller/cgi_ext/stdinput.rb +0 -24
  412. data/rails/vendor/rails/actionpack/lib/action_controller/cgi_process.rb +0 -223
  413. data/rails/vendor/rails/actionpack/lib/action_controller/components.rb +0 -166
  414. data/rails/vendor/rails/actionpack/lib/action_controller/cookies.rb +0 -96
  415. data/rails/vendor/rails/actionpack/lib/action_controller/dispatcher.rb +0 -162
  416. data/rails/vendor/rails/actionpack/lib/action_controller/filters.rb +0 -643
  417. data/rails/vendor/rails/actionpack/lib/action_controller/flash.rb +0 -172
  418. data/rails/vendor/rails/actionpack/lib/action_controller/headers.rb +0 -31
  419. data/rails/vendor/rails/actionpack/lib/action_controller/helpers.rb +0 -221
  420. data/rails/vendor/rails/actionpack/lib/action_controller/http_authentication.rb +0 -124
  421. data/rails/vendor/rails/actionpack/lib/action_controller/integration.rb +0 -634
  422. data/rails/vendor/rails/actionpack/lib/action_controller/layout.rb +0 -310
  423. data/rails/vendor/rails/actionpack/lib/action_controller/mime_responds.rb +0 -174
  424. data/rails/vendor/rails/actionpack/lib/action_controller/mime_type.rb +0 -182
  425. data/rails/vendor/rails/actionpack/lib/action_controller/mime_types.rb +0 -20
  426. data/rails/vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb +0 -178
  427. data/rails/vendor/rails/actionpack/lib/action_controller/record_identifier.rb +0 -97
  428. data/rails/vendor/rails/actionpack/lib/action_controller/request.rb +0 -761
  429. data/rails/vendor/rails/actionpack/lib/action_controller/request_forgery_protection.rb +0 -140
  430. data/rails/vendor/rails/actionpack/lib/action_controller/request_profiler.rb +0 -169
  431. data/rails/vendor/rails/actionpack/lib/action_controller/rescue.rb +0 -258
  432. data/rails/vendor/rails/actionpack/lib/action_controller/resources.rb +0 -572
  433. data/rails/vendor/rails/actionpack/lib/action_controller/response.rb +0 -76
  434. data/rails/vendor/rails/actionpack/lib/action_controller/routing.rb +0 -383
  435. data/rails/vendor/rails/actionpack/lib/action_controller/routing/builder.rb +0 -204
  436. data/rails/vendor/rails/actionpack/lib/action_controller/routing/optimisations.rb +0 -120
  437. data/rails/vendor/rails/actionpack/lib/action_controller/routing/recognition_optimisation.rb +0 -158
  438. data/rails/vendor/rails/actionpack/lib/action_controller/routing/route.rb +0 -240
  439. data/rails/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb +0 -435
  440. data/rails/vendor/rails/actionpack/lib/action_controller/routing/routing_ext.rb +0 -46
  441. data/rails/vendor/rails/actionpack/lib/action_controller/routing/segments.rb +0 -283
  442. data/rails/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb +0 -340
  443. data/rails/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb +0 -166
  444. data/rails/vendor/rails/actionpack/lib/action_controller/session/drb_server.rb +0 -32
  445. data/rails/vendor/rails/actionpack/lib/action_controller/session/drb_store.rb +0 -35
  446. data/rails/vendor/rails/actionpack/lib/action_controller/session/mem_cache_store.rb +0 -98
  447. data/rails/vendor/rails/actionpack/lib/action_controller/session_management.rb +0 -158
  448. data/rails/vendor/rails/actionpack/lib/action_controller/status_codes.rb +0 -88
  449. data/rails/vendor/rails/actionpack/lib/action_controller/streaming.rb +0 -155
  450. data/rails/vendor/rails/actionpack/lib/action_controller/templates/rescues/_request_and_response.erb +0 -24
  451. data/rails/vendor/rails/actionpack/lib/action_controller/templates/rescues/_trace.erb +0 -26
  452. data/rails/vendor/rails/actionpack/lib/action_controller/templates/rescues/diagnostics.erb +0 -11
  453. data/rails/vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.erb +0 -29
  454. data/rails/vendor/rails/actionpack/lib/action_controller/templates/rescues/missing_template.erb +0 -2
  455. data/rails/vendor/rails/actionpack/lib/action_controller/templates/rescues/routing_error.erb +0 -10
  456. data/rails/vendor/rails/actionpack/lib/action_controller/templates/rescues/template_error.erb +0 -21
  457. data/rails/vendor/rails/actionpack/lib/action_controller/templates/rescues/unknown_action.erb +0 -2
  458. data/rails/vendor/rails/actionpack/lib/action_controller/test_case.rb +0 -83
  459. data/rails/vendor/rails/actionpack/lib/action_controller/test_process.rb +0 -524
  460. data/rails/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb +0 -142
  461. data/rails/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/document.rb +0 -68
  462. data/rails/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb +0 -530
  463. data/rails/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb +0 -173
  464. data/rails/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb +0 -828
  465. data/rails/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/tokenizer.rb +0 -105
  466. data/rails/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/version.rb +0 -11
  467. data/rails/vendor/rails/actionpack/lib/action_controller/verification.rb +0 -130
  468. data/rails/vendor/rails/actionpack/lib/action_pack.rb +0 -24
  469. data/rails/vendor/rails/actionpack/lib/action_pack/version.rb +0 -9
  470. data/rails/vendor/rails/actionpack/lib/action_view.rb +0 -45
  471. data/rails/vendor/rails/actionpack/lib/action_view/base.rb +0 -343
  472. data/rails/vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb +0 -276
  473. data/rails/vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb +0 -611
  474. data/rails/vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb +0 -143
  475. data/rails/vendor/rails/actionpack/lib/action_view/helpers/benchmark_helper.rb +0 -33
  476. data/rails/vendor/rails/actionpack/lib/action_view/helpers/cache_helper.rb +0 -40
  477. data/rails/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb +0 -161
  478. data/rails/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb +0 -711
  479. data/rails/vendor/rails/actionpack/lib/action_view/helpers/debug_helper.rb +0 -31
  480. data/rails/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb +0 -763
  481. data/rails/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb +0 -457
  482. data/rails/vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb +0 -459
  483. data/rails/vendor/rails/actionpack/lib/action_view/helpers/javascript_helper.rb +0 -217
  484. data/rails/vendor/rails/actionpack/lib/action_view/helpers/javascripts/controls.js +0 -963
  485. data/rails/vendor/rails/actionpack/lib/action_view/helpers/javascripts/dragdrop.js +0 -972
  486. data/rails/vendor/rails/actionpack/lib/action_view/helpers/javascripts/effects.js +0 -1120
  487. data/rails/vendor/rails/actionpack/lib/action_view/helpers/javascripts/prototype.js +0 -4225
  488. data/rails/vendor/rails/actionpack/lib/action_view/helpers/number_helper.rb +0 -186
  489. data/rails/vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb +0 -1300
  490. data/rails/vendor/rails/actionpack/lib/action_view/helpers/record_identification_helper.rb +0 -20
  491. data/rails/vendor/rails/actionpack/lib/action_view/helpers/record_tag_helper.rb +0 -59
  492. data/rails/vendor/rails/actionpack/lib/action_view/helpers/sanitize_helper.rb +0 -229
  493. data/rails/vendor/rails/actionpack/lib/action_view/helpers/scriptaculous_helper.rb +0 -225
  494. data/rails/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb +0 -133
  495. data/rails/vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb +0 -507
  496. data/rails/vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb +0 -575
  497. data/rails/vendor/rails/actionpack/lib/action_view/inline_template.rb +0 -20
  498. data/rails/vendor/rails/actionpack/lib/action_view/partial_template.rb +0 -70
  499. data/rails/vendor/rails/actionpack/lib/action_view/partials.rb +0 -158
  500. data/rails/vendor/rails/actionpack/lib/action_view/template.rb +0 -127
  501. data/rails/vendor/rails/actionpack/lib/action_view/template_error.rb +0 -110
  502. data/rails/vendor/rails/actionpack/lib/action_view/template_finder.rb +0 -177
  503. data/rails/vendor/rails/actionpack/lib/action_view/template_handler.rb +0 -34
  504. data/rails/vendor/rails/actionpack/lib/action_view/template_handlers/builder.rb +0 -27
  505. data/rails/vendor/rails/actionpack/lib/action_view/template_handlers/compilable.rb +0 -128
  506. data/rails/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb +0 -56
  507. data/rails/vendor/rails/actionpack/lib/action_view/template_handlers/rjs.rb +0 -27
  508. data/rails/vendor/rails/actionpack/lib/action_view/test_case.rb +0 -58
  509. data/rails/vendor/rails/actionpack/lib/actionpack.rb +0 -1
  510. data/rails/vendor/rails/actionpack/test/abstract_unit.rb +0 -36
  511. data/rails/vendor/rails/actionpack/test/active_record_unit.rb +0 -105
  512. data/rails/vendor/rails/actionpack/test/activerecord/active_record_store_test.rb +0 -141
  513. data/rails/vendor/rails/actionpack/test/activerecord/render_partial_with_record_identification_test.rb +0 -191
  514. data/rails/vendor/rails/actionpack/test/adv_attr_test.rb +0 -20
  515. data/rails/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +0 -524
  516. data/rails/vendor/rails/actionpack/test/controller/addresses_render_test.rb +0 -43
  517. data/rails/vendor/rails/actionpack/test/controller/assert_select_test.rb +0 -689
  518. data/rails/vendor/rails/actionpack/test/controller/base_test.rb +0 -183
  519. data/rails/vendor/rails/actionpack/test/controller/benchmark_test.rb +0 -32
  520. data/rails/vendor/rails/actionpack/test/controller/caching_test.rb +0 -610
  521. data/rails/vendor/rails/actionpack/test/controller/capture_test.rb +0 -89
  522. data/rails/vendor/rails/actionpack/test/controller/cgi_test.rb +0 -116
  523. data/rails/vendor/rails/actionpack/test/controller/components_test.rb +0 -140
  524. data/rails/vendor/rails/actionpack/test/controller/content_type_test.rb +0 -139
  525. data/rails/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/admin/user_controller.rb +0 -0
  526. data/rails/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/user_controller.rb +0 -0
  527. data/rails/vendor/rails/actionpack/test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib/plugin_controller.rb +0 -0
  528. data/rails/vendor/rails/actionpack/test/controller/cookie_test.rb +0 -146
  529. data/rails/vendor/rails/actionpack/test/controller/custom_handler_test.rb +0 -45
  530. data/rails/vendor/rails/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb +0 -37
  531. data/rails/vendor/rails/actionpack/test/controller/dispatcher_test.rb +0 -105
  532. data/rails/vendor/rails/actionpack/test/controller/fake_controllers.rb +0 -33
  533. data/rails/vendor/rails/actionpack/test/controller/fake_models.rb +0 -11
  534. data/rails/vendor/rails/actionpack/test/controller/filter_params_test.rb +0 -49
  535. data/rails/vendor/rails/actionpack/test/controller/filters_test.rb +0 -881
  536. data/rails/vendor/rails/actionpack/test/controller/flash_test.rb +0 -146
  537. data/rails/vendor/rails/actionpack/test/controller/header_test.rb +0 -14
  538. data/rails/vendor/rails/actionpack/test/controller/helper_test.rb +0 -210
  539. data/rails/vendor/rails/actionpack/test/controller/html-scanner/document_test.rb +0 -123
  540. data/rails/vendor/rails/actionpack/test/controller/html-scanner/node_test.rb +0 -68
  541. data/rails/vendor/rails/actionpack/test/controller/html-scanner/sanitizer_test.rb +0 -259
  542. data/rails/vendor/rails/actionpack/test/controller/html-scanner/tag_node_test.rb +0 -238
  543. data/rails/vendor/rails/actionpack/test/controller/html-scanner/text_node_test.rb +0 -50
  544. data/rails/vendor/rails/actionpack/test/controller/html-scanner/tokenizer_test.rb +0 -131
  545. data/rails/vendor/rails/actionpack/test/controller/http_authentication_test.rb +0 -54
  546. data/rails/vendor/rails/actionpack/test/controller/integration_test.rb +0 -252
  547. data/rails/vendor/rails/actionpack/test/controller/integration_upload_test.rb +0 -43
  548. data/rails/vendor/rails/actionpack/test/controller/layout_test.rb +0 -259
  549. data/rails/vendor/rails/actionpack/test/controller/mime_responds_test.rb +0 -538
  550. data/rails/vendor/rails/actionpack/test/controller/mime_type_test.rb +0 -84
  551. data/rails/vendor/rails/actionpack/test/controller/new_render_test.rb +0 -926
  552. data/rails/vendor/rails/actionpack/test/controller/polymorphic_routes_test.rb +0 -141
  553. data/rails/vendor/rails/actionpack/test/controller/record_identifier_test.rb +0 -139
  554. data/rails/vendor/rails/actionpack/test/controller/redirect_test.rb +0 -289
  555. data/rails/vendor/rails/actionpack/test/controller/render_test.rb +0 -527
  556. data/rails/vendor/rails/actionpack/test/controller/request_forgery_protection_test.rb +0 -313
  557. data/rails/vendor/rails/actionpack/test/controller/request_test.rb +0 -922
  558. data/rails/vendor/rails/actionpack/test/controller/rescue_test.rb +0 -517
  559. data/rails/vendor/rails/actionpack/test/controller/resources_test.rb +0 -875
  560. data/rails/vendor/rails/actionpack/test/controller/routing_test.rb +0 -2415
  561. data/rails/vendor/rails/actionpack/test/controller/selector_test.rb +0 -628
  562. data/rails/vendor/rails/actionpack/test/controller/send_file_test.rb +0 -138
  563. data/rails/vendor/rails/actionpack/test/controller/session/cookie_store_test.rb +0 -258
  564. data/rails/vendor/rails/actionpack/test/controller/session/mem_cache_store_test.rb +0 -181
  565. data/rails/vendor/rails/actionpack/test/controller/session_fixation_test.rb +0 -89
  566. data/rails/vendor/rails/actionpack/test/controller/session_management_test.rb +0 -178
  567. data/rails/vendor/rails/actionpack/test/controller/test_test.rb +0 -686
  568. data/rails/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +0 -310
  569. data/rails/vendor/rails/actionpack/test/controller/verification_test.rb +0 -253
  570. data/rails/vendor/rails/actionpack/test/controller/view_paths_test.rb +0 -140
  571. data/rails/vendor/rails/actionpack/test/controller/webservice_test.rb +0 -229
  572. data/rails/vendor/rails/actionpack/test/fixtures/addresses/list.erb +0 -1
  573. data/rails/vendor/rails/actionpack/test/fixtures/bad_customers/_bad_customer.html.erb +0 -1
  574. data/rails/vendor/rails/actionpack/test/fixtures/companies.yml +0 -24
  575. data/rails/vendor/rails/actionpack/test/fixtures/company.rb +0 -10
  576. data/rails/vendor/rails/actionpack/test/fixtures/content_type/render_default_content_types_for_respond_to.rhtml +0 -1
  577. data/rails/vendor/rails/actionpack/test/fixtures/content_type/render_default_for_rhtml.rhtml +0 -1
  578. data/rails/vendor/rails/actionpack/test/fixtures/content_type/render_default_for_rjs.rjs +0 -1
  579. data/rails/vendor/rails/actionpack/test/fixtures/content_type/render_default_for_rxml.rxml +0 -1
  580. data/rails/vendor/rails/actionpack/test/fixtures/customers/_customer.html.erb +0 -1
  581. data/rails/vendor/rails/actionpack/test/fixtures/db_definitions/sqlite.sql +0 -49
  582. data/rails/vendor/rails/actionpack/test/fixtures/developer.rb +0 -9
  583. data/rails/vendor/rails/actionpack/test/fixtures/developers.yml +0 -21
  584. data/rails/vendor/rails/actionpack/test/fixtures/developers_projects.yml +0 -13
  585. data/rails/vendor/rails/actionpack/test/fixtures/fun/games/hello_world.erb +0 -1
  586. data/rails/vendor/rails/actionpack/test/fixtures/functional_caching/_partial.erb +0 -3
  587. data/rails/vendor/rails/actionpack/test/fixtures/functional_caching/fragment_cached.html.erb +0 -2
  588. data/rails/vendor/rails/actionpack/test/fixtures/functional_caching/html_fragment_cached_with_partial.html.erb +0 -1
  589. data/rails/vendor/rails/actionpack/test/fixtures/functional_caching/js_fragment_cached_with_partial.js.rjs +0 -1
  590. data/rails/vendor/rails/actionpack/test/fixtures/good_customers/_good_customer.html.erb +0 -1
  591. data/rails/vendor/rails/actionpack/test/fixtures/helpers/abc_helper.rb +0 -5
  592. data/rails/vendor/rails/actionpack/test/fixtures/helpers/fun/games_helper.rb +0 -3
  593. data/rails/vendor/rails/actionpack/test/fixtures/helpers/fun/pdf_helper.rb +0 -3
  594. data/rails/vendor/rails/actionpack/test/fixtures/layout_tests/alt/hello.rhtml +0 -1
  595. data/rails/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/controller_name_space/nested.rhtml +0 -1
  596. data/rails/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/item.rhtml +0 -1
  597. data/rails/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/layout_test.rhtml +0 -1
  598. data/rails/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/multiple_extensions.html.erb +0 -1
  599. data/rails/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/third_party_template_library.mab +0 -1
  600. data/rails/vendor/rails/actionpack/test/fixtures/layout_tests/views/hello.rhtml +0 -1
  601. data/rails/vendor/rails/actionpack/test/fixtures/layouts/block_with_layout.erb +0 -3
  602. data/rails/vendor/rails/actionpack/test/fixtures/layouts/builder.builder +0 -3
  603. data/rails/vendor/rails/actionpack/test/fixtures/layouts/partial_with_layout.erb +0 -3
  604. data/rails/vendor/rails/actionpack/test/fixtures/layouts/standard.erb +0 -1
  605. data/rails/vendor/rails/actionpack/test/fixtures/layouts/talk_from_action.erb +0 -2
  606. data/rails/vendor/rails/actionpack/test/fixtures/layouts/yield.erb +0 -2
  607. data/rails/vendor/rails/actionpack/test/fixtures/mascot.rb +0 -3
  608. data/rails/vendor/rails/actionpack/test/fixtures/mascots.yml +0 -4
  609. data/rails/vendor/rails/actionpack/test/fixtures/mascots/_mascot.html.erb +0 -1
  610. data/rails/vendor/rails/actionpack/test/fixtures/multipart/binary_file +0 -0
  611. data/rails/vendor/rails/actionpack/test/fixtures/multipart/boundary_problem_file +0 -10
  612. data/rails/vendor/rails/actionpack/test/fixtures/multipart/bracketed_param +0 -5
  613. data/rails/vendor/rails/actionpack/test/fixtures/multipart/large_text_file +0 -10
  614. data/rails/vendor/rails/actionpack/test/fixtures/multipart/mixed_files +0 -0
  615. data/rails/vendor/rails/actionpack/test/fixtures/multipart/mona_lisa.jpg +0 -0
  616. data/rails/vendor/rails/actionpack/test/fixtures/multipart/single_parameter +0 -5
  617. data/rails/vendor/rails/actionpack/test/fixtures/multipart/text_file +0 -10
  618. data/rails/vendor/rails/actionpack/test/fixtures/override/test/hello_world.erb +0 -1
  619. data/rails/vendor/rails/actionpack/test/fixtures/override2/layouts/test/sub.erb +0 -1
  620. data/rails/vendor/rails/actionpack/test/fixtures/post_test/layouts/post.html.erb +0 -1
  621. data/rails/vendor/rails/actionpack/test/fixtures/post_test/layouts/super_post.iphone.erb +0 -1
  622. data/rails/vendor/rails/actionpack/test/fixtures/post_test/post/index.html.erb +0 -1
  623. data/rails/vendor/rails/actionpack/test/fixtures/post_test/post/index.iphone.erb +0 -1
  624. data/rails/vendor/rails/actionpack/test/fixtures/post_test/super_post/index.html.erb +0 -1
  625. data/rails/vendor/rails/actionpack/test/fixtures/post_test/super_post/index.iphone.erb +0 -1
  626. data/rails/vendor/rails/actionpack/test/fixtures/project.rb +0 -3
  627. data/rails/vendor/rails/actionpack/test/fixtures/projects.yml +0 -7
  628. data/rails/vendor/rails/actionpack/test/fixtures/public/404.html +0 -1
  629. data/rails/vendor/rails/actionpack/test/fixtures/public/500.html +0 -1
  630. data/rails/vendor/rails/actionpack/test/fixtures/public/images/rails.png +0 -0
  631. data/rails/vendor/rails/actionpack/test/fixtures/public/javascripts/application.js +0 -1
  632. data/rails/vendor/rails/actionpack/test/fixtures/public/javascripts/bank.js +0 -1
  633. data/rails/vendor/rails/actionpack/test/fixtures/public/javascripts/controls.js +0 -1
  634. data/rails/vendor/rails/actionpack/test/fixtures/public/javascripts/dragdrop.js +0 -1
  635. data/rails/vendor/rails/actionpack/test/fixtures/public/javascripts/effects.js +0 -1
  636. data/rails/vendor/rails/actionpack/test/fixtures/public/javascripts/prototype.js +0 -1
  637. data/rails/vendor/rails/actionpack/test/fixtures/public/javascripts/robber.js +0 -1
  638. data/rails/vendor/rails/actionpack/test/fixtures/public/javascripts/version.1.0.js +0 -1
  639. data/rails/vendor/rails/actionpack/test/fixtures/public/stylesheets/bank.css +0 -1
  640. data/rails/vendor/rails/actionpack/test/fixtures/public/stylesheets/robber.css +0 -1
  641. data/rails/vendor/rails/actionpack/test/fixtures/public/stylesheets/version.1.0.css +0 -1
  642. data/rails/vendor/rails/actionpack/test/fixtures/replies.yml +0 -15
  643. data/rails/vendor/rails/actionpack/test/fixtures/reply.rb +0 -7
  644. data/rails/vendor/rails/actionpack/test/fixtures/respond_to/all_types_with_layout.html.erb +0 -1
  645. data/rails/vendor/rails/actionpack/test/fixtures/respond_to/all_types_with_layout.js.rjs +0 -1
  646. data/rails/vendor/rails/actionpack/test/fixtures/respond_to/custom_constant_handling_without_block.mobile.erb +0 -1
  647. data/rails/vendor/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.html.erb +0 -1
  648. data/rails/vendor/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.iphone.erb +0 -1
  649. data/rails/vendor/rails/actionpack/test/fixtures/respond_to/layouts/missing.html.erb +0 -1
  650. data/rails/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.html.erb +0 -1
  651. data/rails/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.iphone.erb +0 -1
  652. data/rails/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.html.erb +0 -1
  653. data/rails/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.js.rjs +0 -1
  654. data/rails/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.xml.builder +0 -1
  655. data/rails/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.html.erb +0 -1
  656. data/rails/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.js.rjs +0 -1
  657. data/rails/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder +0 -1
  658. data/rails/vendor/rails/actionpack/test/fixtures/scope/test/modgreet.erb +0 -1
  659. data/rails/vendor/rails/actionpack/test/fixtures/shared.html.erb +0 -1
  660. data/rails/vendor/rails/actionpack/test/fixtures/symlink_parent/symlinked_layout.erb +0 -5
  661. data/rails/vendor/rails/actionpack/test/fixtures/test/_customer.erb +0 -1
  662. data/rails/vendor/rails/actionpack/test/fixtures/test/_customer_counter.erb +0 -1
  663. data/rails/vendor/rails/actionpack/test/fixtures/test/_customer_greeting.erb +0 -1
  664. data/rails/vendor/rails/actionpack/test/fixtures/test/_form.erb +0 -1
  665. data/rails/vendor/rails/actionpack/test/fixtures/test/_hash_greeting.erb +0 -1
  666. data/rails/vendor/rails/actionpack/test/fixtures/test/_hash_object.erb +0 -2
  667. data/rails/vendor/rails/actionpack/test/fixtures/test/_hello.builder +0 -1
  668. data/rails/vendor/rails/actionpack/test/fixtures/test/_labelling_form.erb +0 -1
  669. data/rails/vendor/rails/actionpack/test/fixtures/test/_layout_for_partial.html.erb +0 -3
  670. data/rails/vendor/rails/actionpack/test/fixtures/test/_partial.erb +0 -1
  671. data/rails/vendor/rails/actionpack/test/fixtures/test/_partial.html.erb +0 -1
  672. data/rails/vendor/rails/actionpack/test/fixtures/test/_partial.js.erb +0 -1
  673. data/rails/vendor/rails/actionpack/test/fixtures/test/_partial_for_use_in_layout.html.erb +0 -1
  674. data/rails/vendor/rails/actionpack/test/fixtures/test/_partial_only.erb +0 -1
  675. data/rails/vendor/rails/actionpack/test/fixtures/test/_person.erb +0 -2
  676. data/rails/vendor/rails/actionpack/test/fixtures/test/_raise.html.erb +0 -1
  677. data/rails/vendor/rails/actionpack/test/fixtures/test/action_talk_to_layout.erb +0 -2
  678. data/rails/vendor/rails/actionpack/test/fixtures/test/block_content_for.erb +0 -2
  679. data/rails/vendor/rails/actionpack/test/fixtures/test/calling_partial_with_layout.html.erb +0 -1
  680. data/rails/vendor/rails/actionpack/test/fixtures/test/capturing.erb +0 -4
  681. data/rails/vendor/rails/actionpack/test/fixtures/test/content_for.erb +0 -2
  682. data/rails/vendor/rails/actionpack/test/fixtures/test/content_for_concatenated.erb +0 -3
  683. data/rails/vendor/rails/actionpack/test/fixtures/test/content_for_with_parameter.erb +0 -2
  684. data/rails/vendor/rails/actionpack/test/fixtures/test/delete_with_js.rjs +0 -2
  685. data/rails/vendor/rails/actionpack/test/fixtures/test/dot.directory/render_file_with_ivar.erb +0 -1
  686. data/rails/vendor/rails/actionpack/test/fixtures/test/enum_rjs_test.rjs +0 -6
  687. data/rails/vendor/rails/actionpack/test/fixtures/test/erb_content_for.erb +0 -2
  688. data/rails/vendor/rails/actionpack/test/fixtures/test/formatted_html_erb.html.erb +0 -1
  689. data/rails/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.builder +0 -1
  690. data/rails/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.html.erb +0 -1
  691. data/rails/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.xml.erb +0 -1
  692. data/rails/vendor/rails/actionpack/test/fixtures/test/greeting.erb +0 -1
  693. data/rails/vendor/rails/actionpack/test/fixtures/test/greeting.js.rjs +0 -1
  694. data/rails/vendor/rails/actionpack/test/fixtures/test/hello.builder +0 -4
  695. data/rails/vendor/rails/actionpack/test/fixtures/test/hello_world.erb +0 -1
  696. data/rails/vendor/rails/actionpack/test/fixtures/test/hello_world_container.builder +0 -3
  697. data/rails/vendor/rails/actionpack/test/fixtures/test/hello_world_from_rxml.builder +0 -4
  698. data/rails/vendor/rails/actionpack/test/fixtures/test/hello_world_with_layout_false.erb +0 -1
  699. data/rails/vendor/rails/actionpack/test/fixtures/test/hello_xml_world.builder +0 -11
  700. data/rails/vendor/rails/actionpack/test/fixtures/test/list.erb +0 -1
  701. data/rails/vendor/rails/actionpack/test/fixtures/test/non_erb_block_content_for.builder +0 -4
  702. data/rails/vendor/rails/actionpack/test/fixtures/test/potential_conflicts.erb +0 -4
  703. data/rails/vendor/rails/actionpack/test/fixtures/test/render_file_with_ivar.erb +0 -1
  704. data/rails/vendor/rails/actionpack/test/fixtures/test/render_file_with_locals.erb +0 -1
  705. data/rails/vendor/rails/actionpack/test/fixtures/test/render_to_string_test.erb +0 -1
  706. data/rails/vendor/rails/actionpack/test/fixtures/test/update_element_with_capture.erb +0 -9
  707. data/rails/vendor/rails/actionpack/test/fixtures/test/using_layout_around_block.html.erb +0 -1
  708. data/rails/vendor/rails/actionpack/test/fixtures/topic.rb +0 -3
  709. data/rails/vendor/rails/actionpack/test/fixtures/topics.yml +0 -22
  710. data/rails/vendor/rails/actionpack/test/fixtures/topics/_topic.html.erb +0 -1
  711. data/rails/vendor/rails/actionpack/test/template/active_record_helper_test.rb +0 -268
  712. data/rails/vendor/rails/actionpack/test/template/asset_tag_helper_test.rb +0 -525
  713. data/rails/vendor/rails/actionpack/test/template/atom_feed_helper_test.rb +0 -179
  714. data/rails/vendor/rails/actionpack/test/template/benchmark_helper_test.rb +0 -60
  715. data/rails/vendor/rails/actionpack/test/template/date_helper_test.rb +0 -1740
  716. data/rails/vendor/rails/actionpack/test/template/erb_util_test.rb +0 -24
  717. data/rails/vendor/rails/actionpack/test/template/form_helper_test.rb +0 -918
  718. data/rails/vendor/rails/actionpack/test/template/form_options_helper_test.rb +0 -1336
  719. data/rails/vendor/rails/actionpack/test/template/form_tag_helper_test.rb +0 -259
  720. data/rails/vendor/rails/actionpack/test/template/javascript_helper_test.rb +0 -109
  721. data/rails/vendor/rails/actionpack/test/template/number_helper_test.rb +0 -97
  722. data/rails/vendor/rails/actionpack/test/template/prototype_helper_test.rb +0 -614
  723. data/rails/vendor/rails/actionpack/test/template/record_tag_helper_test.rb +0 -54
  724. data/rails/vendor/rails/actionpack/test/template/sanitize_helper_test.rb +0 -48
  725. data/rails/vendor/rails/actionpack/test/template/scriptaculous_helper_test.rb +0 -90
  726. data/rails/vendor/rails/actionpack/test/template/tag_helper_test.rb +0 -77
  727. data/rails/vendor/rails/actionpack/test/template/template_finder_test.rb +0 -73
  728. data/rails/vendor/rails/actionpack/test/template/template_object_test.rb +0 -95
  729. data/rails/vendor/rails/actionpack/test/template/test_test.rb +0 -56
  730. data/rails/vendor/rails/actionpack/test/template/text_helper_test.rb +0 -366
  731. data/rails/vendor/rails/actionpack/test/template/url_helper_test.rb +0 -534
  732. data/rails/vendor/rails/actionpack/test/testing_sandbox.rb +0 -15
  733. data/rails/vendor/rails/activemodel/CHANGES +0 -12
  734. data/rails/vendor/rails/activemodel/README +0 -21
  735. data/rails/vendor/rails/activemodel/Rakefile +0 -16
  736. data/rails/vendor/rails/activemodel/lib/active_model.rb +0 -17
  737. data/rails/vendor/rails/activemodel/lib/active_model/base.rb +0 -4
  738. data/rails/vendor/rails/activemodel/lib/active_model/callbacks.rb +0 -5
  739. data/rails/vendor/rails/activemodel/lib/active_model/deprecated_error_methods.rb +0 -38
  740. data/rails/vendor/rails/activemodel/lib/active_model/errors.rb +0 -80
  741. data/rails/vendor/rails/activemodel/lib/active_model/observing.rb +0 -100
  742. data/rails/vendor/rails/activemodel/lib/active_model/validations.rb +0 -124
  743. data/rails/vendor/rails/activemodel/lib/active_model/validations/acceptance.rb +0 -45
  744. data/rails/vendor/rails/activemodel/lib/active_model/validations/associated.rb +0 -46
  745. data/rails/vendor/rails/activemodel/lib/active_model/validations/confirmation.rb +0 -44
  746. data/rails/vendor/rails/activemodel/lib/active_model/validations/exclusion.rb +0 -37
  747. data/rails/vendor/rails/activemodel/lib/active_model/validations/format.rb +0 -39
  748. data/rails/vendor/rails/activemodel/lib/active_model/validations/inclusion.rb +0 -37
  749. data/rails/vendor/rails/activemodel/lib/active_model/validations/length.rb +0 -95
  750. data/rails/vendor/rails/activemodel/lib/active_model/validations/numericality.rb +0 -80
  751. data/rails/vendor/rails/activemodel/lib/active_model/validations/presence.rb +0 -42
  752. data/rails/vendor/rails/activemodel/lib/active_model/validations/uniqueness.rb +0 -104
  753. data/rails/vendor/rails/activemodel/spec/observing_spec.rb +0 -120
  754. data/rails/vendor/rails/activemodel/spec/spec_helper.rb +0 -17
  755. data/rails/vendor/rails/activerecord/CHANGELOG +0 -5719
  756. data/rails/vendor/rails/activerecord/MIT-LICENSE +0 -20
  757. data/rails/vendor/rails/activerecord/README +0 -351
  758. data/rails/vendor/rails/activerecord/RUNNING_UNIT_TESTS +0 -36
  759. data/rails/vendor/rails/activerecord/Rakefile +0 -247
  760. data/rails/vendor/rails/activerecord/examples/associations.png +0 -0
  761. data/rails/vendor/rails/activerecord/install.rb +0 -30
  762. data/rails/vendor/rails/activerecord/lib/active_record.rb +0 -82
  763. data/rails/vendor/rails/activerecord/lib/active_record/aggregations.rb +0 -189
  764. data/rails/vendor/rails/activerecord/lib/active_record/association_preload.rb +0 -277
  765. data/rails/vendor/rails/activerecord/lib/active_record/associations.rb +0 -1994
  766. data/rails/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb +0 -365
  767. data/rails/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb +0 -224
  768. data/rails/vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb +0 -58
  769. data/rails/vendor/rails/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb +0 -49
  770. data/rails/vendor/rails/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +0 -112
  771. data/rails/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb +0 -109
  772. data/rails/vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb +0 -254
  773. data/rails/vendor/rails/activerecord/lib/active_record/associations/has_one_association.rb +0 -98
  774. data/rails/vendor/rails/activerecord/lib/active_record/associations/has_one_through_association.rb +0 -28
  775. data/rails/vendor/rails/activerecord/lib/active_record/attribute_methods.rb +0 -379
  776. data/rails/vendor/rails/activerecord/lib/active_record/base.rb +0 -2726
  777. data/rails/vendor/rails/activerecord/lib/active_record/calculations.rb +0 -275
  778. data/rails/vendor/rails/activerecord/lib/active_record/callbacks.rb +0 -312
  779. data/rails/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +0 -309
  780. data/rails/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +0 -176
  781. data/rails/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb +0 -93
  782. data/rails/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +0 -69
  783. data/rails/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +0 -661
  784. data/rails/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +0 -421
  785. data/rails/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +0 -169
  786. data/rails/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +0 -530
  787. data/rails/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +0 -948
  788. data/rails/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +0 -34
  789. data/rails/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +0 -406
  790. data/rails/vendor/rails/activerecord/lib/active_record/dirty.rb +0 -158
  791. data/rails/vendor/rails/activerecord/lib/active_record/fixtures.rb +0 -997
  792. data/rails/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb +0 -147
  793. data/rails/vendor/rails/activerecord/lib/active_record/locking/pessimistic.rb +0 -77
  794. data/rails/vendor/rails/activerecord/lib/active_record/migration.rb +0 -496
  795. data/rails/vendor/rails/activerecord/lib/active_record/named_scope.rb +0 -163
  796. data/rails/vendor/rails/activerecord/lib/active_record/observer.rb +0 -195
  797. data/rails/vendor/rails/activerecord/lib/active_record/query_cache.rb +0 -21
  798. data/rails/vendor/rails/activerecord/lib/active_record/reflection.rb +0 -239
  799. data/rails/vendor/rails/activerecord/lib/active_record/schema.rb +0 -51
  800. data/rails/vendor/rails/activerecord/lib/active_record/schema_dumper.rb +0 -171
  801. data/rails/vendor/rails/activerecord/lib/active_record/serialization.rb +0 -98
  802. data/rails/vendor/rails/activerecord/lib/active_record/serializers/json_serializer.rb +0 -80
  803. data/rails/vendor/rails/activerecord/lib/active_record/serializers/xml_serializer.rb +0 -338
  804. data/rails/vendor/rails/activerecord/lib/active_record/test_case.rb +0 -36
  805. data/rails/vendor/rails/activerecord/lib/active_record/timestamp.rb +0 -41
  806. data/rails/vendor/rails/activerecord/lib/active_record/transactions.rb +0 -130
  807. data/rails/vendor/rails/activerecord/lib/active_record/validations.rb +0 -961
  808. data/rails/vendor/rails/activerecord/lib/active_record/vendor/db2.rb +0 -362
  809. data/rails/vendor/rails/activerecord/lib/active_record/vendor/mysql.rb +0 -1214
  810. data/rails/vendor/rails/activerecord/lib/active_record/version.rb +0 -9
  811. data/rails/vendor/rails/activerecord/lib/activerecord.rb +0 -1
  812. data/rails/vendor/rails/activerecord/test/assets/example.log +0 -1
  813. data/rails/vendor/rails/activerecord/test/assets/flowers.jpg +0 -0
  814. data/rails/vendor/rails/activerecord/test/cases/aaa_create_tables_test.rb +0 -24
  815. data/rails/vendor/rails/activerecord/test/cases/active_schema_test_mysql.rb +0 -95
  816. data/rails/vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb +0 -24
  817. data/rails/vendor/rails/activerecord/test/cases/adapter_test.rb +0 -127
  818. data/rails/vendor/rails/activerecord/test/cases/adapter_test_sqlserver.rb +0 -95
  819. data/rails/vendor/rails/activerecord/test/cases/aggregations_test.rb +0 -128
  820. data/rails/vendor/rails/activerecord/test/cases/ar_schema_test.rb +0 -33
  821. data/rails/vendor/rails/activerecord/test/cases/associations/belongs_to_associations_test.rb +0 -412
  822. data/rails/vendor/rails/activerecord/test/cases/associations/callbacks_test.rb +0 -161
  823. data/rails/vendor/rails/activerecord/test/cases/associations/cascaded_eager_loading_test.rb +0 -111
  824. data/rails/vendor/rails/activerecord/test/cases/associations/eager_load_nested_include_test.rb +0 -83
  825. data/rails/vendor/rails/activerecord/test/cases/associations/eager_singularization_test.rb +0 -145
  826. data/rails/vendor/rails/activerecord/test/cases/associations/eager_test.rb +0 -612
  827. data/rails/vendor/rails/activerecord/test/cases/associations/extension_test.rb +0 -47
  828. data/rails/vendor/rails/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb +0 -684
  829. data/rails/vendor/rails/activerecord/test/cases/associations/has_many_associations_test.rb +0 -932
  830. data/rails/vendor/rails/activerecord/test/cases/associations/has_many_through_associations_test.rb +0 -190
  831. data/rails/vendor/rails/activerecord/test/cases/associations/has_one_associations_test.rb +0 -323
  832. data/rails/vendor/rails/activerecord/test/cases/associations/has_one_through_associations_test.rb +0 -74
  833. data/rails/vendor/rails/activerecord/test/cases/associations/inner_join_association_test.rb +0 -88
  834. data/rails/vendor/rails/activerecord/test/cases/associations/join_model_test.rb +0 -707
  835. data/rails/vendor/rails/activerecord/test/cases/associations_test.rb +0 -262
  836. data/rails/vendor/rails/activerecord/test/cases/attribute_methods_test.rb +0 -238
  837. data/rails/vendor/rails/activerecord/test/cases/base_test.rb +0 -1974
  838. data/rails/vendor/rails/activerecord/test/cases/binary_test.rb +0 -34
  839. data/rails/vendor/rails/activerecord/test/cases/calculations_test.rb +0 -271
  840. data/rails/vendor/rails/activerecord/test/cases/callbacks_test.rb +0 -400
  841. data/rails/vendor/rails/activerecord/test/cases/class_inheritable_attributes_test.rb +0 -32
  842. data/rails/vendor/rails/activerecord/test/cases/column_alias_test.rb +0 -17
  843. data/rails/vendor/rails/activerecord/test/cases/connection_test_firebird.rb +0 -8
  844. data/rails/vendor/rails/activerecord/test/cases/connection_test_mysql.rb +0 -30
  845. data/rails/vendor/rails/activerecord/test/cases/copy_table_test_sqlite.rb +0 -69
  846. data/rails/vendor/rails/activerecord/test/cases/datatype_test_postgresql.rb +0 -203
  847. data/rails/vendor/rails/activerecord/test/cases/date_time_test.rb +0 -37
  848. data/rails/vendor/rails/activerecord/test/cases/default_test_firebird.rb +0 -16
  849. data/rails/vendor/rails/activerecord/test/cases/defaults_test.rb +0 -69
  850. data/rails/vendor/rails/activerecord/test/cases/deprecated_finder_test.rb +0 -30
  851. data/rails/vendor/rails/activerecord/test/cases/dirty_test.rb +0 -163
  852. data/rails/vendor/rails/activerecord/test/cases/finder_respond_to_test.rb +0 -76
  853. data/rails/vendor/rails/activerecord/test/cases/finder_test.rb +0 -883
  854. data/rails/vendor/rails/activerecord/test/cases/fixtures_test.rb +0 -626
  855. data/rails/vendor/rails/activerecord/test/cases/helper.rb +0 -47
  856. data/rails/vendor/rails/activerecord/test/cases/inheritance_test.rb +0 -255
  857. data/rails/vendor/rails/activerecord/test/cases/invalid_date_test.rb +0 -24
  858. data/rails/vendor/rails/activerecord/test/cases/json_serialization_test.rb +0 -205
  859. data/rails/vendor/rails/activerecord/test/cases/lifecycle_test.rb +0 -140
  860. data/rails/vendor/rails/activerecord/test/cases/locking_test.rb +0 -289
  861. data/rails/vendor/rails/activerecord/test/cases/method_scoping_test.rb +0 -452
  862. data/rails/vendor/rails/activerecord/test/cases/migration_test.rb +0 -1319
  863. data/rails/vendor/rails/activerecord/test/cases/migration_test_firebird.rb +0 -124
  864. data/rails/vendor/rails/activerecord/test/cases/mixin_test.rb +0 -96
  865. data/rails/vendor/rails/activerecord/test/cases/modules_test.rb +0 -39
  866. data/rails/vendor/rails/activerecord/test/cases/multiple_db_test.rb +0 -60
  867. data/rails/vendor/rails/activerecord/test/cases/named_scope_test.rb +0 -157
  868. data/rails/vendor/rails/activerecord/test/cases/pk_test.rb +0 -101
  869. data/rails/vendor/rails/activerecord/test/cases/query_cache_test.rb +0 -126
  870. data/rails/vendor/rails/activerecord/test/cases/readonly_test.rb +0 -107
  871. data/rails/vendor/rails/activerecord/test/cases/reflection_test.rb +0 -176
  872. data/rails/vendor/rails/activerecord/test/cases/reserved_word_test_mysql.rb +0 -176
  873. data/rails/vendor/rails/activerecord/test/cases/schema_authorization_test_postgresql.rb +0 -75
  874. data/rails/vendor/rails/activerecord/test/cases/schema_dumper_test.rb +0 -138
  875. data/rails/vendor/rails/activerecord/test/cases/schema_test_postgresql.rb +0 -102
  876. data/rails/vendor/rails/activerecord/test/cases/serialization_test.rb +0 -47
  877. data/rails/vendor/rails/activerecord/test/cases/synonym_test_oracle.rb +0 -17
  878. data/rails/vendor/rails/activerecord/test/cases/table_name_test_sqlserver.rb +0 -23
  879. data/rails/vendor/rails/activerecord/test/cases/threaded_connections_test.rb +0 -48
  880. data/rails/vendor/rails/activerecord/test/cases/transactions_test.rb +0 -307
  881. data/rails/vendor/rails/activerecord/test/cases/unconnected_test.rb +0 -32
  882. data/rails/vendor/rails/activerecord/test/cases/validations_test.rb +0 -1509
  883. data/rails/vendor/rails/activerecord/test/cases/xml_serialization_test.rb +0 -202
  884. data/rails/vendor/rails/activerecord/test/config.rb +0 -5
  885. data/rails/vendor/rails/activerecord/test/connections/native_db2/connection.rb +0 -25
  886. data/rails/vendor/rails/activerecord/test/connections/native_firebird/connection.rb +0 -26
  887. data/rails/vendor/rails/activerecord/test/connections/native_frontbase/connection.rb +0 -27
  888. data/rails/vendor/rails/activerecord/test/connections/native_mysql/connection.rb +0 -27
  889. data/rails/vendor/rails/activerecord/test/connections/native_openbase/connection.rb +0 -21
  890. data/rails/vendor/rails/activerecord/test/connections/native_oracle/connection.rb +0 -27
  891. data/rails/vendor/rails/activerecord/test/connections/native_postgresql/connection.rb +0 -21
  892. data/rails/vendor/rails/activerecord/test/connections/native_sqlite/connection.rb +0 -25
  893. data/rails/vendor/rails/activerecord/test/connections/native_sqlite3/connection.rb +0 -25
  894. data/rails/vendor/rails/activerecord/test/connections/native_sqlite3/in_memory_connection.rb +0 -18
  895. data/rails/vendor/rails/activerecord/test/connections/native_sybase/connection.rb +0 -23
  896. data/rails/vendor/rails/activerecord/test/fixtures/accounts.yml +0 -28
  897. data/rails/vendor/rails/activerecord/test/fixtures/all/developers.yml +0 -0
  898. data/rails/vendor/rails/activerecord/test/fixtures/all/people.csv +0 -0
  899. data/rails/vendor/rails/activerecord/test/fixtures/all/tasks.yml +0 -0
  900. data/rails/vendor/rails/activerecord/test/fixtures/author_addresses.yml +0 -5
  901. data/rails/vendor/rails/activerecord/test/fixtures/author_favorites.yml +0 -4
  902. data/rails/vendor/rails/activerecord/test/fixtures/authors.yml +0 -9
  903. data/rails/vendor/rails/activerecord/test/fixtures/binaries.yml +0 -132
  904. data/rails/vendor/rails/activerecord/test/fixtures/books.yml +0 -7
  905. data/rails/vendor/rails/activerecord/test/fixtures/categories.yml +0 -14
  906. data/rails/vendor/rails/activerecord/test/fixtures/categories/special_categories.yml +0 -9
  907. data/rails/vendor/rails/activerecord/test/fixtures/categories/subsubdir/arbitrary_filename.yml +0 -4
  908. data/rails/vendor/rails/activerecord/test/fixtures/categories_ordered.yml +0 -7
  909. data/rails/vendor/rails/activerecord/test/fixtures/categories_posts.yml +0 -23
  910. data/rails/vendor/rails/activerecord/test/fixtures/categorizations.yml +0 -17
  911. data/rails/vendor/rails/activerecord/test/fixtures/clubs.yml +0 -6
  912. data/rails/vendor/rails/activerecord/test/fixtures/comments.yml +0 -59
  913. data/rails/vendor/rails/activerecord/test/fixtures/companies.yml +0 -55
  914. data/rails/vendor/rails/activerecord/test/fixtures/computers.yml +0 -4
  915. data/rails/vendor/rails/activerecord/test/fixtures/courses.yml +0 -7
  916. data/rails/vendor/rails/activerecord/test/fixtures/customers.yml +0 -17
  917. data/rails/vendor/rails/activerecord/test/fixtures/developers.yml +0 -21
  918. data/rails/vendor/rails/activerecord/test/fixtures/developers_projects.yml +0 -17
  919. data/rails/vendor/rails/activerecord/test/fixtures/edges.yml +0 -6
  920. data/rails/vendor/rails/activerecord/test/fixtures/entrants.yml +0 -14
  921. data/rails/vendor/rails/activerecord/test/fixtures/fk_test_has_fk.yml +0 -3
  922. data/rails/vendor/rails/activerecord/test/fixtures/fk_test_has_pk.yml +0 -2
  923. data/rails/vendor/rails/activerecord/test/fixtures/funny_jokes.yml +0 -10
  924. data/rails/vendor/rails/activerecord/test/fixtures/items.yml +0 -4
  925. data/rails/vendor/rails/activerecord/test/fixtures/jobs.yml +0 -7
  926. data/rails/vendor/rails/activerecord/test/fixtures/legacy_things.yml +0 -3
  927. data/rails/vendor/rails/activerecord/test/fixtures/mateys.yml +0 -4
  928. data/rails/vendor/rails/activerecord/test/fixtures/members.yml +0 -4
  929. data/rails/vendor/rails/activerecord/test/fixtures/memberships.yml +0 -20
  930. data/rails/vendor/rails/activerecord/test/fixtures/minimalistics.yml +0 -2
  931. data/rails/vendor/rails/activerecord/test/fixtures/mixed_case_monkeys.yml +0 -6
  932. data/rails/vendor/rails/activerecord/test/fixtures/mixins.yml +0 -29
  933. data/rails/vendor/rails/activerecord/test/fixtures/movies.yml +0 -7
  934. data/rails/vendor/rails/activerecord/test/fixtures/naked/csv/accounts.csv +0 -1
  935. data/rails/vendor/rails/activerecord/test/fixtures/naked/yml/accounts.yml +0 -1
  936. data/rails/vendor/rails/activerecord/test/fixtures/naked/yml/companies.yml +0 -1
  937. data/rails/vendor/rails/activerecord/test/fixtures/naked/yml/courses.yml +0 -1
  938. data/rails/vendor/rails/activerecord/test/fixtures/owners.yml +0 -7
  939. data/rails/vendor/rails/activerecord/test/fixtures/parrots.yml +0 -27
  940. data/rails/vendor/rails/activerecord/test/fixtures/parrots_pirates.yml +0 -7
  941. data/rails/vendor/rails/activerecord/test/fixtures/people.yml +0 -6
  942. data/rails/vendor/rails/activerecord/test/fixtures/pets.yml +0 -14
  943. data/rails/vendor/rails/activerecord/test/fixtures/pirates.yml +0 -9
  944. data/rails/vendor/rails/activerecord/test/fixtures/posts.yml +0 -49
  945. data/rails/vendor/rails/activerecord/test/fixtures/price_estimates.yml +0 -7
  946. data/rails/vendor/rails/activerecord/test/fixtures/projects.yml +0 -7
  947. data/rails/vendor/rails/activerecord/test/fixtures/readers.yml +0 -9
  948. data/rails/vendor/rails/activerecord/test/fixtures/references.yml +0 -17
  949. data/rails/vendor/rails/activerecord/test/fixtures/reserved_words/distinct.yml +0 -5
  950. data/rails/vendor/rails/activerecord/test/fixtures/reserved_words/distincts_selects.yml +0 -11
  951. data/rails/vendor/rails/activerecord/test/fixtures/reserved_words/group.yml +0 -14
  952. data/rails/vendor/rails/activerecord/test/fixtures/reserved_words/select.yml +0 -8
  953. data/rails/vendor/rails/activerecord/test/fixtures/reserved_words/values.yml +0 -7
  954. data/rails/vendor/rails/activerecord/test/fixtures/ships.yml +0 -5
  955. data/rails/vendor/rails/activerecord/test/fixtures/sponsors.yml +0 -9
  956. data/rails/vendor/rails/activerecord/test/fixtures/subscribers.yml +0 -7
  957. data/rails/vendor/rails/activerecord/test/fixtures/subscriptions.yml +0 -12
  958. data/rails/vendor/rails/activerecord/test/fixtures/taggings.yml +0 -28
  959. data/rails/vendor/rails/activerecord/test/fixtures/tags.yml +0 -7
  960. data/rails/vendor/rails/activerecord/test/fixtures/tasks.yml +0 -7
  961. data/rails/vendor/rails/activerecord/test/fixtures/topics.yml +0 -42
  962. data/rails/vendor/rails/activerecord/test/fixtures/treasures.yml +0 -10
  963. data/rails/vendor/rails/activerecord/test/fixtures/vertices.yml +0 -4
  964. data/rails/vendor/rails/activerecord/test/fixtures/warehouse-things.yml +0 -3
  965. data/rails/vendor/rails/activerecord/test/migrations/decimal/1_give_me_big_numbers.rb +0 -15
  966. data/rails/vendor/rails/activerecord/test/migrations/duplicate/1_people_have_last_names.rb +0 -9
  967. data/rails/vendor/rails/activerecord/test/migrations/duplicate/2_we_need_reminders.rb +0 -12
  968. data/rails/vendor/rails/activerecord/test/migrations/duplicate/3_foo.rb +0 -7
  969. data/rails/vendor/rails/activerecord/test/migrations/duplicate/3_innocent_jointable.rb +0 -12
  970. data/rails/vendor/rails/activerecord/test/migrations/duplicate_names/20080507052938_chunky.rb +0 -7
  971. data/rails/vendor/rails/activerecord/test/migrations/duplicate_names/20080507053028_chunky.rb +0 -7
  972. data/rails/vendor/rails/activerecord/test/migrations/interleaved/pass_1/3_innocent_jointable.rb +0 -12
  973. data/rails/vendor/rails/activerecord/test/migrations/interleaved/pass_2/1_people_have_last_names.rb +0 -9
  974. data/rails/vendor/rails/activerecord/test/migrations/interleaved/pass_2/3_innocent_jointable.rb +0 -12
  975. data/rails/vendor/rails/activerecord/test/migrations/interleaved/pass_3/1_people_have_last_names.rb +0 -9
  976. data/rails/vendor/rails/activerecord/test/migrations/interleaved/pass_3/2_i_raise_on_down.rb +0 -8
  977. data/rails/vendor/rails/activerecord/test/migrations/interleaved/pass_3/3_innocent_jointable.rb +0 -12
  978. data/rails/vendor/rails/activerecord/test/migrations/missing/1000_people_have_middle_names.rb +0 -9
  979. data/rails/vendor/rails/activerecord/test/migrations/missing/1_people_have_last_names.rb +0 -9
  980. data/rails/vendor/rails/activerecord/test/migrations/missing/3_we_need_reminders.rb +0 -12
  981. data/rails/vendor/rails/activerecord/test/migrations/missing/4_innocent_jointable.rb +0 -12
  982. data/rails/vendor/rails/activerecord/test/migrations/valid/1_people_have_last_names.rb +0 -9
  983. data/rails/vendor/rails/activerecord/test/migrations/valid/2_we_need_reminders.rb +0 -12
  984. data/rails/vendor/rails/activerecord/test/migrations/valid/3_innocent_jointable.rb +0 -12
  985. data/rails/vendor/rails/activerecord/test/models/author.rb +0 -133
  986. data/rails/vendor/rails/activerecord/test/models/auto_id.rb +0 -4
  987. data/rails/vendor/rails/activerecord/test/models/binary.rb +0 -2
  988. data/rails/vendor/rails/activerecord/test/models/book.rb +0 -4
  989. data/rails/vendor/rails/activerecord/test/models/categorization.rb +0 -5
  990. data/rails/vendor/rails/activerecord/test/models/category.rb +0 -29
  991. data/rails/vendor/rails/activerecord/test/models/citation.rb +0 -6
  992. data/rails/vendor/rails/activerecord/test/models/club.rb +0 -7
  993. data/rails/vendor/rails/activerecord/test/models/column_name.rb +0 -3
  994. data/rails/vendor/rails/activerecord/test/models/comment.rb +0 -25
  995. data/rails/vendor/rails/activerecord/test/models/company.rb +0 -123
  996. data/rails/vendor/rails/activerecord/test/models/company_in_module.rb +0 -61
  997. data/rails/vendor/rails/activerecord/test/models/computer.rb +0 -3
  998. data/rails/vendor/rails/activerecord/test/models/contact.rb +0 -16
  999. data/rails/vendor/rails/activerecord/test/models/course.rb +0 -3
  1000. data/rails/vendor/rails/activerecord/test/models/customer.rb +0 -55
  1001. data/rails/vendor/rails/activerecord/test/models/default.rb +0 -2
  1002. data/rails/vendor/rails/activerecord/test/models/developer.rb +0 -76
  1003. data/rails/vendor/rails/activerecord/test/models/edge.rb +0 -5
  1004. data/rails/vendor/rails/activerecord/test/models/entrant.rb +0 -3
  1005. data/rails/vendor/rails/activerecord/test/models/guid.rb +0 -2
  1006. data/rails/vendor/rails/activerecord/test/models/item.rb +0 -7
  1007. data/rails/vendor/rails/activerecord/test/models/job.rb +0 -5
  1008. data/rails/vendor/rails/activerecord/test/models/joke.rb +0 -3
  1009. data/rails/vendor/rails/activerecord/test/models/keyboard.rb +0 -3
  1010. data/rails/vendor/rails/activerecord/test/models/legacy_thing.rb +0 -3
  1011. data/rails/vendor/rails/activerecord/test/models/matey.rb +0 -4
  1012. data/rails/vendor/rails/activerecord/test/models/member.rb +0 -9
  1013. data/rails/vendor/rails/activerecord/test/models/membership.rb +0 -9
  1014. data/rails/vendor/rails/activerecord/test/models/minimalistic.rb +0 -2
  1015. data/rails/vendor/rails/activerecord/test/models/mixed_case_monkey.rb +0 -3
  1016. data/rails/vendor/rails/activerecord/test/models/movie.rb +0 -5
  1017. data/rails/vendor/rails/activerecord/test/models/order.rb +0 -4
  1018. data/rails/vendor/rails/activerecord/test/models/owner.rb +0 -4
  1019. data/rails/vendor/rails/activerecord/test/models/parrot.rb +0 -13
  1020. data/rails/vendor/rails/activerecord/test/models/person.rb +0 -10
  1021. data/rails/vendor/rails/activerecord/test/models/pet.rb +0 -4
  1022. data/rails/vendor/rails/activerecord/test/models/pirate.rb +0 -9
  1023. data/rails/vendor/rails/activerecord/test/models/post.rb +0 -80
  1024. data/rails/vendor/rails/activerecord/test/models/price_estimate.rb +0 -3
  1025. data/rails/vendor/rails/activerecord/test/models/project.rb +0 -29
  1026. data/rails/vendor/rails/activerecord/test/models/reader.rb +0 -4
  1027. data/rails/vendor/rails/activerecord/test/models/reference.rb +0 -4
  1028. data/rails/vendor/rails/activerecord/test/models/reply.rb +0 -39
  1029. data/rails/vendor/rails/activerecord/test/models/ship.rb +0 -3
  1030. data/rails/vendor/rails/activerecord/test/models/sponsor.rb +0 -4
  1031. data/rails/vendor/rails/activerecord/test/models/subject.rb +0 -4
  1032. data/rails/vendor/rails/activerecord/test/models/subscriber.rb +0 -8
  1033. data/rails/vendor/rails/activerecord/test/models/subscription.rb +0 -4
  1034. data/rails/vendor/rails/activerecord/test/models/tag.rb +0 -7
  1035. data/rails/vendor/rails/activerecord/test/models/tagging.rb +0 -10
  1036. data/rails/vendor/rails/activerecord/test/models/task.rb +0 -3
  1037. data/rails/vendor/rails/activerecord/test/models/topic.rb +0 -65
  1038. data/rails/vendor/rails/activerecord/test/models/treasure.rb +0 -6
  1039. data/rails/vendor/rails/activerecord/test/models/vertex.rb +0 -9
  1040. data/rails/vendor/rails/activerecord/test/models/warehouse_thing.rb +0 -5
  1041. data/rails/vendor/rails/activerecord/test/schema/mysql_specific_schema.rb +0 -12
  1042. data/rails/vendor/rails/activerecord/test/schema/postgresql_specific_schema.rb +0 -103
  1043. data/rails/vendor/rails/activerecord/test/schema/schema.rb +0 -421
  1044. data/rails/vendor/rails/activerecord/test/schema/schema2.rb +0 -6
  1045. data/rails/vendor/rails/activerecord/test/schema/sqlite_specific_schema.rb +0 -25
  1046. data/rails/vendor/rails/activerecord/test/schema/sqlserver_specific_schema.rb +0 -5
  1047. data/rails/vendor/rails/activeresource/CHANGELOG +0 -246
  1048. data/rails/vendor/rails/activeresource/MIT-LICENSE +0 -20
  1049. data/rails/vendor/rails/activeresource/README +0 -165
  1050. data/rails/vendor/rails/activeresource/Rakefile +0 -135
  1051. data/rails/vendor/rails/activeresource/lib/active_resource.rb +0 -47
  1052. data/rails/vendor/rails/activeresource/lib/active_resource/base.rb +0 -1014
  1053. data/rails/vendor/rails/activeresource/lib/active_resource/connection.rb +0 -207
  1054. data/rails/vendor/rails/activeresource/lib/active_resource/custom_methods.rb +0 -119
  1055. data/rails/vendor/rails/activeresource/lib/active_resource/formats.rb +0 -14
  1056. data/rails/vendor/rails/activeresource/lib/active_resource/formats/json_format.rb +0 -23
  1057. data/rails/vendor/rails/activeresource/lib/active_resource/formats/xml_format.rb +0 -34
  1058. data/rails/vendor/rails/activeresource/lib/active_resource/http_mock.rb +0 -217
  1059. data/rails/vendor/rails/activeresource/lib/active_resource/validations.rb +0 -288
  1060. data/rails/vendor/rails/activeresource/lib/active_resource/version.rb +0 -9
  1061. data/rails/vendor/rails/activeresource/lib/activeresource.rb +0 -1
  1062. data/rails/vendor/rails/activeresource/test/abstract_unit.rb +0 -22
  1063. data/rails/vendor/rails/activeresource/test/authorization_test.rb +0 -122
  1064. data/rails/vendor/rails/activeresource/test/base/custom_methods_test.rb +0 -99
  1065. data/rails/vendor/rails/activeresource/test/base/equality_test.rb +0 -43
  1066. data/rails/vendor/rails/activeresource/test/base/load_test.rb +0 -146
  1067. data/rails/vendor/rails/activeresource/test/base_errors_test.rb +0 -48
  1068. data/rails/vendor/rails/activeresource/test/base_test.rb +0 -791
  1069. data/rails/vendor/rails/activeresource/test/connection_test.rb +0 -190
  1070. data/rails/vendor/rails/activeresource/test/fixtures/beast.rb +0 -14
  1071. data/rails/vendor/rails/activeresource/test/fixtures/person.rb +0 -3
  1072. data/rails/vendor/rails/activeresource/test/fixtures/street_address.rb +0 -4
  1073. data/rails/vendor/rails/activeresource/test/format_test.rb +0 -83
  1074. data/rails/vendor/rails/activeresource/test/setter_trap.rb +0 -27
  1075. data/rails/vendor/rails/activesupport/CHANGELOG +0 -1181
  1076. data/rails/vendor/rails/activesupport/MIT-LICENSE +0 -20
  1077. data/rails/vendor/rails/activesupport/README +0 -43
  1078. data/rails/vendor/rails/activesupport/Rakefile +0 -175
  1079. data/rails/vendor/rails/activesupport/install.rb +0 -30
  1080. data/rails/vendor/rails/activesupport/lib/active_support.rb +0 -55
  1081. data/rails/vendor/rails/activesupport/lib/active_support/base64.rb +0 -22
  1082. data/rails/vendor/rails/activesupport/lib/active_support/basic_object.rb +0 -24
  1083. data/rails/vendor/rails/activesupport/lib/active_support/buffered_logger.rb +0 -121
  1084. data/rails/vendor/rails/activesupport/lib/active_support/cache.rb +0 -145
  1085. data/rails/vendor/rails/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb +0 -15
  1086. data/rails/vendor/rails/activesupport/lib/active_support/cache/drb_store.rb +0 -15
  1087. data/rails/vendor/rails/activesupport/lib/active_support/cache/file_store.rb +0 -70
  1088. data/rails/vendor/rails/activesupport/lib/active_support/cache/mem_cache_store.rb +0 -100
  1089. data/rails/vendor/rails/activesupport/lib/active_support/cache/memory_store.rb +0 -38
  1090. data/rails/vendor/rails/activesupport/lib/active_support/callbacks.rb +0 -275
  1091. data/rails/vendor/rails/activesupport/lib/active_support/clean_logger.rb +0 -127
  1092. data/rails/vendor/rails/activesupport/lib/active_support/core_ext.rb +0 -4
  1093. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/array.rb +0 -13
  1094. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/array/access.rb +0 -26
  1095. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/array/conversions.rb +0 -178
  1096. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/array/extract_options.rb +0 -20
  1097. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/array/grouping.rb +0 -63
  1098. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb +0 -12
  1099. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/base64.rb +0 -4
  1100. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/base64/encoding.rb +0 -13
  1101. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb +0 -12
  1102. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal.rb +0 -6
  1103. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal/conversions.rb +0 -41
  1104. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/blank.rb +0 -53
  1105. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/cgi.rb +0 -5
  1106. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/cgi/escape_skipping_slashes.rb +0 -14
  1107. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/class.rb +0 -4
  1108. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb +0 -54
  1109. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb +0 -46
  1110. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb +0 -140
  1111. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/class/removal.rb +0 -50
  1112. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/date.rb +0 -10
  1113. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/date/behavior.rb +0 -13
  1114. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/date/calculations.rb +0 -215
  1115. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb +0 -107
  1116. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/date_time.rb +0 -12
  1117. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/date_time/calculations.rb +0 -112
  1118. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb +0 -96
  1119. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/duplicable.rb +0 -37
  1120. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/enumerable.rb +0 -69
  1121. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/exception.rb +0 -41
  1122. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/file.rb +0 -21
  1123. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/float.rb +0 -5
  1124. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/float/rounding.rb +0 -24
  1125. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/hash.rb +0 -13
  1126. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb +0 -259
  1127. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/hash/diff.rb +0 -19
  1128. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/hash/except.rb +0 -24
  1129. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb +0 -137
  1130. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/hash/keys.rb +0 -52
  1131. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb +0 -28
  1132. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/hash/slice.rb +0 -28
  1133. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/integer.rb +0 -7
  1134. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/integer/even_odd.rb +0 -29
  1135. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/integer/inflections.rb +0 -20
  1136. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/kernel.rb +0 -5
  1137. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/kernel/agnostics.rb +0 -11
  1138. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/kernel/daemonizing.rb +0 -7
  1139. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/kernel/debugger.rb +0 -13
  1140. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb +0 -59
  1141. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/kernel/requires.rb +0 -24
  1142. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/load_error.rb +0 -38
  1143. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/logger.rb +0 -16
  1144. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/module.rb +0 -8
  1145. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/module/aliasing.rb +0 -70
  1146. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb +0 -31
  1147. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/module/attr_internal.rb +0 -32
  1148. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb +0 -58
  1149. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/module/delegation.rb +0 -64
  1150. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb +0 -30
  1151. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/module/introspection.rb +0 -75
  1152. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/module/loading.rb +0 -23
  1153. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/name_error.rb +0 -17
  1154. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/numeric.rb +0 -9
  1155. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb +0 -44
  1156. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/numeric/conversions.rb +0 -19
  1157. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/numeric/time.rb +0 -91
  1158. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/object.rb +0 -4
  1159. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/object/conversions.rb +0 -14
  1160. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/object/extending.rb +0 -58
  1161. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/object/instance_variables.rb +0 -74
  1162. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb +0 -59
  1163. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/pathname.rb +0 -7
  1164. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/pathname/clean_within.rb +0 -14
  1165. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/proc.rb +0 -12
  1166. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/process.rb +0 -1
  1167. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/process/daemon.rb +0 -25
  1168. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/range.rb +0 -11
  1169. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/range/blockless_step.rb +0 -32
  1170. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/range/conversions.rb +0 -27
  1171. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/range/include_range.rb +0 -30
  1172. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/range/overlaps.rb +0 -15
  1173. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/string.rb +0 -18
  1174. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/string/access.rb +0 -82
  1175. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/string/conversions.rb +0 -28
  1176. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/string/filters.rb +0 -26
  1177. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb +0 -148
  1178. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/string/iterators.rb +0 -21
  1179. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb +0 -35
  1180. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/string/unicode.rb +0 -68
  1181. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/string/xchar.rb +0 -11
  1182. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb +0 -14
  1183. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/test.rb +0 -1
  1184. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/test/unit/assertions.rb +0 -64
  1185. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/time.rb +0 -21
  1186. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/time/behavior.rb +0 -13
  1187. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb +0 -276
  1188. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/time/conversions.rb +0 -89
  1189. data/rails/vendor/rails/activesupport/lib/active_support/core_ext/time/zones.rb +0 -86
  1190. data/rails/vendor/rails/activesupport/lib/active_support/dependencies.rb +0 -552
  1191. data/rails/vendor/rails/activesupport/lib/active_support/deprecation.rb +0 -205
  1192. data/rails/vendor/rails/activesupport/lib/active_support/duration.rb +0 -96
  1193. data/rails/vendor/rails/activesupport/lib/active_support/gzip.rb +0 -25
  1194. data/rails/vendor/rails/activesupport/lib/active_support/inflections.rb +0 -53
  1195. data/rails/vendor/rails/activesupport/lib/active_support/inflector.rb +0 -308
  1196. data/rails/vendor/rails/activesupport/lib/active_support/json.rb +0 -23
  1197. data/rails/vendor/rails/activesupport/lib/active_support/json/decoding.rb +0 -63
  1198. data/rails/vendor/rails/activesupport/lib/active_support/json/encoders/date.rb +0 -14
  1199. data/rails/vendor/rails/activesupport/lib/active_support/json/encoders/date_time.rb +0 -14
  1200. data/rails/vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb +0 -12
  1201. data/rails/vendor/rails/activesupport/lib/active_support/json/encoders/false_class.rb +0 -5
  1202. data/rails/vendor/rails/activesupport/lib/active_support/json/encoders/hash.rb +0 -47
  1203. data/rails/vendor/rails/activesupport/lib/active_support/json/encoders/nil_class.rb +0 -5
  1204. data/rails/vendor/rails/activesupport/lib/active_support/json/encoders/numeric.rb +0 -5
  1205. data/rails/vendor/rails/activesupport/lib/active_support/json/encoders/object.rb +0 -6
  1206. data/rails/vendor/rails/activesupport/lib/active_support/json/encoders/regexp.rb +0 -5
  1207. data/rails/vendor/rails/activesupport/lib/active_support/json/encoders/string.rb +0 -36
  1208. data/rails/vendor/rails/activesupport/lib/active_support/json/encoders/symbol.rb +0 -5
  1209. data/rails/vendor/rails/activesupport/lib/active_support/json/encoders/time.rb +0 -14
  1210. data/rails/vendor/rails/activesupport/lib/active_support/json/encoders/true_class.rb +0 -5
  1211. data/rails/vendor/rails/activesupport/lib/active_support/json/encoding.rb +0 -37
  1212. data/rails/vendor/rails/activesupport/lib/active_support/json/variable.rb +0 -10
  1213. data/rails/vendor/rails/activesupport/lib/active_support/multibyte.rb +0 -9
  1214. data/rails/vendor/rails/activesupport/lib/active_support/multibyte/chars.rb +0 -137
  1215. data/rails/vendor/rails/activesupport/lib/active_support/multibyte/generators/generate_tables.rb +0 -149
  1216. data/rails/vendor/rails/activesupport/lib/active_support/multibyte/handlers/passthru_handler.rb +0 -9
  1217. data/rails/vendor/rails/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb +0 -564
  1218. data/rails/vendor/rails/activesupport/lib/active_support/multibyte/handlers/utf8_handler_proc.rb +0 -43
  1219. data/rails/vendor/rails/activesupport/lib/active_support/option_merger.rb +0 -25
  1220. data/rails/vendor/rails/activesupport/lib/active_support/ordered_hash.rb +0 -43
  1221. data/rails/vendor/rails/activesupport/lib/active_support/ordered_options.rb +0 -17
  1222. data/rails/vendor/rails/activesupport/lib/active_support/test_case.rb +0 -13
  1223. data/rails/vendor/rails/activesupport/lib/active_support/testing/default.rb +0 -9
  1224. data/rails/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb +0 -93
  1225. data/rails/vendor/rails/activesupport/lib/active_support/time_with_zone.rb +0 -283
  1226. data/rails/vendor/rails/activesupport/lib/active_support/values/time_zone.rb +0 -394
  1227. data/rails/vendor/rails/activesupport/lib/active_support/values/unicode_tables.dat +0 -0
  1228. data/rails/vendor/rails/activesupport/lib/active_support/vendor.rb +0 -26
  1229. data/rails/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/blankslate.rb +0 -113
  1230. data/rails/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder.rb +0 -13
  1231. data/rails/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/blankslate.rb +0 -20
  1232. data/rails/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/css.rb +0 -250
  1233. data/rails/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xchar.rb +0 -115
  1234. data/rails/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlbase.rb +0 -139
  1235. data/rails/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlevents.rb +0 -63
  1236. data/rails/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlmarkup.rb +0 -328
  1237. data/rails/vendor/rails/activesupport/lib/active_support/vendor/memcache-client-1.5.0/memcache.rb +0 -849
  1238. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo.rb +0 -33
  1239. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/data_timezone.rb +0 -47
  1240. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/data_timezone_info.rb +0 -226
  1241. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Algiers.rb +0 -55
  1242. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Cairo.rb +0 -219
  1243. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Casablanca.rb +0 -38
  1244. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Harare.rb +0 -18
  1245. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Johannesburg.rb +0 -25
  1246. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Monrovia.rb +0 -22
  1247. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Nairobi.rb +0 -23
  1248. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +0 -166
  1249. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Argentina/San_Juan.rb +0 -170
  1250. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Bogota.rb +0 -23
  1251. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Caracas.rb +0 -23
  1252. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Chicago.rb +0 -283
  1253. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Chihuahua.rb +0 -136
  1254. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Denver.rb +0 -204
  1255. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Godthab.rb +0 -161
  1256. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Guatemala.rb +0 -27
  1257. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Halifax.rb +0 -274
  1258. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Indiana/Indianapolis.rb +0 -149
  1259. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Juneau.rb +0 -194
  1260. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/La_Paz.rb +0 -22
  1261. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Lima.rb +0 -35
  1262. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Los_Angeles.rb +0 -232
  1263. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Mazatlan.rb +0 -139
  1264. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Mexico_City.rb +0 -144
  1265. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Monterrey.rb +0 -131
  1266. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/New_York.rb +0 -282
  1267. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Phoenix.rb +0 -30
  1268. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Regina.rb +0 -74
  1269. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Santiago.rb +0 -205
  1270. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/St_Johns.rb +0 -288
  1271. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Tijuana.rb +0 -196
  1272. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Almaty.rb +0 -67
  1273. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Baghdad.rb +0 -73
  1274. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Baku.rb +0 -161
  1275. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Bangkok.rb +0 -20
  1276. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Chongqing.rb +0 -33
  1277. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Dhaka.rb +0 -27
  1278. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Hong_Kong.rb +0 -87
  1279. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Irkutsk.rb +0 -165
  1280. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Jakarta.rb +0 -30
  1281. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Jerusalem.rb +0 -163
  1282. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kabul.rb +0 -20
  1283. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kamchatka.rb +0 -163
  1284. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Karachi.rb +0 -28
  1285. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Katmandu.rb +0 -20
  1286. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kolkata.rb +0 -25
  1287. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Krasnoyarsk.rb +0 -163
  1288. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kuala_Lumpur.rb +0 -31
  1289. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kuwait.rb +0 -18
  1290. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Magadan.rb +0 -163
  1291. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Muscat.rb +0 -18
  1292. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Novosibirsk.rb +0 -164
  1293. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Rangoon.rb +0 -24
  1294. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Riyadh.rb +0 -18
  1295. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Seoul.rb +0 -34
  1296. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Shanghai.rb +0 -35
  1297. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Singapore.rb +0 -33
  1298. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Taipei.rb +0 -59
  1299. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tashkent.rb +0 -47
  1300. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tbilisi.rb +0 -78
  1301. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tehran.rb +0 -121
  1302. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tokyo.rb +0 -30
  1303. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Ulaanbaatar.rb +0 -65
  1304. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Urumqi.rb +0 -33
  1305. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Vladivostok.rb +0 -164
  1306. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Yakutsk.rb +0 -163
  1307. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Yekaterinburg.rb +0 -165
  1308. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Yerevan.rb +0 -165
  1309. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Atlantic/Azores.rb +0 -270
  1310. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Atlantic/Cape_Verde.rb +0 -23
  1311. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Atlantic/South_Georgia.rb +0 -18
  1312. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Adelaide.rb +0 -187
  1313. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Brisbane.rb +0 -35
  1314. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Darwin.rb +0 -29
  1315. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Hobart.rb +0 -193
  1316. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Melbourne.rb +0 -185
  1317. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Perth.rb +0 -37
  1318. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Sydney.rb +0 -185
  1319. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Etc/UTC.rb +0 -16
  1320. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Amsterdam.rb +0 -228
  1321. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Athens.rb +0 -185
  1322. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Belgrade.rb +0 -163
  1323. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Berlin.rb +0 -188
  1324. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Bratislava.rb +0 -13
  1325. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Brussels.rb +0 -232
  1326. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Bucharest.rb +0 -181
  1327. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Budapest.rb +0 -197
  1328. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Copenhagen.rb +0 -179
  1329. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Dublin.rb +0 -276
  1330. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Helsinki.rb +0 -163
  1331. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Istanbul.rb +0 -218
  1332. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Kiev.rb +0 -168
  1333. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Lisbon.rb +0 -268
  1334. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Ljubljana.rb +0 -13
  1335. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/London.rb +0 -288
  1336. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Madrid.rb +0 -211
  1337. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Minsk.rb +0 -170
  1338. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Moscow.rb +0 -181
  1339. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Paris.rb +0 -232
  1340. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Prague.rb +0 -187
  1341. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Riga.rb +0 -176
  1342. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Rome.rb +0 -215
  1343. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Sarajevo.rb +0 -13
  1344. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Skopje.rb +0 -13
  1345. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Sofia.rb +0 -173
  1346. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Stockholm.rb +0 -165
  1347. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Tallinn.rb +0 -172
  1348. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Vienna.rb +0 -183
  1349. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Vilnius.rb +0 -170
  1350. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Warsaw.rb +0 -212
  1351. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Zagreb.rb +0 -13
  1352. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Auckland.rb +0 -202
  1353. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Fiji.rb +0 -23
  1354. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Guam.rb +0 -22
  1355. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Honolulu.rb +0 -28
  1356. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Majuro.rb +0 -20
  1357. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Midway.rb +0 -25
  1358. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Noumea.rb +0 -25
  1359. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Pago_Pago.rb +0 -26
  1360. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Port_Moresby.rb +0 -20
  1361. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Tongatapu.rb +0 -27
  1362. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/info_timezone.rb +0 -52
  1363. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/linked_timezone.rb +0 -51
  1364. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/linked_timezone_info.rb +0 -44
  1365. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/offset_rationals.rb +0 -95
  1366. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/time_or_datetime.rb +0 -292
  1367. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone.rb +0 -508
  1368. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_definition.rb +0 -56
  1369. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_info.rb +0 -40
  1370. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_offset_info.rb +0 -94
  1371. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_period.rb +0 -198
  1372. data/rails/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_transition_info.rb +0 -138
  1373. data/rails/vendor/rails/activesupport/lib/active_support/vendor/xml-simple-1.0.11/xmlsimple.rb +0 -1021
  1374. data/rails/vendor/rails/activesupport/lib/active_support/version.rb +0 -9
  1375. data/rails/vendor/rails/activesupport/lib/active_support/whiny_nil.rb +0 -58
  1376. data/rails/vendor/rails/activesupport/lib/activesupport.rb +0 -1
  1377. data/rails/vendor/rails/activesupport/test/abstract_unit.rb +0 -24
  1378. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/a/b.rb +0 -2
  1379. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/a/c/d.rb +0 -2
  1380. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/a/c/e/f.rb +0 -2
  1381. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/application.rb +0 -1
  1382. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/class_folder.rb +0 -3
  1383. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/class_folder_subclass.rb +0 -3
  1384. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/inline_class.rb +0 -2
  1385. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/nested_class.rb +0 -7
  1386. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/conflict.rb +0 -1
  1387. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/counting_loader.rb +0 -5
  1388. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/cross_site_dependency.rb +0 -2
  1389. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/e.rb +0 -2
  1390. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/inline_class.rb +0 -2
  1391. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/nested_class.rb +0 -4
  1392. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/nested_sibling.rb +0 -2
  1393. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/module_with_custom_const_missing/a/b.rb +0 -1
  1394. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/multiple_constant_file.rb +0 -2
  1395. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/raises_name_error.rb +0 -3
  1396. data/rails/vendor/rails/activesupport/test/autoloading_fixtures/raises_no_method_error.rb +0 -3
  1397. data/rails/vendor/rails/activesupport/test/buffered_logger_test.rb +0 -118
  1398. data/rails/vendor/rails/activesupport/test/caching_test.rb +0 -66
  1399. data/rails/vendor/rails/activesupport/test/callbacks_test.rb +0 -148
  1400. data/rails/vendor/rails/activesupport/test/clean_logger_test.rb +0 -57
  1401. data/rails/vendor/rails/activesupport/test/core_ext/array_ext_test.rb +0 -250
  1402. data/rails/vendor/rails/activesupport/test/core_ext/base64_ext_test.rb +0 -8
  1403. data/rails/vendor/rails/activesupport/test/core_ext/bigdecimal.rb +0 -9
  1404. data/rails/vendor/rails/activesupport/test/core_ext/blank_test.rb +0 -19
  1405. data/rails/vendor/rails/activesupport/test/core_ext/cgi_ext_test.rb +0 -14
  1406. data/rails/vendor/rails/activesupport/test/core_ext/class/attribute_accessor_test.rb +0 -31
  1407. data/rails/vendor/rails/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb +0 -224
  1408. data/rails/vendor/rails/activesupport/test/core_ext/class/delegating_attributes_test.rb +0 -115
  1409. data/rails/vendor/rails/activesupport/test/core_ext/class_test.rb +0 -46
  1410. data/rails/vendor/rails/activesupport/test/core_ext/date_ext_test.rb +0 -242
  1411. data/rails/vendor/rails/activesupport/test/core_ext/date_time_ext_test.rb +0 -288
  1412. data/rails/vendor/rails/activesupport/test/core_ext/duplicable_test.rb +0 -22
  1413. data/rails/vendor/rails/activesupport/test/core_ext/duration_test.rb +0 -74
  1414. data/rails/vendor/rails/activesupport/test/core_ext/enumerable_test.rb +0 -66
  1415. data/rails/vendor/rails/activesupport/test/core_ext/exception_test.rb +0 -68
  1416. data/rails/vendor/rails/activesupport/test/core_ext/file_test.rb +0 -29
  1417. data/rails/vendor/rails/activesupport/test/core_ext/float_ext_test.rb +0 -25
  1418. data/rails/vendor/rails/activesupport/test/core_ext/hash_ext_test.rb +0 -815
  1419. data/rails/vendor/rails/activesupport/test/core_ext/integer_ext_test.rb +0 -37
  1420. data/rails/vendor/rails/activesupport/test/core_ext/kernel_test.rb +0 -43
  1421. data/rails/vendor/rails/activesupport/test/core_ext/load_error_test.rb +0 -16
  1422. data/rails/vendor/rails/activesupport/test/core_ext/module/attr_accessor_with_default_test.rb +0 -30
  1423. data/rails/vendor/rails/activesupport/test/core_ext/module/attr_internal_test.rb +0 -52
  1424. data/rails/vendor/rails/activesupport/test/core_ext/module/attribute_accessor_test.rb +0 -33
  1425. data/rails/vendor/rails/activesupport/test/core_ext/module/attribute_aliasing_test.rb +0 -58
  1426. data/rails/vendor/rails/activesupport/test/core_ext/module_test.rb +0 -293
  1427. data/rails/vendor/rails/activesupport/test/core_ext/name_error_test.rb +0 -24
  1428. data/rails/vendor/rails/activesupport/test/core_ext/numeric_ext_test.rb +0 -162
  1429. data/rails/vendor/rails/activesupport/test/core_ext/object_and_class_ext_test.rb +0 -246
  1430. data/rails/vendor/rails/activesupport/test/core_ext/pathname_test.rb +0 -9
  1431. data/rails/vendor/rails/activesupport/test/core_ext/proc_test.rb +0 -11
  1432. data/rails/vendor/rails/activesupport/test/core_ext/range_ext_test.rb +0 -63
  1433. data/rails/vendor/rails/activesupport/test/core_ext/string_ext_test.rb +0 -199
  1434. data/rails/vendor/rails/activesupport/test/core_ext/symbol_test.rb +0 -9
  1435. data/rails/vendor/rails/activesupport/test/core_ext/time_ext_test.rb +0 -622
  1436. data/rails/vendor/rails/activesupport/test/core_ext/time_with_zone_test.rb +0 -676
  1437. data/rails/vendor/rails/activesupport/test/dependencies/check_warnings.rb +0 -2
  1438. data/rails/vendor/rails/activesupport/test/dependencies/conflict.rb +0 -1
  1439. data/rails/vendor/rails/activesupport/test/dependencies/cross_site_depender.rb +0 -3
  1440. data/rails/vendor/rails/activesupport/test/dependencies/mutual_one.rb +0 -4
  1441. data/rails/vendor/rails/activesupport/test/dependencies/mutual_two.rb +0 -4
  1442. data/rails/vendor/rails/activesupport/test/dependencies/raises_exception.rb +0 -3
  1443. data/rails/vendor/rails/activesupport/test/dependencies/requires_nonexistent0.rb +0 -1
  1444. data/rails/vendor/rails/activesupport/test/dependencies/requires_nonexistent1.rb +0 -1
  1445. data/rails/vendor/rails/activesupport/test/dependencies/service_one.rb +0 -5
  1446. data/rails/vendor/rails/activesupport/test/dependencies/service_two.rb +0 -2
  1447. data/rails/vendor/rails/activesupport/test/dependencies_test.rb +0 -765
  1448. data/rails/vendor/rails/activesupport/test/deprecation_test.rb +0 -151
  1449. data/rails/vendor/rails/activesupport/test/inflector_test.rb +0 -242
  1450. data/rails/vendor/rails/activesupport/test/inflector_test_cases.rb +0 -211
  1451. data/rails/vendor/rails/activesupport/test/json/decoding_test.rb +0 -41
  1452. data/rails/vendor/rails/activesupport/test/json/encoding_test.rb +0 -140
  1453. data/rails/vendor/rails/activesupport/test/multibyte_chars_test.rb +0 -182
  1454. data/rails/vendor/rails/activesupport/test/multibyte_conformance.rb +0 -146
  1455. data/rails/vendor/rails/activesupport/test/multibyte_handler_test.rb +0 -372
  1456. data/rails/vendor/rails/activesupport/test/option_merger_test.rb +0 -50
  1457. data/rails/vendor/rails/activesupport/test/ordered_hash_test.rb +0 -45
  1458. data/rails/vendor/rails/activesupport/test/ordered_options_test.rb +0 -53
  1459. data/rails/vendor/rails/activesupport/test/test_test.rb +0 -120
  1460. data/rails/vendor/rails/activesupport/test/time_zone_test.rb +0 -288
  1461. data/rails/vendor/rails/activesupport/test/whiny_nil_test.rb +0 -38
  1462. data/rails/vendor/rails/railties/CHANGELOG +0 -2027
  1463. data/rails/vendor/rails/railties/MIT-LICENSE +0 -20
  1464. data/rails/vendor/rails/railties/README +0 -256
  1465. data/rails/vendor/rails/railties/Rakefile +0 -349
  1466. data/rails/vendor/rails/railties/bin/about +0 -3
  1467. data/rails/vendor/rails/railties/bin/console +0 -3
  1468. data/rails/vendor/rails/railties/bin/dbconsole +0 -3
  1469. data/rails/vendor/rails/railties/bin/destroy +0 -3
  1470. data/rails/vendor/rails/railties/bin/generate +0 -3
  1471. data/rails/vendor/rails/railties/bin/performance/benchmarker +0 -3
  1472. data/rails/vendor/rails/railties/bin/performance/profiler +0 -3
  1473. data/rails/vendor/rails/railties/bin/performance/request +0 -3
  1474. data/rails/vendor/rails/railties/bin/plugin +0 -3
  1475. data/rails/vendor/rails/railties/bin/process/inspector +0 -3
  1476. data/rails/vendor/rails/railties/bin/process/reaper +0 -3
  1477. data/rails/vendor/rails/railties/bin/process/spawner +0 -3
  1478. data/rails/vendor/rails/railties/bin/rails +0 -19
  1479. data/rails/vendor/rails/railties/bin/runner +0 -3
  1480. data/rails/vendor/rails/railties/bin/server +0 -3
  1481. data/rails/vendor/rails/railties/builtin/rails_info/rails/info.rb +0 -125
  1482. data/rails/vendor/rails/railties/builtin/rails_info/rails/info_controller.rb +0 -9
  1483. data/rails/vendor/rails/railties/builtin/rails_info/rails/info_helper.rb +0 -2
  1484. data/rails/vendor/rails/railties/builtin/rails_info/rails_info_controller.rb +0 -2
  1485. data/rails/vendor/rails/railties/configs/apache.conf +0 -40
  1486. data/rails/vendor/rails/railties/configs/databases/frontbase.yml +0 -28
  1487. data/rails/vendor/rails/railties/configs/databases/mysql.yml +0 -54
  1488. data/rails/vendor/rails/railties/configs/databases/oracle.yml +0 -39
  1489. data/rails/vendor/rails/railties/configs/databases/postgresql.yml +0 -48
  1490. data/rails/vendor/rails/railties/configs/databases/sqlite2.yml +0 -16
  1491. data/rails/vendor/rails/railties/configs/databases/sqlite3.yml +0 -19
  1492. data/rails/vendor/rails/railties/configs/empty.log +0 -0
  1493. data/rails/vendor/rails/railties/configs/initializers/inflections.rb +0 -10
  1494. data/rails/vendor/rails/railties/configs/initializers/mime_types.rb +0 -5
  1495. data/rails/vendor/rails/railties/configs/initializers/new_rails_defaults.rb +0 -15
  1496. data/rails/vendor/rails/railties/configs/lighttpd.conf +0 -54
  1497. data/rails/vendor/rails/railties/configs/routes.rb +0 -41
  1498. data/rails/vendor/rails/railties/dispatches/dispatch.fcgi +0 -24
  1499. data/rails/vendor/rails/railties/dispatches/dispatch.rb +0 -10
  1500. data/rails/vendor/rails/railties/dispatches/gateway.cgi +0 -97
  1501. data/rails/vendor/rails/railties/doc/README_FOR_APP +0 -2
  1502. data/rails/vendor/rails/railties/environments/boot.rb +0 -109
  1503. data/rails/vendor/rails/railties/environments/development.rb +0 -17
  1504. data/rails/vendor/rails/railties/environments/environment.rb +0 -67
  1505. data/rails/vendor/rails/railties/environments/production.rb +0 -22
  1506. data/rails/vendor/rails/railties/environments/test.rb +0 -22
  1507. data/rails/vendor/rails/railties/fresh_rakefile +0 -10
  1508. data/rails/vendor/rails/railties/helpers/application.rb +0 -15
  1509. data/rails/vendor/rails/railties/helpers/application_helper.rb +0 -3
  1510. data/rails/vendor/rails/railties/helpers/test_helper.rb +0 -38
  1511. data/rails/vendor/rails/railties/html/404.html +0 -30
  1512. data/rails/vendor/rails/railties/html/422.html +0 -30
  1513. data/rails/vendor/rails/railties/html/500.html +0 -30
  1514. data/rails/vendor/rails/railties/html/favicon.ico +0 -0
  1515. data/rails/vendor/rails/railties/html/images/rails.png +0 -0
  1516. data/rails/vendor/rails/railties/html/index.html +0 -274
  1517. data/rails/vendor/rails/railties/html/javascripts/application.js +0 -2
  1518. data/rails/vendor/rails/railties/html/javascripts/controls.js +0 -963
  1519. data/rails/vendor/rails/railties/html/javascripts/dragdrop.js +0 -972
  1520. data/rails/vendor/rails/railties/html/javascripts/effects.js +0 -1120
  1521. data/rails/vendor/rails/railties/html/javascripts/prototype.js +0 -4225
  1522. data/rails/vendor/rails/railties/html/robots.txt +0 -5
  1523. data/rails/vendor/rails/railties/lib/code_statistics.rb +0 -107
  1524. data/rails/vendor/rails/railties/lib/commands.rb +0 -17
  1525. data/rails/vendor/rails/railties/lib/commands/about.rb +0 -2
  1526. data/rails/vendor/rails/railties/lib/commands/console.rb +0 -32
  1527. data/rails/vendor/rails/railties/lib/commands/dbconsole.rb +0 -65
  1528. data/rails/vendor/rails/railties/lib/commands/destroy.rb +0 -6
  1529. data/rails/vendor/rails/railties/lib/commands/generate.rb +0 -6
  1530. data/rails/vendor/rails/railties/lib/commands/ncgi/listener +0 -86
  1531. data/rails/vendor/rails/railties/lib/commands/ncgi/tracker +0 -69
  1532. data/rails/vendor/rails/railties/lib/commands/performance/benchmarker.rb +0 -24
  1533. data/rails/vendor/rails/railties/lib/commands/performance/profiler.rb +0 -50
  1534. data/rails/vendor/rails/railties/lib/commands/performance/request.rb +0 -6
  1535. data/rails/vendor/rails/railties/lib/commands/plugin.rb +0 -950
  1536. data/rails/vendor/rails/railties/lib/commands/process/inspector.rb +0 -68
  1537. data/rails/vendor/rails/railties/lib/commands/process/reaper.rb +0 -149
  1538. data/rails/vendor/rails/railties/lib/commands/process/spawner.rb +0 -219
  1539. data/rails/vendor/rails/railties/lib/commands/process/spinner.rb +0 -57
  1540. data/rails/vendor/rails/railties/lib/commands/runner.rb +0 -48
  1541. data/rails/vendor/rails/railties/lib/commands/server.rb +0 -39
  1542. data/rails/vendor/rails/railties/lib/commands/servers/base.rb +0 -31
  1543. data/rails/vendor/rails/railties/lib/commands/servers/lighttpd.rb +0 -94
  1544. data/rails/vendor/rails/railties/lib/commands/servers/mongrel.rb +0 -69
  1545. data/rails/vendor/rails/railties/lib/commands/servers/new_mongrel.rb +0 -16
  1546. data/rails/vendor/rails/railties/lib/commands/servers/webrick.rb +0 -66
  1547. data/rails/vendor/rails/railties/lib/commands/update.rb +0 -4
  1548. data/rails/vendor/rails/railties/lib/console_app.rb +0 -30
  1549. data/rails/vendor/rails/railties/lib/console_sandbox.rb +0 -6
  1550. data/rails/vendor/rails/railties/lib/console_with_helpers.rb +0 -26
  1551. data/rails/vendor/rails/railties/lib/dispatcher.rb +0 -24
  1552. data/rails/vendor/rails/railties/lib/fcgi_handler.rb +0 -239
  1553. data/rails/vendor/rails/railties/lib/initializer.rb +0 -900
  1554. data/rails/vendor/rails/railties/lib/rails/gem_builder.rb +0 -21
  1555. data/rails/vendor/rails/railties/lib/rails/gem_dependency.rb +0 -124
  1556. data/rails/vendor/rails/railties/lib/rails/mongrel_server/commands.rb +0 -342
  1557. data/rails/vendor/rails/railties/lib/rails/mongrel_server/handler.rb +0 -55
  1558. data/rails/vendor/rails/railties/lib/rails/plugin.rb +0 -115
  1559. data/rails/vendor/rails/railties/lib/rails/plugin/loader.rb +0 -152
  1560. data/rails/vendor/rails/railties/lib/rails/plugin/locator.rb +0 -99
  1561. data/rails/vendor/rails/railties/lib/rails/version.rb +0 -9
  1562. data/rails/vendor/rails/railties/lib/rails_generator.rb +0 -43
  1563. data/rails/vendor/rails/railties/lib/rails_generator/base.rb +0 -263
  1564. data/rails/vendor/rails/railties/lib/rails_generator/commands.rb +0 -607
  1565. data/rails/vendor/rails/railties/lib/rails_generator/generated_attribute.rb +0 -42
  1566. data/rails/vendor/rails/railties/lib/rails_generator/generators/applications/app/USAGE +0 -9
  1567. data/rails/vendor/rails/railties/lib/rails_generator/generators/applications/app/app_generator.rb +0 -178
  1568. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/controller/USAGE +0 -29
  1569. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/controller/controller_generator.rb +0 -37
  1570. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/controller.rb +0 -7
  1571. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/functional_test.rb +0 -8
  1572. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/helper.rb +0 -2
  1573. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/view.html.erb +0 -2
  1574. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/USAGE +0 -8
  1575. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/integration_test_generator.rb +0 -16
  1576. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb +0 -10
  1577. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/mailer/USAGE +0 -16
  1578. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb +0 -30
  1579. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/fixture.erb +0 -3
  1580. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/fixture.rhtml +0 -0
  1581. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/mailer.rb +0 -15
  1582. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +0 -21
  1583. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/view.erb +0 -3
  1584. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/view.rhtml +0 -0
  1585. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/migration/USAGE +0 -29
  1586. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/migration/migration_generator.rb +0 -20
  1587. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/migration/templates/migration.rb +0 -11
  1588. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/model/USAGE +0 -27
  1589. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/model/model_generator.rb +0 -45
  1590. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml +0 -19
  1591. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/migration.rb +0 -16
  1592. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/model.rb +0 -2
  1593. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/unit_test.rb +0 -8
  1594. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/observer/USAGE +0 -13
  1595. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/observer/observer_generator.rb +0 -16
  1596. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/observer/templates/observer.rb +0 -2
  1597. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/observer/templates/unit_test.rb +0 -8
  1598. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/plugin/USAGE +0 -25
  1599. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/plugin/plugin_generator.rb +0 -39
  1600. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/MIT-LICENSE +0 -20
  1601. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/README +0 -13
  1602. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/Rakefile +0 -22
  1603. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/USAGE +0 -8
  1604. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/generator.rb +0 -8
  1605. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/init.rb +0 -1
  1606. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/install.rb +0 -1
  1607. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/plugin.rb +0 -1
  1608. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/tasks.rake +0 -4
  1609. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/uninstall.rb +0 -1
  1610. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/unit_test.rb +0 -8
  1611. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE +0 -23
  1612. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/resource/resource_generator.rb +0 -74
  1613. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/controller.rb +0 -2
  1614. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb +0 -8
  1615. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/helper.rb +0 -2
  1616. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/USAGE +0 -25
  1617. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +0 -93
  1618. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb +0 -85
  1619. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb +0 -45
  1620. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/helper.rb +0 -2
  1621. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/layout.html.erb +0 -17
  1622. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/style.css +0 -54
  1623. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.html.erb +0 -18
  1624. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_index.html.erb +0 -24
  1625. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.html.erb +0 -17
  1626. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.html.erb +0 -10
  1627. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/USAGE +0 -10
  1628. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/session_migration_generator.rb +0 -18
  1629. data/rails/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/templates/migration.rb +0 -16
  1630. data/rails/vendor/rails/railties/lib/rails_generator/lookup.rb +0 -248
  1631. data/rails/vendor/rails/railties/lib/rails_generator/manifest.rb +0 -53
  1632. data/rails/vendor/rails/railties/lib/rails_generator/options.rb +0 -150
  1633. data/rails/vendor/rails/railties/lib/rails_generator/scripts.rb +0 -89
  1634. data/rails/vendor/rails/railties/lib/rails_generator/scripts/destroy.rb +0 -30
  1635. data/rails/vendor/rails/railties/lib/rails_generator/scripts/generate.rb +0 -7
  1636. data/rails/vendor/rails/railties/lib/rails_generator/scripts/update.rb +0 -12
  1637. data/rails/vendor/rails/railties/lib/rails_generator/secret_key_generator.rb +0 -164
  1638. data/rails/vendor/rails/railties/lib/rails_generator/simple_logger.rb +0 -46
  1639. data/rails/vendor/rails/railties/lib/rails_generator/spec.rb +0 -44
  1640. data/rails/vendor/rails/railties/lib/railties_path.rb +0 -1
  1641. data/rails/vendor/rails/railties/lib/ruby_version_check.rb +0 -17
  1642. data/rails/vendor/rails/railties/lib/rubyprof_ext.rb +0 -35
  1643. data/rails/vendor/rails/railties/lib/source_annotation_extractor.rb +0 -102
  1644. data/rails/vendor/rails/railties/lib/tasks/annotations.rake +0 -23
  1645. data/rails/vendor/rails/railties/lib/tasks/databases.rake +0 -387
  1646. data/rails/vendor/rails/railties/lib/tasks/documentation.rake +0 -80
  1647. data/rails/vendor/rails/railties/lib/tasks/framework.rake +0 -114
  1648. data/rails/vendor/rails/railties/lib/tasks/gems.rake +0 -64
  1649. data/rails/vendor/rails/railties/lib/tasks/log.rake +0 -9
  1650. data/rails/vendor/rails/railties/lib/tasks/misc.rake +0 -57
  1651. data/rails/vendor/rails/railties/lib/tasks/rails.rb +0 -8
  1652. data/rails/vendor/rails/railties/lib/tasks/routes.rake +0 -17
  1653. data/rails/vendor/rails/railties/lib/tasks/statistics.rake +0 -18
  1654. data/rails/vendor/rails/railties/lib/tasks/testing.rake +0 -118
  1655. data/rails/vendor/rails/railties/lib/tasks/tmp.rake +0 -37
  1656. data/rails/vendor/rails/railties/lib/test_help.rb +0 -28
  1657. data/rails/vendor/rails/railties/lib/webrick_server.rb +0 -165
  1658. data/rails/vendor/rails/railties/test/abstract_unit.rb +0 -24
  1659. data/rails/vendor/rails/railties/test/boot_test.rb +0 -181
  1660. data/rails/vendor/rails/railties/test/console_app_test.rb +0 -32
  1661. data/rails/vendor/rails/railties/test/fcgi_dispatcher_test.rb +0 -299
  1662. data/rails/vendor/rails/railties/test/fixtures/about_yml_plugins/bad_about_yml/about.yml +0 -1
  1663. data/rails/vendor/rails/railties/test/fixtures/about_yml_plugins/bad_about_yml/init.rb +0 -1
  1664. data/rails/vendor/rails/railties/test/fixtures/about_yml_plugins/plugin_without_about_yml/init.rb +0 -1
  1665. data/rails/vendor/rails/railties/test/fixtures/environment_with_constant.rb +0 -1
  1666. data/rails/vendor/rails/railties/test/fixtures/lib/generators/missing_class/missing_class_generator.rb +0 -0
  1667. data/rails/vendor/rails/railties/test/fixtures/lib/generators/working/working_generator.rb +0 -2
  1668. data/rails/vendor/rails/railties/test/fixtures/plugins/alternate/a/generators/a_generator/a_generator.rb +0 -4
  1669. data/rails/vendor/rails/railties/test/fixtures/plugins/default/plugin_with_no_lib_dir/init.rb +0 -0
  1670. data/rails/vendor/rails/railties/test/fixtures/plugins/default/stubby/about.yml +0 -2
  1671. data/rails/vendor/rails/railties/test/fixtures/plugins/default/stubby/generators/stubby_generator/stubby_generator.rb +0 -4
  1672. data/rails/vendor/rails/railties/test/fixtures/plugins/default/stubby/init.rb +0 -7
  1673. data/rails/vendor/rails/railties/test/fixtures/plugins/default/stubby/lib/stubby_mixin.rb +0 -2
  1674. data/rails/vendor/rails/railties/test/gem_dependency_test.rb +0 -66
  1675. data/rails/vendor/rails/railties/test/generator_lookup_test.rb +0 -40
  1676. data/rails/vendor/rails/railties/test/generators/generator_test_helper.rb +0 -287
  1677. data/rails/vendor/rails/railties/test/generators/rails_controller_generator_test.rb +0 -20
  1678. data/rails/vendor/rails/railties/test/generators/rails_mailer_generator_test.rb +0 -29
  1679. data/rails/vendor/rails/railties/test/generators/rails_model_generator_test.rb +0 -32
  1680. data/rails/vendor/rails/railties/test/generators/rails_resource_generator_test.rb +0 -29
  1681. data/rails/vendor/rails/railties/test/generators/rails_scaffold_generator_test.rb +0 -107
  1682. data/rails/vendor/rails/railties/test/initializer_test.rb +0 -225
  1683. data/rails/vendor/rails/railties/test/mocks/routes.rb +0 -6
  1684. data/rails/vendor/rails/railties/test/plugin_loader_test.rb +0 -142
  1685. data/rails/vendor/rails/railties/test/plugin_locator_test.rb +0 -69
  1686. data/rails/vendor/rails/railties/test/plugin_test.rb +0 -159
  1687. data/rails/vendor/rails/railties/test/plugin_test_helper.rb +0 -29
  1688. data/rails/vendor/rails/railties/test/rails_generator_test.rb +0 -145
  1689. data/rails/vendor/rails/railties/test/rails_info_controller_test.rb +0 -48
  1690. data/rails/vendor/rails/railties/test/rails_info_test.rb +0 -99
  1691. data/rails/vendor/rails/railties/test/secret_key_generation_test.rb +0 -44
  1692. data/templates/colors_template_file.xml +0 -7
  1693. data/templates/defaults_template_file.yml +0 -2
  1694. data/tmp/useless.txt +0 -1
@@ -1,2726 +0,0 @@
1
- require 'yaml'
2
- require 'set'
3
-
4
- module ActiveRecord #:nodoc:
5
- # Generic Active Record exception class.
6
- class ActiveRecordError < StandardError
7
- end
8
-
9
- # Raised when the single-table inheritance mechanism failes to locate the subclass
10
- # (for example due to improper usage of column that +inheritance_column+ points to).
11
- class SubclassNotFound < ActiveRecordError #:nodoc:
12
- end
13
-
14
- # Raised when an object assigned to an association has an incorrect type.
15
- #
16
- # class Ticket < ActiveRecord::Base
17
- # has_many :patches
18
- # end
19
- #
20
- # class Patch < ActiveRecord::Base
21
- # belongs_to :ticket
22
- # end
23
- #
24
- # # Comments are not patches, this assignment raises AssociationTypeMismatch.
25
- # @ticket.patches << Comment.new(:content => "Please attach tests to your patch.")
26
- class AssociationTypeMismatch < ActiveRecordError
27
- end
28
-
29
- # Raised when unserialized object's type mismatches one specified for serializable field.
30
- class SerializationTypeMismatch < ActiveRecordError
31
- end
32
-
33
- # Raised when adapter not specified on connection (or configuration file <tt>config/database.yml</tt> misses adapter field).
34
- class AdapterNotSpecified < ActiveRecordError
35
- end
36
-
37
- # Raised when Active Record cannot find database adapter specified in <tt>config/database.yml</tt> or programmatically.
38
- class AdapterNotFound < ActiveRecordError
39
- end
40
-
41
- # Raised when connection to the database could not been established (for example when <tt>connection=</tt> is given a nil object).
42
- class ConnectionNotEstablished < ActiveRecordError
43
- end
44
-
45
- # Raised when Active Record cannot find record by given id or set of ids.
46
- class RecordNotFound < ActiveRecordError
47
- end
48
-
49
- # Raised by ActiveRecord::Base.save! and ActiveRecord::Base.create! methods when record cannot be
50
- # saved because record is invalid.
51
- class RecordNotSaved < ActiveRecordError
52
- end
53
-
54
- # Raised when SQL statement cannot be executed by the database (for example, it's often the case for MySQL when Ruby driver used is too old).
55
- class StatementInvalid < ActiveRecordError
56
- end
57
-
58
- # Raised when number of bind variables in statement given to <tt>:condition</tt> key (for example, when using +find+ method)
59
- # does not match number of expected variables.
60
- #
61
- # For example, in
62
- #
63
- # Location.find :all, :conditions => ["lat = ? AND lng = ?", 53.7362]
64
- #
65
- # two placeholders are given but only one variable to fill them.
66
- class PreparedStatementInvalid < ActiveRecordError
67
- end
68
-
69
- # Raised on attempt to save stale record. Record is stale when it's being saved in another query after
70
- # instantiation, for example, when two users edit the same wiki page and one starts editing and saves
71
- # the page before the other.
72
- #
73
- # Read more about optimistic locking in ActiveRecord::Locking module RDoc.
74
- class StaleObjectError < ActiveRecordError
75
- end
76
-
77
- # Raised when association is being configured improperly or
78
- # user tries to use offset and limit together with has_many or has_and_belongs_to_many associations.
79
- class ConfigurationError < ActiveRecordError
80
- end
81
-
82
- # Raised on attempt to update record that is instantiated as read only.
83
- class ReadOnlyRecord < ActiveRecordError
84
- end
85
-
86
- # Used by Active Record transaction mechanism to distinguish rollback from other exceptional situations.
87
- # You can use it to roll your transaction back explicitly in the block passed to +transaction+ method.
88
- class Rollback < ActiveRecordError
89
- end
90
-
91
- # Raised when attribute has a name reserved by Active Record (when attribute has name of one of Active Record instance methods).
92
- class DangerousAttributeError < ActiveRecordError
93
- end
94
-
95
- # Raised when you've tried to access a column which wasn't loaded by your finder.
96
- # Typically this is because <tt>:select</tt> has been specified.
97
- class MissingAttributeError < NoMethodError
98
- end
99
-
100
- # Raised when an error occured while doing a mass assignment to an attribute through the
101
- # <tt>attributes=</tt> method. The exception has an +attribute+ property that is the name of the
102
- # offending attribute.
103
- class AttributeAssignmentError < ActiveRecordError
104
- attr_reader :exception, :attribute
105
- def initialize(message, exception, attribute)
106
- @exception = exception
107
- @attribute = attribute
108
- @message = message
109
- end
110
- end
111
-
112
- # Raised when there are multiple errors while doing a mass assignment through the +attributes+
113
- # method. The exception has an +errors+ property that contains an array of AttributeAssignmentError
114
- # objects, each corresponding to the error while assigning to an attribute.
115
- class MultiparameterAssignmentErrors < ActiveRecordError
116
- attr_reader :errors
117
- def initialize(errors)
118
- @errors = errors
119
- end
120
- end
121
-
122
- # Active Record objects don't specify their attributes directly, but rather infer them from the table definition with
123
- # which they're linked. Adding, removing, and changing attributes and their type is done directly in the database. Any change
124
- # is instantly reflected in the Active Record objects. The mapping that binds a given Active Record class to a certain
125
- # database table will happen automatically in most common cases, but can be overwritten for the uncommon ones.
126
- #
127
- # See the mapping rules in table_name and the full example in link:files/README.html for more insight.
128
- #
129
- # == Creation
130
- #
131
- # Active Records accept constructor parameters either in a hash or as a block. The hash method is especially useful when
132
- # you're receiving the data from somewhere else, like an HTTP request. It works like this:
133
- #
134
- # user = User.new(:name => "David", :occupation => "Code Artist")
135
- # user.name # => "David"
136
- #
137
- # You can also use block initialization:
138
- #
139
- # user = User.new do |u|
140
- # u.name = "David"
141
- # u.occupation = "Code Artist"
142
- # end
143
- #
144
- # And of course you can just create a bare object and specify the attributes after the fact:
145
- #
146
- # user = User.new
147
- # user.name = "David"
148
- # user.occupation = "Code Artist"
149
- #
150
- # == Conditions
151
- #
152
- # Conditions can either be specified as a string, array, or hash representing the WHERE-part of an SQL statement.
153
- # The array form is to be used when the condition input is tainted and requires sanitization. The string form can
154
- # be used for statements that don't involve tainted data. The hash form works much like the array form, except
155
- # only equality and range is possible. Examples:
156
- #
157
- # class User < ActiveRecord::Base
158
- # def self.authenticate_unsafely(user_name, password)
159
- # find(:first, :conditions => "user_name = '#{user_name}' AND password = '#{password}'")
160
- # end
161
- #
162
- # def self.authenticate_safely(user_name, password)
163
- # find(:first, :conditions => [ "user_name = ? AND password = ?", user_name, password ])
164
- # end
165
- #
166
- # def self.authenticate_safely_simply(user_name, password)
167
- # find(:first, :conditions => { :user_name => user_name, :password => password })
168
- # end
169
- # end
170
- #
171
- # The <tt>authenticate_unsafely</tt> method inserts the parameters directly into the query and is thus susceptible to SQL-injection
172
- # attacks if the <tt>user_name</tt> and +password+ parameters come directly from an HTTP request. The <tt>authenticate_safely</tt> and
173
- # <tt>authenticate_safely_simply</tt> both will sanitize the <tt>user_name</tt> and +password+ before inserting them in the query,
174
- # which will ensure that an attacker can't escape the query and fake the login (or worse).
175
- #
176
- # When using multiple parameters in the conditions, it can easily become hard to read exactly what the fourth or fifth
177
- # question mark is supposed to represent. In those cases, you can resort to named bind variables instead. That's done by replacing
178
- # the question marks with symbols and supplying a hash with values for the matching symbol keys:
179
- #
180
- # Company.find(:first, :conditions => [
181
- # "id = :id AND name = :name AND division = :division AND created_at > :accounting_date",
182
- # { :id => 3, :name => "37signals", :division => "First", :accounting_date => '2005-01-01' }
183
- # ])
184
- #
185
- # Similarly, a simple hash without a statement will generate conditions based on equality with the SQL AND
186
- # operator. For instance:
187
- #
188
- # Student.find(:all, :conditions => { :first_name => "Harvey", :status => 1 })
189
- # Student.find(:all, :conditions => params[:student])
190
- #
191
- # A range may be used in the hash to use the SQL BETWEEN operator:
192
- #
193
- # Student.find(:all, :conditions => { :grade => 9..12 })
194
- #
195
- # An array may be used in the hash to use the SQL IN operator:
196
- #
197
- # Student.find(:all, :conditions => { :grade => [9,11,12] })
198
- #
199
- # == Overwriting default accessors
200
- #
201
- # All column values are automatically available through basic accessors on the Active Record object, but sometimes you
202
- # want to specialize this behavior. This can be done by overwriting the default accessors (using the same
203
- # name as the attribute) and calling <tt>read_attribute(attr_name)</tt> and <tt>write_attribute(attr_name, value)</tt> to actually change things.
204
- # Example:
205
- #
206
- # class Song < ActiveRecord::Base
207
- # # Uses an integer of seconds to hold the length of the song
208
- #
209
- # def length=(minutes)
210
- # write_attribute(:length, minutes.to_i * 60)
211
- # end
212
- #
213
- # def length
214
- # read_attribute(:length) / 60
215
- # end
216
- # end
217
- #
218
- # You can alternatively use <tt>self[:attribute]=(value)</tt> and <tt>self[:attribute]</tt> instead of <tt>write_attribute(:attribute, value)</tt> and
219
- # <tt>read_attribute(:attribute)</tt> as a shorter form.
220
- #
221
- # == Attribute query methods
222
- #
223
- # In addition to the basic accessors, query methods are also automatically available on the Active Record object.
224
- # Query methods allow you to test whether an attribute value is present.
225
- #
226
- # For example, an Active Record User with the <tt>name</tt> attribute has a <tt>name?</tt> method that you can call
227
- # to determine whether the user has a name:
228
- #
229
- # user = User.new(:name => "David")
230
- # user.name? # => true
231
- #
232
- # anonymous = User.new(:name => "")
233
- # anonymous.name? # => false
234
- #
235
- # == Accessing attributes before they have been typecasted
236
- #
237
- # Sometimes you want to be able to read the raw attribute data without having the column-determined typecast run its course first.
238
- # That can be done by using the <tt><attribute>_before_type_cast</tt> accessors that all attributes have. For example, if your Account model
239
- # has a <tt>balance</tt> attribute, you can call <tt>account.balance_before_type_cast</tt> or <tt>account.id_before_type_cast</tt>.
240
- #
241
- # This is especially useful in validation situations where the user might supply a string for an integer field and you want to display
242
- # the original string back in an error message. Accessing the attribute normally would typecast the string to 0, which isn't what you
243
- # want.
244
- #
245
- # == Dynamic attribute-based finders
246
- #
247
- # Dynamic attribute-based finders are a cleaner way of getting (and/or creating) objects by simple queries without turning to SQL. They work by
248
- # appending the name of an attribute to <tt>find_by_</tt> or <tt>find_all_by_</tt>, so you get finders like <tt>Person.find_by_user_name</tt>,
249
- # <tt>Person.find_all_by_last_name</tt>, and <tt>Payment.find_by_transaction_id</tt>. So instead of writing
250
- # <tt>Person.find(:first, :conditions => ["user_name = ?", user_name])</tt>, you just do <tt>Person.find_by_user_name(user_name)</tt>.
251
- # And instead of writing <tt>Person.find(:all, :conditions => ["last_name = ?", last_name])</tt>, you just do <tt>Person.find_all_by_last_name(last_name)</tt>.
252
- #
253
- # It's also possible to use multiple attributes in the same find by separating them with "_and_", so you get finders like
254
- # <tt>Person.find_by_user_name_and_password</tt> or even <tt>Payment.find_by_purchaser_and_state_and_country</tt>. So instead of writing
255
- # <tt>Person.find(:first, :conditions => ["user_name = ? AND password = ?", user_name, password])</tt>, you just do
256
- # <tt>Person.find_by_user_name_and_password(user_name, password)</tt>.
257
- #
258
- # It's even possible to use all the additional parameters to find. For example, the full interface for <tt>Payment.find_all_by_amount</tt>
259
- # is actually <tt>Payment.find_all_by_amount(amount, options)</tt>. And the full interface to <tt>Person.find_by_user_name</tt> is
260
- # actually <tt>Person.find_by_user_name(user_name, options)</tt>. So you could call <tt>Payment.find_all_by_amount(50, :order => "created_on")</tt>.
261
- #
262
- # The same dynamic finder style can be used to create the object if it doesn't already exist. This dynamic finder is called with
263
- # <tt>find_or_create_by_</tt> and will return the object if it already exists and otherwise creates it, then returns it. Protected attributes won't be set unless they are given in a block. For example:
264
- #
265
- # # No 'Summer' tag exists
266
- # Tag.find_or_create_by_name("Summer") # equal to Tag.create(:name => "Summer")
267
- #
268
- # # Now the 'Summer' tag does exist
269
- # Tag.find_or_create_by_name("Summer") # equal to Tag.find_by_name("Summer")
270
- #
271
- # # Now 'Bob' exist and is an 'admin'
272
- # User.find_or_create_by_name('Bob', :age => 40) { |u| u.admin = true }
273
- #
274
- # Use the <tt>find_or_initialize_by_</tt> finder if you want to return a new record without saving it first. Protected attributes won't be setted unless they are given in a block. For example:
275
- #
276
- # # No 'Winter' tag exists
277
- # winter = Tag.find_or_initialize_by_name("Winter")
278
- # winter.new_record? # true
279
- #
280
- # To find by a subset of the attributes to be used for instantiating a new object, pass a hash instead of
281
- # a list of parameters. For example:
282
- #
283
- # Tag.find_or_create_by_name(:name => "rails", :creator => current_user)
284
- #
285
- # That will either find an existing tag named "rails", or create a new one while setting the user that created it.
286
- #
287
- # == Saving arrays, hashes, and other non-mappable objects in text columns
288
- #
289
- # Active Record can serialize any object in text columns using YAML. To do so, you must specify this with a call to the class method +serialize+.
290
- # This makes it possible to store arrays, hashes, and other non-mappable objects without doing any additional work. Example:
291
- #
292
- # class User < ActiveRecord::Base
293
- # serialize :preferences
294
- # end
295
- #
296
- # user = User.create(:preferences => { "background" => "black", "display" => large })
297
- # User.find(user.id).preferences # => { "background" => "black", "display" => large }
298
- #
299
- # You can also specify a class option as the second parameter that'll raise an exception if a serialized object is retrieved as a
300
- # descendent of a class not in the hierarchy. Example:
301
- #
302
- # class User < ActiveRecord::Base
303
- # serialize :preferences, Hash
304
- # end
305
- #
306
- # user = User.create(:preferences => %w( one two three ))
307
- # User.find(user.id).preferences # raises SerializationTypeMismatch
308
- #
309
- # == Single table inheritance
310
- #
311
- # Active Record allows inheritance by storing the name of the class in a column that by default is named "type" (can be changed
312
- # by overwriting <tt>Base.inheritance_column</tt>). This means that an inheritance looking like this:
313
- #
314
- # class Company < ActiveRecord::Base; end
315
- # class Firm < Company; end
316
- # class Client < Company; end
317
- # class PriorityClient < Client; end
318
- #
319
- # When you do <tt>Firm.create(:name => "37signals")</tt>, this record will be saved in the companies table with type = "Firm". You can then
320
- # fetch this row again using <tt>Company.find(:first, "name = '37signals'")</tt> and it will return a Firm object.
321
- #
322
- # If you don't have a type column defined in your table, single-table inheritance won't be triggered. In that case, it'll work just
323
- # like normal subclasses with no special magic for differentiating between them or reloading the right type with find.
324
- #
325
- # Note, all the attributes for all the cases are kept in the same table. Read more:
326
- # http://www.martinfowler.com/eaaCatalog/singleTableInheritance.html
327
- #
328
- # == Connection to multiple databases in different models
329
- #
330
- # Connections are usually created through ActiveRecord::Base.establish_connection and retrieved by ActiveRecord::Base.connection.
331
- # All classes inheriting from ActiveRecord::Base will use this connection. But you can also set a class-specific connection.
332
- # For example, if Course is an ActiveRecord::Base, but resides in a different database, you can just say <tt>Course.establish_connection</tt>
333
- # and Course and all of its subclasses will use this connection instead.
334
- #
335
- # This feature is implemented by keeping a connection pool in ActiveRecord::Base that is a Hash indexed by the class. If a connection is
336
- # requested, the retrieve_connection method will go up the class-hierarchy until a connection is found in the connection pool.
337
- #
338
- # == Exceptions
339
- #
340
- # * ActiveRecordError - Generic error class and superclass of all other errors raised by Active Record.
341
- # * AdapterNotSpecified - The configuration hash used in <tt>establish_connection</tt> didn't include an
342
- # <tt>:adapter</tt> key.
343
- # * AdapterNotFound - The <tt>:adapter</tt> key used in <tt>establish_connection</tt> specified a non-existent adapter
344
- # (or a bad spelling of an existing one).
345
- # * AssociationTypeMismatch - The object assigned to the association wasn't of the type specified in the association definition.
346
- # * SerializationTypeMismatch - The serialized object wasn't of the class specified as the second parameter.
347
- # * ConnectionNotEstablished+ - No connection has been established. Use <tt>establish_connection</tt> before querying.
348
- # * RecordNotFound - No record responded to the +find+ method. Either the row with the given ID doesn't exist
349
- # or the row didn't meet the additional restrictions. Some +find+ calls do not raise this exception to signal
350
- # nothing was found, please check its documentation for further details.
351
- # * StatementInvalid - The database server rejected the SQL statement. The precise error is added in the message.
352
- # * MultiparameterAssignmentErrors - Collection of errors that occurred during a mass assignment using the
353
- # <tt>attributes=</tt> method. The +errors+ property of this exception contains an array of AttributeAssignmentError
354
- # objects that should be inspected to determine which attributes triggered the errors.
355
- # * AttributeAssignmentError - An error occurred while doing a mass assignment through the <tt>attributes=</tt> method.
356
- # You can inspect the +attribute+ property of the exception object to determine which attribute triggered the error.
357
- #
358
- # *Note*: The attributes listed are class-level attributes (accessible from both the class and instance level).
359
- # So it's possible to assign a logger to the class through <tt>Base.logger=</tt> which will then be used by all
360
- # instances in the current object space.
361
- class Base
362
- # Accepts a logger conforming to the interface of Log4r or the default Ruby 1.8+ Logger class, which is then passed
363
- # on to any new database connections made and which can be retrieved on both a class and instance level by calling +logger+.
364
- cattr_accessor :logger, :instance_writer => false
365
-
366
- def self.inherited(child) #:nodoc:
367
- @@subclasses[self] ||= []
368
- @@subclasses[self] << child
369
- super
370
- end
371
-
372
- def self.reset_subclasses #:nodoc:
373
- nonreloadables = []
374
- subclasses.each do |klass|
375
- unless Dependencies.autoloaded? klass
376
- nonreloadables << klass
377
- next
378
- end
379
- klass.instance_variables.each { |var| klass.send(:remove_instance_variable, var) }
380
- klass.instance_methods(false).each { |m| klass.send :undef_method, m }
381
- end
382
- @@subclasses = {}
383
- nonreloadables.each { |klass| (@@subclasses[klass.superclass] ||= []) << klass }
384
- end
385
-
386
- @@subclasses = {}
387
-
388
- cattr_accessor :configurations, :instance_writer => false
389
- @@configurations = {}
390
-
391
- # Accessor for the prefix type that will be prepended to every primary key column name. The options are :table_name and
392
- # :table_name_with_underscore. If the first is specified, the Product class will look for "productid" instead of "id" as
393
- # the primary column. If the latter is specified, the Product class will look for "product_id" instead of "id". Remember
394
- # that this is a global setting for all Active Records.
395
- cattr_accessor :primary_key_prefix_type, :instance_writer => false
396
- @@primary_key_prefix_type = nil
397
-
398
- # Accessor for the name of the prefix string to prepend to every table name. So if set to "basecamp_", all
399
- # table names will be named like "basecamp_projects", "basecamp_people", etc. This is a convenient way of creating a namespace
400
- # for tables in a shared database. By default, the prefix is the empty string.
401
- cattr_accessor :table_name_prefix, :instance_writer => false
402
- @@table_name_prefix = ""
403
-
404
- # Works like +table_name_prefix+, but appends instead of prepends (set to "_basecamp" gives "projects_basecamp",
405
- # "people_basecamp"). By default, the suffix is the empty string.
406
- cattr_accessor :table_name_suffix, :instance_writer => false
407
- @@table_name_suffix = ""
408
-
409
- # Indicates whether table names should be the pluralized versions of the corresponding class names.
410
- # If true, the default table name for a Product class will be +products+. If false, it would just be +product+.
411
- # See table_name for the full rules on table/class naming. This is true, by default.
412
- cattr_accessor :pluralize_table_names, :instance_writer => false
413
- @@pluralize_table_names = true
414
-
415
- # Determines whether to use ANSI codes to colorize the logging statements committed by the connection adapter. These colors
416
- # make it much easier to overview things during debugging (when used through a reader like +tail+ and on a black background), but
417
- # may complicate matters if you use software like syslog. This is true, by default.
418
- cattr_accessor :colorize_logging, :instance_writer => false
419
- @@colorize_logging = true
420
-
421
- # Determines whether to use Time.local (using :local) or Time.utc (using :utc) when pulling dates and times from the database.
422
- # This is set to :local by default.
423
- cattr_accessor :default_timezone, :instance_writer => false
424
- @@default_timezone = :local
425
-
426
- # Determines whether to use a connection for each thread, or a single shared connection for all threads.
427
- # Defaults to false. If you're writing a threaded application, set to true
428
- # and periodically call verify_active_connections! to clear out connections
429
- # assigned to stale threads.
430
- cattr_accessor :allow_concurrency, :instance_writer => false
431
- @@allow_concurrency = false
432
-
433
- # Specifies the format to use when dumping the database schema with Rails'
434
- # Rakefile. If :sql, the schema is dumped as (potentially database-
435
- # specific) SQL statements. If :ruby, the schema is dumped as an
436
- # ActiveRecord::Schema file which can be loaded into any database that
437
- # supports migrations. Use :ruby if you want to have different database
438
- # adapters for, e.g., your development and test environments.
439
- cattr_accessor :schema_format , :instance_writer => false
440
- @@schema_format = :ruby
441
-
442
- # Determine whether to store the full constant name including namespace when using STI
443
- superclass_delegating_accessor :store_full_sti_class
444
- self.store_full_sti_class = false
445
-
446
- class << self # Class methods
447
- # Find operates with four different retrieval approaches:
448
- #
449
- # * Find by id - This can either be a specific id (1), a list of ids (1, 5, 6), or an array of ids ([5, 6, 10]).
450
- # If no record can be found for all of the listed ids, then RecordNotFound will be raised.
451
- # * Find first - This will return the first record matched by the options used. These options can either be specific
452
- # conditions or merely an order. If no record can be matched, +nil+ is returned. Use
453
- # <tt>Model.find(:first, *args)</tt> or its shortcut <tt>Model.first(*args)</tt>.
454
- # * Find last - This will return the last record matched by the options used. These options can either be specific
455
- # conditions or merely an order. If no record can be matched, +nil+ is returned. Use
456
- # <tt>Model.find(:last, *args)</tt> or its shortcut <tt>Model.last(*args)</tt>.
457
- # * Find all - This will return all the records matched by the options used.
458
- # If no records are found, an empty array is returned. Use
459
- # <tt>Model.find(:all, *args)</tt> or its shortcut <tt>Model.all(*args)</tt>.
460
- #
461
- # All approaches accept an options hash as their last parameter.
462
- #
463
- # ==== Attributes
464
- #
465
- # * <tt>:conditions</tt> - An SQL fragment like "administrator = 1" or <tt>[ "user_name = ?", username ]</tt>. See conditions in the intro.
466
- # * <tt>:order</tt> - An SQL fragment like "created_at DESC, name".
467
- # * <tt>:group</tt> - An attribute name by which the result should be grouped. Uses the <tt>GROUP BY</tt> SQL-clause.
468
- # * <tt>:limit</tt> - An integer determining the limit on the number of rows that should be returned.
469
- # * <tt>:offset</tt> - An integer determining the offset from where the rows should be fetched. So at 5, it would skip rows 0 through 4.
470
- # * <tt>:joins</tt> - Either an SQL fragment for additional joins like "LEFT JOIN comments ON comments.post_id = id" (rarely needed)
471
- # or named associations in the same form used for the <tt>:include</tt> option, which will perform an <tt>INNER JOIN</tt> on the associated table(s).
472
- # If the value is a string, then the records will be returned read-only since they will have attributes that do not correspond to the table's columns.
473
- # Pass <tt>:readonly => false</tt> to override.
474
- # * <tt>:include</tt> - Names associations that should be loaded alongside. The symbols named refer
475
- # to already defined associations. See eager loading under Associations.
476
- # * <tt>:select</tt> - By default, this is "*" as in "SELECT * FROM", but can be changed if you, for example, want to do a join but not
477
- # include the joined columns.
478
- # * <tt>:from</tt> - By default, this is the table name of the class, but can be changed to an alternate table name (or even the name
479
- # of a database view).
480
- # * <tt>:readonly</tt> - Mark the returned records read-only so they cannot be saved or updated.
481
- # * <tt>:lock</tt> - An SQL fragment like "FOR UPDATE" or "LOCK IN SHARE MODE".
482
- # <tt>:lock => true</tt> gives connection's default exclusive lock, usually "FOR UPDATE".
483
- #
484
- # ==== Examples
485
- #
486
- # # find by id
487
- # Person.find(1) # returns the object for ID = 1
488
- # Person.find(1, 2, 6) # returns an array for objects with IDs in (1, 2, 6)
489
- # Person.find([7, 17]) # returns an array for objects with IDs in (7, 17)
490
- # Person.find([1]) # returns an array for the object with ID = 1
491
- # Person.find(1, :conditions => "administrator = 1", :order => "created_on DESC")
492
- #
493
- # Note that returned records may not be in the same order as the ids you
494
- # provide since database rows are unordered. Give an explicit <tt>:order</tt>
495
- # to ensure the results are sorted.
496
- #
497
- # ==== Examples
498
- #
499
- # # find first
500
- # Person.find(:first) # returns the first object fetched by SELECT * FROM people
501
- # Person.find(:first, :conditions => [ "user_name = ?", user_name])
502
- # Person.find(:first, :order => "created_on DESC", :offset => 5)
503
- #
504
- # # find last
505
- # Person.find(:last) # returns the last object fetched by SELECT * FROM people
506
- # Person.find(:last, :conditions => [ "user_name = ?", user_name])
507
- # Person.find(:last, :order => "created_on DESC", :offset => 5)
508
- #
509
- # # find all
510
- # Person.find(:all) # returns an array of objects for all the rows fetched by SELECT * FROM people
511
- # Person.find(:all, :conditions => [ "category IN (?)", categories], :limit => 50)
512
- # Person.find(:all, :conditions => { :friends => ["Bob", "Steve", "Fred"] }
513
- # Person.find(:all, :offset => 10, :limit => 10)
514
- # Person.find(:all, :include => [ :account, :friends ])
515
- # Person.find(:all, :group => "category")
516
- #
517
- # Example for find with a lock: Imagine two concurrent transactions:
518
- # each will read <tt>person.visits == 2</tt>, add 1 to it, and save, resulting
519
- # in two saves of <tt>person.visits = 3</tt>. By locking the row, the second
520
- # transaction has to wait until the first is finished; we get the
521
- # expected <tt>person.visits == 4</tt>.
522
- #
523
- # Person.transaction do
524
- # person = Person.find(1, :lock => true)
525
- # person.visits += 1
526
- # person.save!
527
- # end
528
- def find(*args)
529
- options = args.extract_options!
530
- validate_find_options(options)
531
- set_readonly_option!(options)
532
-
533
- case args.first
534
- when :first then find_initial(options)
535
- when :last then find_last(options)
536
- when :all then find_every(options)
537
- else find_from_ids(args, options)
538
- end
539
- end
540
-
541
- # A convenience wrapper for <tt>find(:first, *args)</tt>. You can pass in all the
542
- # same arguments to this method as you can to <tt>find(:first)</tt>.
543
- def first(*args)
544
- find(:first, *args)
545
- end
546
-
547
- # A convenience wrapper for <tt>find(:last, *args)</tt>. You can pass in all the
548
- # same arguments to this method as you can to <tt>find(:last)</tt>.
549
- def last(*args)
550
- find(:last, *args)
551
- end
552
-
553
- # This is an alias for find(:all). You can pass in all the same arguments to this method as you can
554
- # to find(:all)
555
- def all(*args)
556
- find(:all, *args)
557
- end
558
-
559
- # Executes a custom SQL query against your database and returns all the results. The results will
560
- # be returned as an array with columns requested encapsulated as attributes of the model you call
561
- # this method from. If you call +Product.find_by_sql+ then the results will be returned in a Product
562
- # object with the attributes you specified in the SQL query.
563
- #
564
- # If you call a complicated SQL query which spans multiple tables the columns specified by the
565
- # SELECT will be attributes of the model, whether or not they are columns of the corresponding
566
- # table.
567
- #
568
- # The +sql+ parameter is a full SQL query as a string. It will be called as is, there will be
569
- # no database agnostic conversions performed. This should be a last resort because using, for example,
570
- # MySQL specific terms will lock you to using that particular database engine or require you to
571
- # change your call if you switch engines
572
- #
573
- # ==== Examples
574
- # # A simple SQL query spanning multiple tables
575
- # Post.find_by_sql "SELECT p.title, c.author FROM posts p, comments c WHERE p.id = c.post_id"
576
- # > [#<Post:0x36bff9c @attributes={"title"=>"Ruby Meetup", "first_name"=>"Quentin"}>, ...]
577
- #
578
- # # You can use the same string replacement techniques as you can with ActiveRecord#find
579
- # Post.find_by_sql ["SELECT title FROM posts WHERE author = ? AND created > ?", author_id, start_date]
580
- # > [#<Post:0x36bff9c @attributes={"first_name"=>"The Cheap Man Buys Twice"}>, ...]
581
- def find_by_sql(sql)
582
- connection.select_all(sanitize_sql(sql), "#{name} Load").collect! { |record| instantiate(record) }
583
- end
584
-
585
- # Checks whether a record exists in the database that matches conditions given. These conditions
586
- # can either be a single integer representing a primary key id to be found, or a condition to be
587
- # matched like using ActiveRecord#find.
588
- #
589
- # The +id_or_conditions+ parameter can be an Integer or a String if you want to search the primary key
590
- # column of the table for a matching id, or if you're looking to match against a condition you can use
591
- # an Array or a Hash.
592
- #
593
- # Possible gotcha: You can't pass in a condition as a string e.g. "name = 'Jamie'", this would be
594
- # sanitized and then queried against the primary key column as "id = 'name = \'Jamie"
595
- #
596
- # ==== Examples
597
- # Person.exists?(5)
598
- # Person.exists?('5')
599
- # Person.exists?(:name => "David")
600
- # Person.exists?(['name LIKE ?', "%#{query}%"])
601
- def exists?(id_or_conditions)
602
- connection.select_all(
603
- construct_finder_sql(
604
- :select => "#{quoted_table_name}.#{primary_key}",
605
- :conditions => expand_id_conditions(id_or_conditions),
606
- :limit => 1
607
- ),
608
- "#{name} Exists"
609
- ).size > 0
610
- end
611
-
612
- # Creates an object (or multiple objects) and saves it to the database, if validations pass.
613
- # The resulting object is returned whether the object was saved successfully to the database or not.
614
- #
615
- # The +attributes+ parameter can be either be a Hash or an Array of Hashes. These Hashes describe the
616
- # attributes on the objects that are to be created.
617
- #
618
- # ==== Examples
619
- # # Create a single new object
620
- # User.create(:first_name => 'Jamie')
621
- #
622
- # # Create an Array of new objects
623
- # User.create([{ :first_name => 'Jamie' }, { :first_name => 'Jeremy' }])
624
- #
625
- # # Create a single object and pass it into a block to set other attributes.
626
- # User.create(:first_name => 'Jamie') do |u|
627
- # u.is_admin = false
628
- # end
629
- #
630
- # # Creating an Array of new objects using a block, where the block is executed for each object:
631
- # User.create([{ :first_name => 'Jamie' }, { :first_name => 'Jeremy' }]) do |u|
632
- # u.is_admin = false
633
- # end
634
- def create(attributes = nil, &block)
635
- if attributes.is_a?(Array)
636
- attributes.collect { |attr| create(attr, &block) }
637
- else
638
- object = new(attributes)
639
- yield(object) if block_given?
640
- object.save
641
- object
642
- end
643
- end
644
-
645
- # Updates an object (or multiple objects) and saves it to the database, if validations pass.
646
- # The resulting object is returned whether the object was saved successfully to the database or not.
647
- #
648
- # ==== Attributes
649
- #
650
- # * +id+ - This should be the id or an array of ids to be updated.
651
- # * +attributes+ - This should be a Hash of attributes to be set on the object, or an array of Hashes.
652
- #
653
- # ==== Examples
654
- #
655
- # # Updating one record:
656
- # Person.update(15, { :user_name => 'Samuel', :group => 'expert' })
657
- #
658
- # # Updating multiple records:
659
- # people = { 1 => { "first_name" => "David" }, 2 => { "first_name" => "Jeremy" } }
660
- # Person.update(people.keys, people.values)
661
- def update(id, attributes)
662
- if id.is_a?(Array)
663
- idx = -1
664
- id.collect { |one_id| idx += 1; update(one_id, attributes[idx]) }
665
- else
666
- object = find(id)
667
- object.update_attributes(attributes)
668
- object
669
- end
670
- end
671
-
672
- # Delete an object (or multiple objects) where the +id+ given matches the primary_key. A SQL +DELETE+ command
673
- # is executed on the database which means that no callbacks are fired off running this. This is an efficient method
674
- # of deleting records that don't need cleaning up after or other actions to be taken.
675
- #
676
- # Objects are _not_ instantiated with this method.
677
- #
678
- # ==== Attributes
679
- #
680
- # * +id+ - Can be either an Integer or an Array of Integers.
681
- #
682
- # ==== Examples
683
- #
684
- # # Delete a single object
685
- # Todo.delete(1)
686
- #
687
- # # Delete multiple objects
688
- # todos = [1,2,3]
689
- # Todo.delete(todos)
690
- def delete(id)
691
- delete_all([ "#{connection.quote_column_name(primary_key)} IN (?)", id ])
692
- end
693
-
694
- # Destroy an object (or multiple objects) that has the given id, the object is instantiated first,
695
- # therefore all callbacks and filters are fired off before the object is deleted. This method is
696
- # less efficient than ActiveRecord#delete but allows cleanup methods and other actions to be run.
697
- #
698
- # This essentially finds the object (or multiple objects) with the given id, creates a new object
699
- # from the attributes, and then calls destroy on it.
700
- #
701
- # ==== Attributes
702
- #
703
- # * +id+ - Can be either an Integer or an Array of Integers.
704
- #
705
- # ==== Examples
706
- #
707
- # # Destroy a single object
708
- # Todo.destroy(1)
709
- #
710
- # # Destroy multiple objects
711
- # todos = [1,2,3]
712
- # Todo.destroy(todos)
713
- def destroy(id)
714
- if id.is_a?(Array)
715
- id.map { |one_id| destroy(one_id) }
716
- else
717
- find(id).destroy
718
- end
719
- end
720
-
721
- # Updates all records with details given if they match a set of conditions supplied, limits and order can
722
- # also be supplied.
723
- #
724
- # ==== Attributes
725
- #
726
- # * +updates+ - A String of column and value pairs that will be set on any records that match conditions.
727
- # * +conditions+ - An SQL fragment like "administrator = 1" or [ "user_name = ?", username ].
728
- # See conditions in the intro for more info.
729
- # * +options+ - Additional options are <tt>:limit</tt> and/or <tt>:order</tt>, see the examples for usage.
730
- #
731
- # ==== Examples
732
- #
733
- # # Update all billing objects with the 3 different attributes given
734
- # Billing.update_all( "category = 'authorized', approved = 1, author = 'David'" )
735
- #
736
- # # Update records that match our conditions
737
- # Billing.update_all( "author = 'David'", "title LIKE '%Rails%'" )
738
- #
739
- # # Update records that match our conditions but limit it to 5 ordered by date
740
- # Billing.update_all( "author = 'David'", "title LIKE '%Rails%'",
741
- # :order => 'created_at', :limit => 5 )
742
- def update_all(updates, conditions = nil, options = {})
743
- sql = "UPDATE #{quoted_table_name} SET #{sanitize_sql_for_assignment(updates)} "
744
- scope = scope(:find)
745
- add_conditions!(sql, conditions, scope)
746
- add_order!(sql, options[:order], nil)
747
- add_limit!(sql, options, nil)
748
- connection.update(sql, "#{name} Update")
749
- end
750
-
751
- # Destroys the records matching +conditions+ by instantiating each record and calling the destroy method.
752
- # This means at least 2*N database queries to destroy N records, so avoid destroy_all if you are deleting
753
- # many records. If you want to simply delete records without worrying about dependent associations or
754
- # callbacks, use the much faster +delete_all+ method instead.
755
- #
756
- # ==== Attributes
757
- #
758
- # * +conditions+ - Conditions are specified the same way as with +find+ method.
759
- #
760
- # ==== Example
761
- #
762
- # Person.destroy_all "last_login < '2004-04-04'"
763
- #
764
- # This loads and destroys each person one by one, including its dependent associations and before_ and
765
- # after_destroy callbacks.
766
- def destroy_all(conditions = nil)
767
- find(:all, :conditions => conditions).each { |object| object.destroy }
768
- end
769
-
770
- # Deletes the records matching +conditions+ without instantiating the records first, and hence not
771
- # calling the destroy method and invoking callbacks. This is a single SQL query, much more efficient
772
- # than destroy_all.
773
- #
774
- # ==== Attributes
775
- #
776
- # * +conditions+ - Conditions are specified the same way as with +find+ method.
777
- #
778
- # ==== Example
779
- #
780
- # Post.delete_all "person_id = 5 AND (category = 'Something' OR category = 'Else')"
781
- #
782
- # This deletes the affected posts all at once with a single DELETE query. If you need to destroy dependent
783
- # associations or call your before_ or after_destroy callbacks, use the +destroy_all+ method instead.
784
- def delete_all(conditions = nil)
785
- sql = "DELETE FROM #{quoted_table_name} "
786
- add_conditions!(sql, conditions, scope(:find))
787
- connection.delete(sql, "#{name} Delete all")
788
- end
789
-
790
- # Returns the result of an SQL statement that should only include a COUNT(*) in the SELECT part.
791
- # The use of this method should be restricted to complicated SQL queries that can't be executed
792
- # using the ActiveRecord::Calculations class methods. Look into those before using this.
793
- #
794
- # ==== Attributes
795
- #
796
- # * +sql+ - An SQL statement which should return a count query from the database, see the example below.
797
- #
798
- # ==== Examples
799
- #
800
- # Product.count_by_sql "SELECT COUNT(*) FROM sales s, customers c WHERE s.customer_id = c.id"
801
- def count_by_sql(sql)
802
- sql = sanitize_conditions(sql)
803
- connection.select_value(sql, "#{name} Count").to_i
804
- end
805
-
806
- # A generic "counter updater" implementation, intended primarily to be
807
- # used by increment_counter and decrement_counter, but which may also
808
- # be useful on its own. It simply does a direct SQL update for the record
809
- # with the given ID, altering the given hash of counters by the amount
810
- # given by the corresponding value:
811
- #
812
- # ==== Attributes
813
- #
814
- # * +id+ - The id of the object you wish to update a counter on.
815
- # * +counters+ - An Array of Hashes containing the names of the fields
816
- # to update as keys and the amount to update the field by as values.
817
- #
818
- # ==== Examples
819
- #
820
- # # For the Post with id of 5, decrement the comment_count by 1, and
821
- # # increment the action_count by 1
822
- # Post.update_counters 5, :comment_count => -1, :action_count => 1
823
- # # Executes the following SQL:
824
- # # UPDATE posts
825
- # # SET comment_count = comment_count - 1,
826
- # # action_count = action_count + 1
827
- # # WHERE id = 5
828
- def update_counters(id, counters)
829
- updates = counters.inject([]) { |list, (counter_name, increment)|
830
- sign = increment < 0 ? "-" : "+"
831
- list << "#{connection.quote_column_name(counter_name)} = #{connection.quote_column_name(counter_name)} #{sign} #{increment.abs}"
832
- }.join(", ")
833
- update_all(updates, "#{connection.quote_column_name(primary_key)} = #{quote_value(id)}")
834
- end
835
-
836
- # Increment a number field by one, usually representing a count.
837
- #
838
- # This is used for caching aggregate values, so that they don't need to be computed every time.
839
- # For example, a DiscussionBoard may cache post_count and comment_count otherwise every time the board is
840
- # shown it would have to run an SQL query to find how many posts and comments there are.
841
- #
842
- # ==== Attributes
843
- #
844
- # * +counter_name+ - The name of the field that should be incremented.
845
- # * +id+ - The id of the object that should be incremented.
846
- #
847
- # ==== Examples
848
- #
849
- # # Increment the post_count column for the record with an id of 5
850
- # DiscussionBoard.increment_counter(:post_count, 5)
851
- def increment_counter(counter_name, id)
852
- update_counters(id, counter_name => 1)
853
- end
854
-
855
- # Decrement a number field by one, usually representing a count.
856
- #
857
- # This works the same as increment_counter but reduces the column value by 1 instead of increasing it.
858
- #
859
- # ==== Attributes
860
- #
861
- # * +counter_name+ - The name of the field that should be decremented.
862
- # * +id+ - The id of the object that should be decremented.
863
- #
864
- # ==== Examples
865
- #
866
- # # Decrement the post_count column for the record with an id of 5
867
- # DiscussionBoard.decrement_counter(:post_count, 5)
868
- def decrement_counter(counter_name, id)
869
- update_counters(id, counter_name => -1)
870
- end
871
-
872
-
873
- # Attributes named in this macro are protected from mass-assignment,
874
- # such as <tt>new(attributes)</tt>,
875
- # <tt>update_attributes(attributes)</tt>, or
876
- # <tt>attributes=(attributes)</tt>.
877
- #
878
- # Mass-assignment to these attributes will simply be ignored, to assign
879
- # to them you can use direct writer methods. This is meant to protect
880
- # sensitive attributes from being overwritten by malicious users
881
- # tampering with URLs or forms.
882
- #
883
- # class Customer < ActiveRecord::Base
884
- # attr_protected :credit_rating
885
- # end
886
- #
887
- # customer = Customer.new("name" => David, "credit_rating" => "Excellent")
888
- # customer.credit_rating # => nil
889
- # customer.attributes = { "description" => "Jolly fellow", "credit_rating" => "Superb" }
890
- # customer.credit_rating # => nil
891
- #
892
- # customer.credit_rating = "Average"
893
- # customer.credit_rating # => "Average"
894
- #
895
- # To start from an all-closed default and enable attributes as needed,
896
- # have a look at +attr_accessible+.
897
- def attr_protected(*attributes)
898
- write_inheritable_attribute("attr_protected", Set.new(attributes.map(&:to_s)) + (protected_attributes || []))
899
- end
900
-
901
- # Returns an array of all the attributes that have been protected from mass-assignment.
902
- def protected_attributes # :nodoc:
903
- read_inheritable_attribute("attr_protected")
904
- end
905
-
906
- # Specifies a white list of model attributes that can be set via
907
- # mass-assignment, such as <tt>new(attributes)</tt>,
908
- # <tt>update_attributes(attributes)</tt>, or
909
- # <tt>attributes=(attributes)</tt>
910
- #
911
- # This is the opposite of the +attr_protected+ macro: Mass-assignment
912
- # will only set attributes in this list, to assign to the rest of
913
- # attributes you can use direct writer methods. This is meant to protect
914
- # sensitive attributes from being overwritten by malicious users
915
- # tampering with URLs or forms. If you'd rather start from an all-open
916
- # default and restrict attributes as needed, have a look at
917
- # +attr_protected+.
918
- #
919
- # class Customer < ActiveRecord::Base
920
- # attr_accessible :name, :nickname
921
- # end
922
- #
923
- # customer = Customer.new(:name => "David", :nickname => "Dave", :credit_rating => "Excellent")
924
- # customer.credit_rating # => nil
925
- # customer.attributes = { :name => "Jolly fellow", :credit_rating => "Superb" }
926
- # customer.credit_rating # => nil
927
- #
928
- # customer.credit_rating = "Average"
929
- # customer.credit_rating # => "Average"
930
- def attr_accessible(*attributes)
931
- write_inheritable_attribute("attr_accessible", Set.new(attributes.map(&:to_s)) + (accessible_attributes || []))
932
- end
933
-
934
- # Returns an array of all the attributes that have been made accessible to mass-assignment.
935
- def accessible_attributes # :nodoc:
936
- read_inheritable_attribute("attr_accessible")
937
- end
938
-
939
- # Attributes listed as readonly can be set for a new record, but will be ignored in database updates afterwards.
940
- def attr_readonly(*attributes)
941
- write_inheritable_attribute("attr_readonly", Set.new(attributes.map(&:to_s)) + (readonly_attributes || []))
942
- end
943
-
944
- # Returns an array of all the attributes that have been specified as readonly.
945
- def readonly_attributes
946
- read_inheritable_attribute("attr_readonly")
947
- end
948
-
949
- # If you have an attribute that needs to be saved to the database as an object, and retrieved as the same object,
950
- # then specify the name of that attribute using this method and it will be handled automatically.
951
- # The serialization is done through YAML. If +class_name+ is specified, the serialized object must be of that
952
- # class on retrieval or SerializationTypeMismatch will be raised.
953
- #
954
- # ==== Attributes
955
- #
956
- # * +attr_name+ - The field name that should be serialized.
957
- # * +class_name+ - Optional, class name that the object type should be equal to.
958
- #
959
- # ==== Example
960
- # # Serialize a preferences attribute
961
- # class User
962
- # serialize :preferences
963
- # end
964
- def serialize(attr_name, class_name = Object)
965
- serialized_attributes[attr_name.to_s] = class_name
966
- end
967
-
968
- # Returns a hash of all the attributes that have been specified for serialization as keys and their class restriction as values.
969
- def serialized_attributes
970
- read_inheritable_attribute("attr_serialized") or write_inheritable_attribute("attr_serialized", {})
971
- end
972
-
973
-
974
- # Guesses the table name (in forced lower-case) based on the name of the class in the inheritance hierarchy descending
975
- # directly from ActiveRecord::Base. So if the hierarchy looks like: Reply < Message < ActiveRecord::Base, then Message is used
976
- # to guess the table name even when called on Reply. The rules used to do the guess are handled by the Inflector class
977
- # in Active Support, which knows almost all common English inflections. You can add new inflections in config/initializers/inflections.rb.
978
- #
979
- # Nested classes are given table names prefixed by the singular form of
980
- # the parent's table name. Enclosing modules are not considered.
981
- #
982
- # ==== Examples
983
- #
984
- # class Invoice < ActiveRecord::Base; end;
985
- # file class table_name
986
- # invoice.rb Invoice invoices
987
- #
988
- # class Invoice < ActiveRecord::Base; class Lineitem < ActiveRecord::Base; end; end;
989
- # file class table_name
990
- # invoice.rb Invoice::Lineitem invoice_lineitems
991
- #
992
- # module Invoice; class Lineitem < ActiveRecord::Base; end; end;
993
- # file class table_name
994
- # invoice/lineitem.rb Invoice::Lineitem lineitems
995
- #
996
- # Additionally, the class-level +table_name_prefix+ is prepended and the
997
- # +table_name_suffix+ is appended. So if you have "myapp_" as a prefix,
998
- # the table name guess for an Invoice class becomes "myapp_invoices".
999
- # Invoice::Lineitem becomes "myapp_invoice_lineitems".
1000
- #
1001
- # You can also overwrite this class method to allow for unguessable
1002
- # links, such as a Mouse class with a link to a "mice" table. Example:
1003
- #
1004
- # class Mouse < ActiveRecord::Base
1005
- # set_table_name "mice"
1006
- # end
1007
- def table_name
1008
- reset_table_name
1009
- end
1010
-
1011
- def reset_table_name #:nodoc:
1012
- base = base_class
1013
-
1014
- name =
1015
- # STI subclasses always use their superclass' table.
1016
- unless self == base
1017
- base.table_name
1018
- else
1019
- # Nested classes are prefixed with singular parent table name.
1020
- if parent < ActiveRecord::Base && !parent.abstract_class?
1021
- contained = parent.table_name
1022
- contained = contained.singularize if parent.pluralize_table_names
1023
- contained << '_'
1024
- end
1025
- name = "#{table_name_prefix}#{contained}#{undecorated_table_name(base.name)}#{table_name_suffix}"
1026
- end
1027
-
1028
- set_table_name(name)
1029
- name
1030
- end
1031
-
1032
- # Defines the primary key field -- can be overridden in subclasses. Overwriting will negate any effect of the
1033
- # primary_key_prefix_type setting, though.
1034
- def primary_key
1035
- reset_primary_key
1036
- end
1037
-
1038
- def reset_primary_key #:nodoc:
1039
- key = get_primary_key(base_class.name)
1040
- set_primary_key(key)
1041
- key
1042
- end
1043
-
1044
- def get_primary_key(base_name) #:nodoc:
1045
- key = 'id'
1046
- case primary_key_prefix_type
1047
- when :table_name
1048
- key = base_name.to_s.foreign_key(false)
1049
- when :table_name_with_underscore
1050
- key = base_name.to_s.foreign_key
1051
- end
1052
- key
1053
- end
1054
-
1055
- # Defines the column name for use with single table inheritance
1056
- # -- can be set in subclasses like so: self.inheritance_column = "type_id"
1057
- def inheritance_column
1058
- @inheritance_column ||= "type".freeze
1059
- end
1060
-
1061
- # Lazy-set the sequence name to the connection's default. This method
1062
- # is only ever called once since set_sequence_name overrides it.
1063
- def sequence_name #:nodoc:
1064
- reset_sequence_name
1065
- end
1066
-
1067
- def reset_sequence_name #:nodoc:
1068
- default = connection.default_sequence_name(table_name, primary_key)
1069
- set_sequence_name(default)
1070
- default
1071
- end
1072
-
1073
- # Sets the table name to use to the given value, or (if the value
1074
- # is nil or false) to the value returned by the given block.
1075
- #
1076
- # class Project < ActiveRecord::Base
1077
- # set_table_name "project"
1078
- # end
1079
- def set_table_name(value = nil, &block)
1080
- define_attr_method :table_name, value, &block
1081
- end
1082
- alias :table_name= :set_table_name
1083
-
1084
- # Sets the name of the primary key column to use to the given value,
1085
- # or (if the value is nil or false) to the value returned by the given
1086
- # block.
1087
- #
1088
- # class Project < ActiveRecord::Base
1089
- # set_primary_key "sysid"
1090
- # end
1091
- def set_primary_key(value = nil, &block)
1092
- define_attr_method :primary_key, value, &block
1093
- end
1094
- alias :primary_key= :set_primary_key
1095
-
1096
- # Sets the name of the inheritance column to use to the given value,
1097
- # or (if the value # is nil or false) to the value returned by the
1098
- # given block.
1099
- #
1100
- # class Project < ActiveRecord::Base
1101
- # set_inheritance_column do
1102
- # original_inheritance_column + "_id"
1103
- # end
1104
- # end
1105
- def set_inheritance_column(value = nil, &block)
1106
- define_attr_method :inheritance_column, value, &block
1107
- end
1108
- alias :inheritance_column= :set_inheritance_column
1109
-
1110
- # Sets the name of the sequence to use when generating ids to the given
1111
- # value, or (if the value is nil or false) to the value returned by the
1112
- # given block. This is required for Oracle and is useful for any
1113
- # database which relies on sequences for primary key generation.
1114
- #
1115
- # If a sequence name is not explicitly set when using Oracle or Firebird,
1116
- # it will default to the commonly used pattern of: #{table_name}_seq
1117
- #
1118
- # If a sequence name is not explicitly set when using PostgreSQL, it
1119
- # will discover the sequence corresponding to your primary key for you.
1120
- #
1121
- # class Project < ActiveRecord::Base
1122
- # set_sequence_name "projectseq" # default would have been "project_seq"
1123
- # end
1124
- def set_sequence_name(value = nil, &block)
1125
- define_attr_method :sequence_name, value, &block
1126
- end
1127
- alias :sequence_name= :set_sequence_name
1128
-
1129
- # Turns the +table_name+ back into a class name following the reverse rules of +table_name+.
1130
- def class_name(table_name = table_name) # :nodoc:
1131
- # remove any prefix and/or suffix from the table name
1132
- class_name = table_name[table_name_prefix.length..-(table_name_suffix.length + 1)].camelize
1133
- class_name = class_name.singularize if pluralize_table_names
1134
- class_name
1135
- end
1136
-
1137
- # Indicates whether the table associated with this class exists
1138
- def table_exists?
1139
- connection.table_exists?(table_name)
1140
- end
1141
-
1142
- # Returns an array of column objects for the table associated with this class.
1143
- def columns
1144
- unless defined?(@columns) && @columns
1145
- @columns = connection.columns(table_name, "#{name} Columns")
1146
- @columns.each { |column| column.primary = column.name == primary_key }
1147
- end
1148
- @columns
1149
- end
1150
-
1151
- # Returns a hash of column objects for the table associated with this class.
1152
- def columns_hash
1153
- @columns_hash ||= columns.inject({}) { |hash, column| hash[column.name] = column; hash }
1154
- end
1155
-
1156
- # Returns an array of column names as strings.
1157
- def column_names
1158
- @column_names ||= columns.map { |column| column.name }
1159
- end
1160
-
1161
- # Returns an array of column objects where the primary id, all columns ending in "_id" or "_count",
1162
- # and columns used for single table inheritance have been removed.
1163
- def content_columns
1164
- @content_columns ||= columns.reject { |c| c.primary || c.name =~ /(_id|_count)$/ || c.name == inheritance_column }
1165
- end
1166
-
1167
- # Returns a hash of all the methods added to query each of the columns in the table with the name of the method as the key
1168
- # and true as the value. This makes it possible to do O(1) lookups in respond_to? to check if a given method for attribute
1169
- # is available.
1170
- def column_methods_hash #:nodoc:
1171
- @dynamic_methods_hash ||= column_names.inject(Hash.new(false)) do |methods, attr|
1172
- attr_name = attr.to_s
1173
- methods[attr.to_sym] = attr_name
1174
- methods["#{attr}=".to_sym] = attr_name
1175
- methods["#{attr}?".to_sym] = attr_name
1176
- methods["#{attr}_before_type_cast".to_sym] = attr_name
1177
- methods
1178
- end
1179
- end
1180
-
1181
- # Resets all the cached information about columns, which will cause them to be reloaded on the next request.
1182
- def reset_column_information
1183
- generated_methods.each { |name| undef_method(name) }
1184
- @column_names = @columns = @columns_hash = @content_columns = @dynamic_methods_hash = @generated_methods = @inheritance_column = nil
1185
- end
1186
-
1187
- def reset_column_information_and_inheritable_attributes_for_all_subclasses#:nodoc:
1188
- subclasses.each { |klass| klass.reset_inheritable_attributes; klass.reset_column_information }
1189
- end
1190
-
1191
- # Transforms attribute key names into a more humane format, such as "First name" instead of "first_name". Example:
1192
- # Person.human_attribute_name("first_name") # => "First name"
1193
- # Deprecated in favor of just calling "first_name".humanize
1194
- def human_attribute_name(attribute_key_name) #:nodoc:
1195
- attribute_key_name.humanize
1196
- end
1197
-
1198
- # True if this isn't a concrete subclass needing a STI type condition.
1199
- def descends_from_active_record?
1200
- if superclass.abstract_class?
1201
- superclass.descends_from_active_record?
1202
- else
1203
- superclass == Base || !columns_hash.include?(inheritance_column)
1204
- end
1205
- end
1206
-
1207
- def finder_needs_type_condition? #:nodoc:
1208
- # This is like this because benchmarking justifies the strange :false stuff
1209
- :true == (@finder_needs_type_condition ||= descends_from_active_record? ? :false : :true)
1210
- end
1211
-
1212
- # Returns a string like 'Post id:integer, title:string, body:text'
1213
- def inspect
1214
- if self == Base
1215
- super
1216
- elsif abstract_class?
1217
- "#{super}(abstract)"
1218
- elsif table_exists?
1219
- attr_list = columns.map { |c| "#{c.name}: #{c.type}" } * ', '
1220
- "#{super}(#{attr_list})"
1221
- else
1222
- "#{super}(Table doesn't exist)"
1223
- end
1224
- end
1225
-
1226
-
1227
- def quote_value(value, column = nil) #:nodoc:
1228
- connection.quote(value,column)
1229
- end
1230
-
1231
- # Used to sanitize objects before they're used in an SQL SELECT statement. Delegates to <tt>connection.quote</tt>.
1232
- def sanitize(object) #:nodoc:
1233
- connection.quote(object)
1234
- end
1235
-
1236
- # Log and benchmark multiple statements in a single block. Example:
1237
- #
1238
- # Project.benchmark("Creating project") do
1239
- # project = Project.create("name" => "stuff")
1240
- # project.create_manager("name" => "David")
1241
- # project.milestones << Milestone.find(:all)
1242
- # end
1243
- #
1244
- # The benchmark is only recorded if the current level of the logger is less than or equal to the <tt>log_level</tt>,
1245
- # which makes it easy to include benchmarking statements in production software that will remain inexpensive because
1246
- # the benchmark will only be conducted if the log level is low enough.
1247
- #
1248
- # The logging of the multiple statements is turned off unless <tt>use_silence</tt> is set to false.
1249
- def benchmark(title, log_level = Logger::DEBUG, use_silence = true)
1250
- if logger && logger.level <= log_level
1251
- result = nil
1252
- seconds = Benchmark.realtime { result = use_silence ? silence { yield } : yield }
1253
- logger.add(log_level, "#{title} (#{'%.5f' % seconds})")
1254
- result
1255
- else
1256
- yield
1257
- end
1258
- end
1259
-
1260
- # Silences the logger for the duration of the block.
1261
- def silence
1262
- old_logger_level, logger.level = logger.level, Logger::ERROR if logger
1263
- yield
1264
- ensure
1265
- logger.level = old_logger_level if logger
1266
- end
1267
-
1268
- # Overwrite the default class equality method to provide support for association proxies.
1269
- def ===(object)
1270
- object.is_a?(self)
1271
- end
1272
-
1273
- # Returns the base AR subclass that this class descends from. If A
1274
- # extends AR::Base, A.base_class will return A. If B descends from A
1275
- # through some arbitrarily deep hierarchy, B.base_class will return A.
1276
- def base_class
1277
- class_of_active_record_descendant(self)
1278
- end
1279
-
1280
- # Set this to true if this is an abstract class (see <tt>abstract_class?</tt>).
1281
- attr_accessor :abstract_class
1282
-
1283
- # Returns whether this class is a base AR class. If A is a base class and
1284
- # B descends from A, then B.base_class will return B.
1285
- def abstract_class?
1286
- defined?(@abstract_class) && @abstract_class == true
1287
- end
1288
-
1289
- def respond_to?(method_id, include_private = false)
1290
- if match = matches_dynamic_finder?(method_id) || matches_dynamic_finder_with_initialize_or_create?(method_id)
1291
- return true if all_attributes_exists?(extract_attribute_names_from_match(match))
1292
- end
1293
- super
1294
- end
1295
-
1296
- def sti_name
1297
- store_full_sti_class ? name : name.demodulize
1298
- end
1299
-
1300
- private
1301
- def find_initial(options)
1302
- options.update(:limit => 1)
1303
- find_every(options).first
1304
- end
1305
-
1306
- def find_last(options)
1307
- order = options[:order]
1308
-
1309
- if order
1310
- order = reverse_sql_order(order)
1311
- elsif !scoped?(:find, :order)
1312
- order = "#{table_name}.#{primary_key} DESC"
1313
- end
1314
-
1315
- if scoped?(:find, :order)
1316
- scoped_order = reverse_sql_order(scope(:find, :order))
1317
- scoped_methods.select { |s| s[:find].update(:order => scoped_order) }
1318
- end
1319
-
1320
- find_initial(options.merge({ :order => order }))
1321
- end
1322
-
1323
- def reverse_sql_order(order_query)
1324
- reversed_query = order_query.split(/,/).each { |s|
1325
- if s.match(/\s(asc|ASC)$/)
1326
- s.gsub!(/\s(asc|ASC)$/, ' DESC')
1327
- elsif s.match(/\s(desc|DESC)$/)
1328
- s.gsub!(/\s(desc|DESC)$/, ' ASC')
1329
- elsif !s.match(/\s(asc|ASC|desc|DESC)$/)
1330
- s.concat(' DESC')
1331
- end
1332
- }.join(',')
1333
- end
1334
-
1335
- def find_every(options)
1336
- include_associations = merge_includes(scope(:find, :include), options[:include])
1337
-
1338
- if include_associations.any? && references_eager_loaded_tables?(options)
1339
- records = find_with_associations(options)
1340
- else
1341
- records = find_by_sql(construct_finder_sql(options))
1342
- if include_associations.any?
1343
- preload_associations(records, include_associations)
1344
- end
1345
- end
1346
-
1347
- records.each { |record| record.readonly! } if options[:readonly]
1348
-
1349
- records
1350
- end
1351
-
1352
- def find_from_ids(ids, options)
1353
- expects_array = ids.first.kind_of?(Array)
1354
- return ids.first if expects_array && ids.first.empty?
1355
-
1356
- ids = ids.flatten.compact.uniq
1357
-
1358
- case ids.size
1359
- when 0
1360
- raise RecordNotFound, "Couldn't find #{name} without an ID"
1361
- when 1
1362
- result = find_one(ids.first, options)
1363
- expects_array ? [ result ] : result
1364
- else
1365
- find_some(ids, options)
1366
- end
1367
- end
1368
-
1369
- def find_one(id, options)
1370
- conditions = " AND (#{sanitize_sql(options[:conditions])})" if options[:conditions]
1371
- options.update :conditions => "#{quoted_table_name}.#{connection.quote_column_name(primary_key)} = #{quote_value(id,columns_hash[primary_key])}#{conditions}"
1372
-
1373
- # Use find_every(options).first since the primary key condition
1374
- # already ensures we have a single record. Using find_initial adds
1375
- # a superfluous :limit => 1.
1376
- if result = find_every(options).first
1377
- result
1378
- else
1379
- raise RecordNotFound, "Couldn't find #{name} with ID=#{id}#{conditions}"
1380
- end
1381
- end
1382
-
1383
- def find_some(ids, options)
1384
- conditions = " AND (#{sanitize_sql(options[:conditions])})" if options[:conditions]
1385
- ids_list = ids.map { |id| quote_value(id,columns_hash[primary_key]) }.join(',')
1386
- options.update :conditions => "#{quoted_table_name}.#{connection.quote_column_name(primary_key)} IN (#{ids_list})#{conditions}"
1387
-
1388
- result = find_every(options)
1389
-
1390
- # Determine expected size from limit and offset, not just ids.size.
1391
- expected_size =
1392
- if options[:limit] && ids.size > options[:limit]
1393
- options[:limit]
1394
- else
1395
- ids.size
1396
- end
1397
-
1398
- # 11 ids with limit 3, offset 9 should give 2 results.
1399
- if options[:offset] && (ids.size - options[:offset] < expected_size)
1400
- expected_size = ids.size - options[:offset]
1401
- end
1402
-
1403
- if result.size == expected_size
1404
- result
1405
- else
1406
- raise RecordNotFound, "Couldn't find all #{name.pluralize} with IDs (#{ids_list})#{conditions} (found #{result.size} results, but was looking for #{expected_size})"
1407
- end
1408
- end
1409
-
1410
- # Finder methods must instantiate through this method to work with the
1411
- # single-table inheritance model that makes it possible to create
1412
- # objects of different types from the same table.
1413
- def instantiate(record)
1414
- object =
1415
- if subclass_name = record[inheritance_column]
1416
- # No type given.
1417
- if subclass_name.empty?
1418
- allocate
1419
-
1420
- else
1421
- # Ignore type if no column is present since it was probably
1422
- # pulled in from a sloppy join.
1423
- unless columns_hash.include?(inheritance_column)
1424
- allocate
1425
-
1426
- else
1427
- begin
1428
- compute_type(subclass_name).allocate
1429
- rescue NameError
1430
- raise SubclassNotFound,
1431
- "The single-table inheritance mechanism failed to locate the subclass: '#{record[inheritance_column]}'. " +
1432
- "This error is raised because the column '#{inheritance_column}' is reserved for storing the class in case of inheritance. " +
1433
- "Please rename this column if you didn't intend it to be used for storing the inheritance class " +
1434
- "or overwrite #{self.to_s}.inheritance_column to use another column for that information."
1435
- end
1436
- end
1437
- end
1438
- else
1439
- allocate
1440
- end
1441
-
1442
- object.instance_variable_set("@attributes", record)
1443
- object.instance_variable_set("@attributes_cache", Hash.new)
1444
-
1445
- if object.respond_to_without_attributes?(:after_find)
1446
- object.send(:callback, :after_find)
1447
- end
1448
-
1449
- if object.respond_to_without_attributes?(:after_initialize)
1450
- object.send(:callback, :after_initialize)
1451
- end
1452
-
1453
- object
1454
- end
1455
-
1456
- # Nest the type name in the same module as this class.
1457
- # Bar is "MyApp::Business::Bar" relative to MyApp::Business::Foo
1458
- def type_name_with_module(type_name)
1459
- if store_full_sti_class
1460
- type_name
1461
- else
1462
- (/^::/ =~ type_name) ? type_name : "#{parent.name}::#{type_name}"
1463
- end
1464
- end
1465
-
1466
- def construct_finder_sql(options)
1467
- scope = scope(:find)
1468
- sql = "SELECT #{options[:select] || (scope && scope[:select]) || (options[:joins] && quoted_table_name + '.*') || '*'} "
1469
- sql << "FROM #{(scope && scope[:from]) || options[:from] || quoted_table_name} "
1470
-
1471
- add_joins!(sql, options, scope)
1472
- add_conditions!(sql, options[:conditions], scope)
1473
-
1474
- add_group!(sql, options[:group], scope)
1475
- add_order!(sql, options[:order], scope)
1476
- add_limit!(sql, options, scope)
1477
- add_lock!(sql, options, scope)
1478
-
1479
- sql
1480
- end
1481
-
1482
- # Merges includes so that the result is a valid +include+
1483
- def merge_includes(first, second)
1484
- (safe_to_array(first) + safe_to_array(second)).uniq
1485
- end
1486
-
1487
- # Merges conditions so that the result is a valid +condition+
1488
- def merge_conditions(*conditions)
1489
- segments = []
1490
-
1491
- conditions.each do |condition|
1492
- unless condition.blank?
1493
- sql = sanitize_sql(condition)
1494
- segments << sql unless sql.blank?
1495
- end
1496
- end
1497
-
1498
- "(#{segments.join(') AND (')})" unless segments.empty?
1499
- end
1500
-
1501
- # Object#to_a is deprecated, though it does have the desired behavior
1502
- def safe_to_array(o)
1503
- case o
1504
- when NilClass
1505
- []
1506
- when Array
1507
- o
1508
- else
1509
- [o]
1510
- end
1511
- end
1512
-
1513
- def add_order!(sql, order, scope = :auto)
1514
- scope = scope(:find) if :auto == scope
1515
- scoped_order = scope[:order] if scope
1516
- if order
1517
- sql << " ORDER BY #{order}"
1518
- sql << ", #{scoped_order}" if scoped_order
1519
- else
1520
- sql << " ORDER BY #{scoped_order}" if scoped_order
1521
- end
1522
- end
1523
-
1524
- def add_group!(sql, group, scope = :auto)
1525
- if group
1526
- sql << " GROUP BY #{group}"
1527
- else
1528
- scope = scope(:find) if :auto == scope
1529
- if scope && (scoped_group = scope[:group])
1530
- sql << " GROUP BY #{scoped_group}"
1531
- end
1532
- end
1533
- end
1534
-
1535
- # The optional scope argument is for the current <tt>:find</tt> scope.
1536
- def add_limit!(sql, options, scope = :auto)
1537
- scope = scope(:find) if :auto == scope
1538
-
1539
- if scope
1540
- options[:limit] ||= scope[:limit]
1541
- options[:offset] ||= scope[:offset]
1542
- end
1543
-
1544
- connection.add_limit_offset!(sql, options)
1545
- end
1546
-
1547
- # The optional scope argument is for the current <tt>:find</tt> scope.
1548
- # The <tt>:lock</tt> option has precedence over a scoped <tt>:lock</tt>.
1549
- def add_lock!(sql, options, scope = :auto)
1550
- scope = scope(:find) if :auto == scope
1551
- options = options.reverse_merge(:lock => scope[:lock]) if scope
1552
- connection.add_lock!(sql, options)
1553
- end
1554
-
1555
- # The optional scope argument is for the current <tt>:find</tt> scope.
1556
- def add_joins!(sql, options, scope = :auto)
1557
- scope = scope(:find) if :auto == scope
1558
- [(scope && scope[:joins]), options[:joins]].each do |join|
1559
- case join
1560
- when Symbol, Hash, Array
1561
- join_dependency = ActiveRecord::Associations::ClassMethods::InnerJoinDependency.new(self, join, nil)
1562
- sql << " #{join_dependency.join_associations.collect { |assoc| assoc.association_join }.join} "
1563
- else
1564
- sql << " #{join} "
1565
- end
1566
- end
1567
- end
1568
-
1569
- # Adds a sanitized version of +conditions+ to the +sql+ string. Note that the passed-in +sql+ string is changed.
1570
- # The optional scope argument is for the current <tt>:find</tt> scope.
1571
- def add_conditions!(sql, conditions, scope = :auto)
1572
- scope = scope(:find) if :auto == scope
1573
- conditions = [conditions]
1574
- conditions << scope[:conditions] if scope
1575
- conditions << type_condition if finder_needs_type_condition?
1576
- merged_conditions = merge_conditions(*conditions)
1577
- sql << "WHERE #{merged_conditions} " unless merged_conditions.blank?
1578
- end
1579
-
1580
- def type_condition
1581
- quoted_inheritance_column = connection.quote_column_name(inheritance_column)
1582
- type_condition = subclasses.inject("#{quoted_table_name}.#{quoted_inheritance_column} = '#{sti_name}' ") do |condition, subclass|
1583
- condition << "OR #{quoted_table_name}.#{quoted_inheritance_column} = '#{subclass.sti_name}' "
1584
- end
1585
-
1586
- " (#{type_condition}) "
1587
- end
1588
-
1589
- # Guesses the table name, but does not decorate it with prefix and suffix information.
1590
- def undecorated_table_name(class_name = base_class.name)
1591
- table_name = class_name.to_s.demodulize.underscore
1592
- table_name = table_name.pluralize if pluralize_table_names
1593
- table_name
1594
- end
1595
-
1596
- # Enables dynamic finders like find_by_user_name(user_name) and find_by_user_name_and_password(user_name, password) that are turned into
1597
- # find(:first, :conditions => ["user_name = ?", user_name]) and find(:first, :conditions => ["user_name = ? AND password = ?", user_name, password])
1598
- # respectively. Also works for find(:all) by using find_all_by_amount(50) that is turned into find(:all, :conditions => ["amount = ?", 50]).
1599
- #
1600
- # It's even possible to use all the additional parameters to find. For example, the full interface for find_all_by_amount
1601
- # is actually find_all_by_amount(amount, options).
1602
- #
1603
- # This also enables you to initialize a record if it is not found, such as find_or_initialize_by_amount(amount)
1604
- # or find_or_create_by_user_and_password(user, password).
1605
- #
1606
- # Each dynamic finder or initializer/creator is also defined in the class after it is first invoked, so that future
1607
- # attempts to use it do not run through method_missing.
1608
- def method_missing(method_id, *arguments)
1609
- if match = matches_dynamic_finder?(method_id)
1610
- finder = determine_finder(match)
1611
-
1612
- attribute_names = extract_attribute_names_from_match(match)
1613
- super unless all_attributes_exists?(attribute_names)
1614
-
1615
- self.class_eval %{
1616
- def self.#{method_id}(*args)
1617
- options = args.extract_options!
1618
- attributes = construct_attributes_from_arguments([:#{attribute_names.join(',:')}], args)
1619
- finder_options = { :conditions => attributes }
1620
- validate_find_options(options)
1621
- set_readonly_option!(options)
1622
-
1623
- if options[:conditions]
1624
- with_scope(:find => finder_options) do
1625
- ActiveSupport::Deprecation.silence { send(:#{finder}, options) }
1626
- end
1627
- else
1628
- ActiveSupport::Deprecation.silence { send(:#{finder}, options.merge(finder_options)) }
1629
- end
1630
- end
1631
- }, __FILE__, __LINE__
1632
- send(method_id, *arguments)
1633
- elsif match = matches_dynamic_finder_with_initialize_or_create?(method_id)
1634
- instantiator = determine_instantiator(match)
1635
- attribute_names = extract_attribute_names_from_match(match)
1636
- super unless all_attributes_exists?(attribute_names)
1637
-
1638
- self.class_eval %{
1639
- def self.#{method_id}(*args)
1640
- guard_protected_attributes = false
1641
-
1642
- if args[0].is_a?(Hash)
1643
- guard_protected_attributes = true
1644
- attributes = args[0].with_indifferent_access
1645
- find_attributes = attributes.slice(*[:#{attribute_names.join(',:')}])
1646
- else
1647
- find_attributes = attributes = construct_attributes_from_arguments([:#{attribute_names.join(',:')}], args)
1648
- end
1649
-
1650
- options = { :conditions => find_attributes }
1651
- set_readonly_option!(options)
1652
-
1653
- record = find_initial(options)
1654
-
1655
- if record.nil?
1656
- record = self.new { |r| r.send(:attributes=, attributes, guard_protected_attributes) }
1657
- #{'yield(record) if block_given?'}
1658
- #{'record.save' if instantiator == :create}
1659
- record
1660
- else
1661
- record
1662
- end
1663
- end
1664
- }, __FILE__, __LINE__
1665
- send(method_id, *arguments)
1666
- else
1667
- super
1668
- end
1669
- end
1670
-
1671
- def matches_dynamic_finder?(method_id)
1672
- /^find_(all_by|by)_([_a-zA-Z]\w*)$/.match(method_id.to_s)
1673
- end
1674
-
1675
- def matches_dynamic_finder_with_initialize_or_create?(method_id)
1676
- /^find_or_(initialize|create)_by_([_a-zA-Z]\w*)$/.match(method_id.to_s)
1677
- end
1678
-
1679
- def determine_finder(match)
1680
- match.captures.first == 'all_by' ? :find_every : :find_initial
1681
- end
1682
-
1683
- def determine_instantiator(match)
1684
- match.captures.first == 'initialize' ? :new : :create
1685
- end
1686
-
1687
- def extract_attribute_names_from_match(match)
1688
- match.captures.last.split('_and_')
1689
- end
1690
-
1691
- def construct_attributes_from_arguments(attribute_names, arguments)
1692
- attributes = {}
1693
- attribute_names.each_with_index { |name, idx| attributes[name] = arguments[idx] }
1694
- attributes
1695
- end
1696
-
1697
- # Similar in purpose to +expand_hash_conditions_for_aggregates+.
1698
- def expand_attribute_names_for_aggregates(attribute_names)
1699
- expanded_attribute_names = []
1700
- attribute_names.each do |attribute_name|
1701
- unless (aggregation = reflect_on_aggregation(attribute_name.to_sym)).nil?
1702
- aggregate_mapping(aggregation).each do |field_attr, aggregate_attr|
1703
- expanded_attribute_names << field_attr
1704
- end
1705
- else
1706
- expanded_attribute_names << attribute_name
1707
- end
1708
- end
1709
- expanded_attribute_names
1710
- end
1711
-
1712
- def all_attributes_exists?(attribute_names)
1713
- attribute_names = expand_attribute_names_for_aggregates(attribute_names)
1714
- attribute_names.all? { |name| column_methods_hash.include?(name.to_sym) }
1715
- end
1716
-
1717
- def attribute_condition(argument)
1718
- case argument
1719
- when nil then "IS ?"
1720
- when Array, ActiveRecord::Associations::AssociationCollection then "IN (?)"
1721
- when Range then "BETWEEN ? AND ?"
1722
- else "= ?"
1723
- end
1724
- end
1725
-
1726
- # Interpret Array and Hash as conditions and anything else as an id.
1727
- def expand_id_conditions(id_or_conditions)
1728
- case id_or_conditions
1729
- when Array, Hash then id_or_conditions
1730
- else sanitize_sql(primary_key => id_or_conditions)
1731
- end
1732
- end
1733
-
1734
-
1735
- # Defines an "attribute" method (like +inheritance_column+ or
1736
- # +table_name+). A new (class) method will be created with the
1737
- # given name. If a value is specified, the new method will
1738
- # return that value (as a string). Otherwise, the given block
1739
- # will be used to compute the value of the method.
1740
- #
1741
- # The original method will be aliased, with the new name being
1742
- # prefixed with "original_". This allows the new method to
1743
- # access the original value.
1744
- #
1745
- # Example:
1746
- #
1747
- # class A < ActiveRecord::Base
1748
- # define_attr_method :primary_key, "sysid"
1749
- # define_attr_method( :inheritance_column ) do
1750
- # original_inheritance_column + "_id"
1751
- # end
1752
- # end
1753
- def define_attr_method(name, value=nil, &block)
1754
- sing = class << self; self; end
1755
- sing.send :alias_method, "original_#{name}", name
1756
- if block_given?
1757
- sing.send :define_method, name, &block
1758
- else
1759
- # use eval instead of a block to work around a memory leak in dev
1760
- # mode in fcgi
1761
- sing.class_eval "def #{name}; #{value.to_s.inspect}; end"
1762
- end
1763
- end
1764
-
1765
- protected
1766
- # Scope parameters to method calls within the block. Takes a hash of method_name => parameters hash.
1767
- # method_name may be <tt>:find</tt> or <tt>:create</tt>. <tt>:find</tt> parameters may include the <tt>:conditions</tt>, <tt>:joins</tt>,
1768
- # <tt>:include</tt>, <tt>:offset</tt>, <tt>:limit</tt>, and <tt>:readonly</tt> options. <tt>:create</tt> parameters are an attributes hash.
1769
- #
1770
- # class Article < ActiveRecord::Base
1771
- # def self.create_with_scope
1772
- # with_scope(:find => { :conditions => "blog_id = 1" }, :create => { :blog_id => 1 }) do
1773
- # find(1) # => SELECT * from articles WHERE blog_id = 1 AND id = 1
1774
- # a = create(1)
1775
- # a.blog_id # => 1
1776
- # end
1777
- # end
1778
- # end
1779
- #
1780
- # In nested scopings, all previous parameters are overwritten by the innermost rule, with the exception of
1781
- # <tt>:conditions</tt> and <tt>:include</tt> options in <tt>:find</tt>, which are merged.
1782
- #
1783
- # class Article < ActiveRecord::Base
1784
- # def self.find_with_scope
1785
- # with_scope(:find => { :conditions => "blog_id = 1", :limit => 1 }, :create => { :blog_id => 1 }) do
1786
- # with_scope(:find => { :limit => 10 })
1787
- # find(:all) # => SELECT * from articles WHERE blog_id = 1 LIMIT 10
1788
- # end
1789
- # with_scope(:find => { :conditions => "author_id = 3" })
1790
- # find(:all) # => SELECT * from articles WHERE blog_id = 1 AND author_id = 3 LIMIT 1
1791
- # end
1792
- # end
1793
- # end
1794
- # end
1795
- #
1796
- # You can ignore any previous scopings by using the <tt>with_exclusive_scope</tt> method.
1797
- #
1798
- # class Article < ActiveRecord::Base
1799
- # def self.find_with_exclusive_scope
1800
- # with_scope(:find => { :conditions => "blog_id = 1", :limit => 1 }) do
1801
- # with_exclusive_scope(:find => { :limit => 10 })
1802
- # find(:all) # => SELECT * from articles LIMIT 10
1803
- # end
1804
- # end
1805
- # end
1806
- # end
1807
- def with_scope(method_scoping = {}, action = :merge, &block)
1808
- method_scoping = method_scoping.method_scoping if method_scoping.respond_to?(:method_scoping)
1809
-
1810
- # Dup first and second level of hash (method and params).
1811
- method_scoping = method_scoping.inject({}) do |hash, (method, params)|
1812
- hash[method] = (params == true) ? params : params.dup
1813
- hash
1814
- end
1815
-
1816
- method_scoping.assert_valid_keys([ :find, :create ])
1817
-
1818
- if f = method_scoping[:find]
1819
- f.assert_valid_keys(VALID_FIND_OPTIONS)
1820
- set_readonly_option! f
1821
- end
1822
-
1823
- # Merge scopings
1824
- if action == :merge && current_scoped_methods
1825
- method_scoping = current_scoped_methods.inject(method_scoping) do |hash, (method, params)|
1826
- case hash[method]
1827
- when Hash
1828
- if method == :find
1829
- (hash[method].keys + params.keys).uniq.each do |key|
1830
- merge = hash[method][key] && params[key] # merge if both scopes have the same key
1831
- if key == :conditions && merge
1832
- hash[method][key] = merge_conditions(params[key], hash[method][key])
1833
- elsif key == :include && merge
1834
- hash[method][key] = merge_includes(hash[method][key], params[key]).uniq
1835
- else
1836
- hash[method][key] = hash[method][key] || params[key]
1837
- end
1838
- end
1839
- else
1840
- hash[method] = params.merge(hash[method])
1841
- end
1842
- else
1843
- hash[method] = params
1844
- end
1845
- hash
1846
- end
1847
- end
1848
-
1849
- self.scoped_methods << method_scoping
1850
-
1851
- begin
1852
- yield
1853
- ensure
1854
- self.scoped_methods.pop
1855
- end
1856
- end
1857
-
1858
- # Works like with_scope, but discards any nested properties.
1859
- def with_exclusive_scope(method_scoping = {}, &block)
1860
- with_scope(method_scoping, :overwrite, &block)
1861
- end
1862
-
1863
- def subclasses #:nodoc:
1864
- @@subclasses[self] ||= []
1865
- @@subclasses[self] + extra = @@subclasses[self].inject([]) {|list, subclass| list + subclass.subclasses }
1866
- end
1867
-
1868
- # Test whether the given method and optional key are scoped.
1869
- def scoped?(method, key = nil) #:nodoc:
1870
- if current_scoped_methods && (scope = current_scoped_methods[method])
1871
- !key || scope.has_key?(key)
1872
- end
1873
- end
1874
-
1875
- # Retrieve the scope for the given method and optional key.
1876
- def scope(method, key = nil) #:nodoc:
1877
- if current_scoped_methods && (scope = current_scoped_methods[method])
1878
- key ? scope[key] : scope
1879
- end
1880
- end
1881
-
1882
- def thread_safe_scoped_methods #:nodoc:
1883
- scoped_methods = (Thread.current[:scoped_methods] ||= {})
1884
- scoped_methods[self] ||= []
1885
- end
1886
-
1887
- def single_threaded_scoped_methods #:nodoc:
1888
- @scoped_methods ||= []
1889
- end
1890
-
1891
- # pick up the correct scoped_methods version from @@allow_concurrency
1892
- if @@allow_concurrency
1893
- alias_method :scoped_methods, :thread_safe_scoped_methods
1894
- else
1895
- alias_method :scoped_methods, :single_threaded_scoped_methods
1896
- end
1897
-
1898
- def current_scoped_methods #:nodoc:
1899
- scoped_methods.last
1900
- end
1901
-
1902
- # Returns the class type of the record using the current module as a prefix. So descendents of
1903
- # MyApp::Business::Account would appear as MyApp::Business::AccountSubclass.
1904
- def compute_type(type_name)
1905
- modularized_name = type_name_with_module(type_name)
1906
- begin
1907
- class_eval(modularized_name, __FILE__, __LINE__)
1908
- rescue NameError
1909
- class_eval(type_name, __FILE__, __LINE__)
1910
- end
1911
- end
1912
-
1913
- # Returns the class descending directly from Active Record in the inheritance hierarchy.
1914
- def class_of_active_record_descendant(klass)
1915
- if klass.superclass == Base || klass.superclass.abstract_class?
1916
- klass
1917
- elsif klass.superclass.nil?
1918
- raise ActiveRecordError, "#{name} doesn't belong in a hierarchy descending from ActiveRecord"
1919
- else
1920
- class_of_active_record_descendant(klass.superclass)
1921
- end
1922
- end
1923
-
1924
- # Returns the name of the class descending directly from Active Record in the inheritance hierarchy.
1925
- def class_name_of_active_record_descendant(klass) #:nodoc:
1926
- klass.base_class.name
1927
- end
1928
-
1929
- # Accepts an array, hash, or string of SQL conditions and sanitizes
1930
- # them into a valid SQL fragment for a WHERE clause.
1931
- # ["name='%s' and group_id='%s'", "foo'bar", 4] returns "name='foo''bar' and group_id='4'"
1932
- # { :name => "foo'bar", :group_id => 4 } returns "name='foo''bar' and group_id='4'"
1933
- # "name='foo''bar' and group_id='4'" returns "name='foo''bar' and group_id='4'"
1934
- def sanitize_sql_for_conditions(condition)
1935
- return nil if condition.blank?
1936
-
1937
- case condition
1938
- when Array; sanitize_sql_array(condition)
1939
- when Hash; sanitize_sql_hash_for_conditions(condition)
1940
- else condition
1941
- end
1942
- end
1943
- alias_method :sanitize_sql, :sanitize_sql_for_conditions
1944
-
1945
- # Accepts an array, hash, or string of SQL conditions and sanitizes
1946
- # them into a valid SQL fragment for a SET clause.
1947
- # { :name => nil, :group_id => 4 } returns "name = NULL , group_id='4'"
1948
- def sanitize_sql_for_assignment(assignments)
1949
- case assignments
1950
- when Array; sanitize_sql_array(assignments)
1951
- when Hash; sanitize_sql_hash_for_assignment(assignments)
1952
- else assignments
1953
- end
1954
- end
1955
-
1956
- def aggregate_mapping(reflection)
1957
- mapping = reflection.options[:mapping] || [reflection.name, reflection.name]
1958
- mapping.first.is_a?(Array) ? mapping : [mapping]
1959
- end
1960
-
1961
- # Accepts a hash of SQL conditions and replaces those attributes
1962
- # that correspond to a +composed_of+ relationship with their expanded
1963
- # aggregate attribute values.
1964
- # Given:
1965
- # class Person < ActiveRecord::Base
1966
- # composed_of :address, :class_name => "Address",
1967
- # :mapping => [%w(address_street street), %w(address_city city)]
1968
- # end
1969
- # Then:
1970
- # { :address => Address.new("813 abc st.", "chicago") }
1971
- # # => { :address_street => "813 abc st.", :address_city => "chicago" }
1972
- def expand_hash_conditions_for_aggregates(attrs)
1973
- expanded_attrs = {}
1974
- attrs.each do |attr, value|
1975
- unless (aggregation = reflect_on_aggregation(attr.to_sym)).nil?
1976
- mapping = aggregate_mapping(aggregation)
1977
- mapping.each do |field_attr, aggregate_attr|
1978
- if mapping.size == 1 && !value.respond_to?(aggregate_attr)
1979
- expanded_attrs[field_attr] = value
1980
- else
1981
- expanded_attrs[field_attr] = value.send(aggregate_attr)
1982
- end
1983
- end
1984
- else
1985
- expanded_attrs[attr] = value
1986
- end
1987
- end
1988
- expanded_attrs
1989
- end
1990
-
1991
- # Sanitizes a hash of attribute/value pairs into SQL conditions for a WHERE clause.
1992
- # { :name => "foo'bar", :group_id => 4 }
1993
- # # => "name='foo''bar' and group_id= 4"
1994
- # { :status => nil, :group_id => [1,2,3] }
1995
- # # => "status IS NULL and group_id IN (1,2,3)"
1996
- # { :age => 13..18 }
1997
- # # => "age BETWEEN 13 AND 18"
1998
- # { 'other_records.id' => 7 }
1999
- # # => "`other_records`.`id` = 7"
2000
- # And for value objects on a composed_of relationship:
2001
- # { :address => Address.new("123 abc st.", "chicago") }
2002
- # # => "address_street='123 abc st.' and address_city='chicago'"
2003
- def sanitize_sql_hash_for_conditions(attrs)
2004
- attrs = expand_hash_conditions_for_aggregates(attrs)
2005
-
2006
- conditions = attrs.map do |attr, value|
2007
- attr = attr.to_s
2008
-
2009
- # Extract table name from qualified attribute names.
2010
- if attr.include?('.')
2011
- table_name, attr = attr.split('.', 2)
2012
- table_name = connection.quote_table_name(table_name)
2013
- else
2014
- table_name = quoted_table_name
2015
- end
2016
-
2017
- "#{table_name}.#{connection.quote_column_name(attr)} #{attribute_condition(value)}"
2018
- end.join(' AND ')
2019
-
2020
- replace_bind_variables(conditions, expand_range_bind_variables(attrs.values))
2021
- end
2022
- alias_method :sanitize_sql_hash, :sanitize_sql_hash_for_conditions
2023
-
2024
- # Sanitizes a hash of attribute/value pairs into SQL conditions for a SET clause.
2025
- # { :status => nil, :group_id => 1 }
2026
- # # => "status = NULL , group_id = 1"
2027
- def sanitize_sql_hash_for_assignment(attrs)
2028
- attrs.map do |attr, value|
2029
- "#{connection.quote_column_name(attr)} = #{quote_bound_value(value)}"
2030
- end.join(', ')
2031
- end
2032
-
2033
- # Accepts an array of conditions. The array has each value
2034
- # sanitized and interpolated into the SQL statement.
2035
- # ["name='%s' and group_id='%s'", "foo'bar", 4] returns "name='foo''bar' and group_id='4'"
2036
- def sanitize_sql_array(ary)
2037
- statement, *values = ary
2038
- if values.first.is_a?(Hash) and statement =~ /:\w+/
2039
- replace_named_bind_variables(statement, values.first)
2040
- elsif statement.include?('?')
2041
- replace_bind_variables(statement, values)
2042
- else
2043
- statement % values.collect { |value| connection.quote_string(value.to_s) }
2044
- end
2045
- end
2046
-
2047
- alias_method :sanitize_conditions, :sanitize_sql
2048
-
2049
- def replace_bind_variables(statement, values) #:nodoc:
2050
- raise_if_bind_arity_mismatch(statement, statement.count('?'), values.size)
2051
- bound = values.dup
2052
- statement.gsub('?') { quote_bound_value(bound.shift) }
2053
- end
2054
-
2055
- def replace_named_bind_variables(statement, bind_vars) #:nodoc:
2056
- statement.gsub(/:([a-zA-Z]\w*)/) do
2057
- match = $1.to_sym
2058
- if bind_vars.include?(match)
2059
- quote_bound_value(bind_vars[match])
2060
- else
2061
- raise PreparedStatementInvalid, "missing value for :#{match} in #{statement}"
2062
- end
2063
- end
2064
- end
2065
-
2066
- def expand_range_bind_variables(bind_vars) #:nodoc:
2067
- bind_vars.sum do |var|
2068
- if var.is_a?(Range)
2069
- [var.first, var.last]
2070
- else
2071
- [var]
2072
- end
2073
- end
2074
- end
2075
-
2076
- def quote_bound_value(value) #:nodoc:
2077
- if value.respond_to?(:map) && !value.is_a?(String)
2078
- if value.respond_to?(:empty?) && value.empty?
2079
- connection.quote(nil)
2080
- else
2081
- value.map { |v| connection.quote(v) }.join(',')
2082
- end
2083
- else
2084
- connection.quote(value)
2085
- end
2086
- end
2087
-
2088
- def raise_if_bind_arity_mismatch(statement, expected, provided) #:nodoc:
2089
- unless expected == provided
2090
- raise PreparedStatementInvalid, "wrong number of bind variables (#{provided} for #{expected}) in: #{statement}"
2091
- end
2092
- end
2093
-
2094
- VALID_FIND_OPTIONS = [ :conditions, :include, :joins, :limit, :offset,
2095
- :order, :select, :readonly, :group, :from, :lock ]
2096
-
2097
- def validate_find_options(options) #:nodoc:
2098
- options.assert_valid_keys(VALID_FIND_OPTIONS)
2099
- end
2100
-
2101
- def set_readonly_option!(options) #:nodoc:
2102
- # Inherit :readonly from finder scope if set. Otherwise,
2103
- # if :joins is not blank then :readonly defaults to true.
2104
- unless options.has_key?(:readonly)
2105
- if scoped_readonly = scope(:find, :readonly)
2106
- options[:readonly] = scoped_readonly
2107
- elsif !options[:joins].blank? && !options[:select]
2108
- options[:readonly] = true
2109
- end
2110
- end
2111
- end
2112
-
2113
- def encode_quoted_value(value) #:nodoc:
2114
- quoted_value = connection.quote(value)
2115
- quoted_value = "'#{quoted_value[1..-2].gsub(/\'/, "\\\\'")}'" if quoted_value.include?("\\\'") # (for ruby mode) "
2116
- quoted_value
2117
- end
2118
- end
2119
-
2120
- public
2121
- # New objects can be instantiated as either empty (pass no construction parameter) or pre-set with
2122
- # attributes but not yet saved (pass a hash with key names matching the associated table column names).
2123
- # In both instances, valid attribute keys are determined by the column names of the associated table --
2124
- # hence you can't have attributes that aren't part of the table columns.
2125
- def initialize(attributes = nil)
2126
- @attributes = attributes_from_column_definition
2127
- @attributes_cache = {}
2128
- @new_record = true
2129
- ensure_proper_type
2130
- self.attributes = attributes unless attributes.nil?
2131
- self.class.send(:scope, :create).each { |att,value| self.send("#{att}=", value) } if self.class.send(:scoped?, :create)
2132
- result = yield self if block_given?
2133
- callback(:after_initialize) if respond_to_without_attributes?(:after_initialize)
2134
- result
2135
- end
2136
-
2137
- # A model instance's primary key is always available as model.id
2138
- # whether you name it the default 'id' or set it to something else.
2139
- def id
2140
- attr_name = self.class.primary_key
2141
- column = column_for_attribute(attr_name)
2142
-
2143
- self.class.send(:define_read_method, :id, attr_name, column)
2144
- # now that the method exists, call it
2145
- self.send attr_name.to_sym
2146
-
2147
- end
2148
-
2149
- # Enables Active Record objects to be used as URL parameters in Action Pack automatically.
2150
- def to_param
2151
- # We can't use alias_method here, because method 'id' optimizes itself on the fly.
2152
- (id = self.id) ? id.to_s : nil # Be sure to stringify the id for routes
2153
- end
2154
-
2155
- # Returns a cache key that can be used to identify this record.
2156
- #
2157
- # ==== Examples
2158
- #
2159
- # Product.new.cache_key # => "products/new"
2160
- # Product.find(5).cache_key # => "products/5" (updated_at not available)
2161
- # Person.find(5).cache_key # => "people/5-20071224150000" (updated_at available)
2162
- def cache_key
2163
- case
2164
- when new_record?
2165
- "#{self.class.name.tableize}/new"
2166
- when self[:updated_at]
2167
- "#{self.class.name.tableize}/#{id}-#{updated_at.to_s(:number)}"
2168
- else
2169
- "#{self.class.name.tableize}/#{id}"
2170
- end
2171
- end
2172
-
2173
- def id_before_type_cast #:nodoc:
2174
- read_attribute_before_type_cast(self.class.primary_key)
2175
- end
2176
-
2177
- def quoted_id #:nodoc:
2178
- quote_value(id, column_for_attribute(self.class.primary_key))
2179
- end
2180
-
2181
- # Sets the primary ID.
2182
- def id=(value)
2183
- write_attribute(self.class.primary_key, value)
2184
- end
2185
-
2186
- # Returns true if this object hasn't been saved yet -- that is, a record for the object doesn't exist yet.
2187
- def new_record?
2188
- defined?(@new_record) && @new_record
2189
- end
2190
-
2191
- # * No record exists: Creates a new record with values matching those of the object attributes.
2192
- # * A record does exist: Updates the record with values matching those of the object attributes.
2193
- #
2194
- # Note: If your model specifies any validations then the method declaration dynamically
2195
- # changes to:
2196
- # save(perform_validation=true)
2197
- # Calling save(false) saves the model without running validations.
2198
- # See ActiveRecord::Validations for more information.
2199
- def save
2200
- create_or_update
2201
- end
2202
-
2203
- # Attempts to save the record, but instead of just returning false if it couldn't happen, it raises a
2204
- # RecordNotSaved exception
2205
- def save!
2206
- create_or_update || raise(RecordNotSaved)
2207
- end
2208
-
2209
- # Deletes the record in the database and freezes this instance to reflect that no changes should
2210
- # be made (since they can't be persisted).
2211
- def destroy
2212
- unless new_record?
2213
- connection.delete <<-end_sql, "#{self.class.name} Destroy"
2214
- DELETE FROM #{self.class.quoted_table_name}
2215
- WHERE #{connection.quote_column_name(self.class.primary_key)} = #{quoted_id}
2216
- end_sql
2217
- end
2218
-
2219
- freeze
2220
- end
2221
-
2222
- # Returns a clone of the record that hasn't been assigned an id yet and
2223
- # is treated as a new record. Note that this is a "shallow" clone:
2224
- # it copies the object's attributes only, not its associations.
2225
- # The extent of a "deep" clone is application-specific and is therefore
2226
- # left to the application to implement according to its need.
2227
- def clone
2228
- attrs = clone_attributes(:read_attribute_before_type_cast)
2229
- attrs.delete(self.class.primary_key)
2230
- record = self.class.new
2231
- record.send :instance_variable_set, '@attributes', attrs
2232
- record
2233
- end
2234
-
2235
- # Returns an instance of the specified +klass+ with the attributes of the current record. This is mostly useful in relation to
2236
- # single-table inheritance structures where you want a subclass to appear as the superclass. This can be used along with record
2237
- # identification in Action Pack to allow, say, <tt>Client < Company</tt> to do something like render <tt>:partial => @client.becomes(Company)</tt>
2238
- # to render that instance using the companies/company partial instead of clients/client.
2239
- #
2240
- # Note: The new instance will share a link to the same attributes as the original class. So any change to the attributes in either
2241
- # instance will affect the other.
2242
- def becomes(klass)
2243
- returning klass.new do |became|
2244
- became.instance_variable_set("@attributes", @attributes)
2245
- became.instance_variable_set("@attributes_cache", @attributes_cache)
2246
- became.instance_variable_set("@new_record", new_record?)
2247
- end
2248
- end
2249
-
2250
- # Updates a single attribute and saves the record. This is especially useful for boolean flags on existing records.
2251
- # Note: This method is overwritten by the Validation module that'll make sure that updates made with this method
2252
- # aren't subjected to validation checks. Hence, attributes can be updated even if the full object isn't valid.
2253
- def update_attribute(name, value)
2254
- send(name.to_s + '=', value)
2255
- save
2256
- end
2257
-
2258
- # Updates all the attributes from the passed-in Hash and saves the record. If the object is invalid, the saving will
2259
- # fail and false will be returned.
2260
- def update_attributes(attributes)
2261
- self.attributes = attributes
2262
- save
2263
- end
2264
-
2265
- # Updates an object just like Base.update_attributes but calls save! instead of save so an exception is raised if the record is invalid.
2266
- def update_attributes!(attributes)
2267
- self.attributes = attributes
2268
- save!
2269
- end
2270
-
2271
- # Initializes +attribute+ to zero if +nil+ and adds the value passed as +by+ (default is 1).
2272
- # The increment is performed directly on the underlying attribute, no setter is invoked.
2273
- # Only makes sense for number-based attributes. Returns +self+.
2274
- def increment(attribute, by = 1)
2275
- self[attribute] ||= 0
2276
- self[attribute] += by
2277
- self
2278
- end
2279
-
2280
- # Wrapper around +increment+ that saves the record. This method differs from
2281
- # its non-bang version in that it passes through the attribute setter.
2282
- # Saving is not subjected to validation checks. Returns +true+ if the
2283
- # record could be saved.
2284
- def increment!(attribute, by = 1)
2285
- increment(attribute, by).update_attribute(attribute, self[attribute])
2286
- end
2287
-
2288
- # Initializes +attribute+ to zero if +nil+ and subtracts the value passed as +by+ (default is 1).
2289
- # The decrement is performed directly on the underlying attribute, no setter is invoked.
2290
- # Only makes sense for number-based attributes. Returns +self+.
2291
- def decrement(attribute, by = 1)
2292
- self[attribute] ||= 0
2293
- self[attribute] -= by
2294
- self
2295
- end
2296
-
2297
- # Wrapper around +decrement+ that saves the record. This method differs from
2298
- # its non-bang version in that it passes through the attribute setter.
2299
- # Saving is not subjected to validation checks. Returns +true+ if the
2300
- # record could be saved.
2301
- def decrement!(attribute, by = 1)
2302
- decrement(attribute, by).update_attribute(attribute, self[attribute])
2303
- end
2304
-
2305
- # Assigns to +attribute+ the boolean opposite of <tt>attribute?</tt>. So
2306
- # if the predicate returns +true+ the attribute will become +false+. This
2307
- # method toggles directly the underlying value without calling any setter.
2308
- # Returns +self+.
2309
- def toggle(attribute)
2310
- self[attribute] = !send("#{attribute}?")
2311
- self
2312
- end
2313
-
2314
- # Wrapper around +toggle+ that saves the record. This method differs from
2315
- # its non-bang version in that it passes through the attribute setter.
2316
- # Saving is not subjected to validation checks. Returns +true+ if the
2317
- # record could be saved.
2318
- def toggle!(attribute)
2319
- toggle(attribute).update_attribute(attribute, self[attribute])
2320
- end
2321
-
2322
- # Reloads the attributes of this object from the database.
2323
- # The optional options argument is passed to find when reloading so you
2324
- # may do e.g. record.reload(:lock => true) to reload the same record with
2325
- # an exclusive row lock.
2326
- def reload(options = nil)
2327
- clear_aggregation_cache
2328
- clear_association_cache
2329
- @attributes.update(self.class.find(self.id, options).instance_variable_get('@attributes'))
2330
- @attributes_cache = {}
2331
- self
2332
- end
2333
-
2334
- # Returns the value of the attribute identified by <tt>attr_name</tt> after it has been typecast (for example,
2335
- # "2004-12-12" in a data column is cast to a date object, like Date.new(2004, 12, 12)).
2336
- # (Alias for the protected read_attribute method).
2337
- def [](attr_name)
2338
- read_attribute(attr_name)
2339
- end
2340
-
2341
- # Updates the attribute identified by <tt>attr_name</tt> with the specified +value+.
2342
- # (Alias for the protected write_attribute method).
2343
- def []=(attr_name, value)
2344
- write_attribute(attr_name, value)
2345
- end
2346
-
2347
- # Allows you to set all the attributes at once by passing in a hash with keys
2348
- # matching the attribute names (which again matches the column names). Sensitive attributes can be protected
2349
- # from this form of mass-assignment by using the +attr_protected+ macro. Or you can alternatively
2350
- # specify which attributes *can* be accessed with the +attr_accessible+ macro. Then all the
2351
- # attributes not included in that won't be allowed to be mass-assigned.
2352
- def attributes=(new_attributes, guard_protected_attributes = true)
2353
- return if new_attributes.nil?
2354
- attributes = new_attributes.dup
2355
- attributes.stringify_keys!
2356
-
2357
- multi_parameter_attributes = []
2358
- attributes = remove_attributes_protected_from_mass_assignment(attributes) if guard_protected_attributes
2359
-
2360
- attributes.each do |k, v|
2361
- k.include?("(") ? multi_parameter_attributes << [ k, v ] : send(k + "=", v)
2362
- end
2363
-
2364
- assign_multiparameter_attributes(multi_parameter_attributes)
2365
- end
2366
-
2367
-
2368
- # Returns a hash of all the attributes with their names as keys and the values of the attributes as values.
2369
- def attributes
2370
- self.attribute_names.inject({}) do |attrs, name|
2371
- attrs[name] = read_attribute(name)
2372
- attrs
2373
- end
2374
- end
2375
-
2376
- # Returns a hash of attributes before typecasting and deserialization.
2377
- def attributes_before_type_cast
2378
- self.attribute_names.inject({}) do |attrs, name|
2379
- attrs[name] = read_attribute_before_type_cast(name)
2380
- attrs
2381
- end
2382
- end
2383
-
2384
- # Format attributes nicely for inspect.
2385
- def attribute_for_inspect(attr_name)
2386
- value = read_attribute(attr_name)
2387
-
2388
- if value.is_a?(String) && value.length > 50
2389
- "#{value[0..50]}...".inspect
2390
- elsif value.is_a?(Date) || value.is_a?(Time)
2391
- %("#{value.to_s(:db)}")
2392
- else
2393
- value.inspect
2394
- end
2395
- end
2396
-
2397
- # Returns true if the specified +attribute+ has been set by the user or by a database load and is neither
2398
- # nil nor empty? (the latter only applies to objects that respond to empty?, most notably Strings).
2399
- def attribute_present?(attribute)
2400
- value = read_attribute(attribute)
2401
- !value.blank?
2402
- end
2403
-
2404
- # Returns true if the given attribute is in the attributes hash
2405
- def has_attribute?(attr_name)
2406
- @attributes.has_key?(attr_name.to_s)
2407
- end
2408
-
2409
- # Returns an array of names for the attributes available on this object sorted alphabetically.
2410
- def attribute_names
2411
- @attributes.keys.sort
2412
- end
2413
-
2414
- # Returns the column object for the named attribute.
2415
- def column_for_attribute(name)
2416
- self.class.columns_hash[name.to_s]
2417
- end
2418
-
2419
- # Returns true if the +comparison_object+ is the same object, or is of the same type and has the same id.
2420
- def ==(comparison_object)
2421
- comparison_object.equal?(self) ||
2422
- (comparison_object.instance_of?(self.class) &&
2423
- comparison_object.id == id &&
2424
- !comparison_object.new_record?)
2425
- end
2426
-
2427
- # Delegates to ==
2428
- def eql?(comparison_object)
2429
- self == (comparison_object)
2430
- end
2431
-
2432
- # Delegates to id in order to allow two records of the same type and id to work with something like:
2433
- # [ Person.find(1), Person.find(2), Person.find(3) ] & [ Person.find(1), Person.find(4) ] # => [ Person.find(1) ]
2434
- def hash
2435
- id.hash
2436
- end
2437
-
2438
- # Freeze the attributes hash such that associations are still accessible, even on destroyed records.
2439
- def freeze
2440
- @attributes.freeze; self
2441
- end
2442
-
2443
- # Returns +true+ if the attributes hash has been frozen.
2444
- def frozen?
2445
- @attributes.frozen?
2446
- end
2447
-
2448
- # Returns +true+ if the record is read only. Records loaded through joins with piggy-back
2449
- # attributes will be marked as read only since they cannot be saved.
2450
- def readonly?
2451
- defined?(@readonly) && @readonly == true
2452
- end
2453
-
2454
- # Marks this record as read only.
2455
- def readonly!
2456
- @readonly = true
2457
- end
2458
-
2459
- # Returns the contents of the record as a nicely formatted string.
2460
- def inspect
2461
- attributes_as_nice_string = self.class.column_names.collect { |name|
2462
- if has_attribute?(name) || new_record?
2463
- "#{name}: #{attribute_for_inspect(name)}"
2464
- end
2465
- }.compact.join(", ")
2466
- "#<#{self.class} #{attributes_as_nice_string}>"
2467
- end
2468
-
2469
- private
2470
- def create_or_update
2471
- raise ReadOnlyRecord if readonly?
2472
- result = new_record? ? create : update
2473
- result != false
2474
- end
2475
-
2476
- # Updates the associated record with values matching those of the instance attributes.
2477
- # Returns the number of affected rows.
2478
- def update(attribute_names = @attributes.keys)
2479
- quoted_attributes = attributes_with_quotes(false, false, attribute_names)
2480
- return 0 if quoted_attributes.empty?
2481
- connection.update(
2482
- "UPDATE #{self.class.quoted_table_name} " +
2483
- "SET #{quoted_comma_pair_list(connection, quoted_attributes)} " +
2484
- "WHERE #{connection.quote_column_name(self.class.primary_key)} = #{quote_value(id)}",
2485
- "#{self.class.name} Update"
2486
- )
2487
- end
2488
-
2489
- # Creates a record with values matching those of the instance attributes
2490
- # and returns its id.
2491
- def create
2492
- if self.id.nil? && connection.prefetch_primary_key?(self.class.table_name)
2493
- self.id = connection.next_sequence_value(self.class.sequence_name)
2494
- end
2495
-
2496
- quoted_attributes = attributes_with_quotes
2497
-
2498
- statement = if quoted_attributes.empty?
2499
- connection.empty_insert_statement(self.class.table_name)
2500
- else
2501
- "INSERT INTO #{self.class.quoted_table_name} " +
2502
- "(#{quoted_column_names.join(', ')}) " +
2503
- "VALUES(#{quoted_attributes.values.join(', ')})"
2504
- end
2505
-
2506
- self.id = connection.insert(statement, "#{self.class.name} Create",
2507
- self.class.primary_key, self.id, self.class.sequence_name)
2508
-
2509
- @new_record = false
2510
- id
2511
- end
2512
-
2513
- # Sets the attribute used for single table inheritance to this class name if this is not the ActiveRecord::Base descendent.
2514
- # Considering the hierarchy Reply < Message < ActiveRecord::Base, this makes it possible to do Reply.new without having to
2515
- # set <tt>Reply[Reply.inheritance_column] = "Reply"</tt> yourself. No such attribute would be set for objects of the
2516
- # Message class in that example.
2517
- def ensure_proper_type
2518
- unless self.class.descends_from_active_record?
2519
- write_attribute(self.class.inheritance_column, self.class.sti_name)
2520
- end
2521
- end
2522
-
2523
- def convert_number_column_value(value)
2524
- case value
2525
- when FalseClass; 0
2526
- when TrueClass; 1
2527
- when ''; nil
2528
- else value
2529
- end
2530
- end
2531
-
2532
- def remove_attributes_protected_from_mass_assignment(attributes)
2533
- safe_attributes =
2534
- if self.class.accessible_attributes.nil? && self.class.protected_attributes.nil?
2535
- attributes.reject { |key, value| attributes_protected_by_default.include?(key.gsub(/\(.+/, "")) }
2536
- elsif self.class.protected_attributes.nil?
2537
- attributes.reject { |key, value| !self.class.accessible_attributes.include?(key.gsub(/\(.+/, "")) || attributes_protected_by_default.include?(key.gsub(/\(.+/, "")) }
2538
- elsif self.class.accessible_attributes.nil?
2539
- attributes.reject { |key, value| self.class.protected_attributes.include?(key.gsub(/\(.+/,"")) || attributes_protected_by_default.include?(key.gsub(/\(.+/, "")) }
2540
- else
2541
- raise "Declare either attr_protected or attr_accessible for #{self.class}, but not both."
2542
- end
2543
-
2544
- removed_attributes = attributes.keys - safe_attributes.keys
2545
-
2546
- if removed_attributes.any?
2547
- logger.debug "WARNING: Can't mass-assign these protected attributes: #{removed_attributes.join(', ')}"
2548
- end
2549
-
2550
- safe_attributes
2551
- end
2552
-
2553
- # Removes attributes which have been marked as readonly.
2554
- def remove_readonly_attributes(attributes)
2555
- unless self.class.readonly_attributes.nil?
2556
- attributes.delete_if { |key, value| self.class.readonly_attributes.include?(key.gsub(/\(.+/,"")) }
2557
- else
2558
- attributes
2559
- end
2560
- end
2561
-
2562
- # The primary key and inheritance column can never be set by mass-assignment for security reasons.
2563
- def attributes_protected_by_default
2564
- default = [ self.class.primary_key, self.class.inheritance_column ]
2565
- default << 'id' unless self.class.primary_key.eql? 'id'
2566
- default
2567
- end
2568
-
2569
- # Returns a copy of the attributes hash where all the values have been safely quoted for use in
2570
- # an SQL statement.
2571
- def attributes_with_quotes(include_primary_key = true, include_readonly_attributes = true, attribute_names = @attributes.keys)
2572
- quoted = {}
2573
- connection = self.class.connection
2574
- attribute_names.each do |name|
2575
- if column = column_for_attribute(name)
2576
- quoted[name] = connection.quote(read_attribute(name), column) unless !include_primary_key && column.primary
2577
- end
2578
- end
2579
- include_readonly_attributes ? quoted : remove_readonly_attributes(quoted)
2580
- end
2581
-
2582
- # Quote strings appropriately for SQL statements.
2583
- def quote_value(value, column = nil)
2584
- self.class.connection.quote(value, column)
2585
- end
2586
-
2587
- # Interpolate custom SQL string in instance context.
2588
- # Optional record argument is meant for custom insert_sql.
2589
- def interpolate_sql(sql, record = nil)
2590
- instance_eval("%@#{sql.gsub('@', '\@')}@")
2591
- end
2592
-
2593
- # Initializes the attributes array with keys matching the columns from the linked table and
2594
- # the values matching the corresponding default value of that column, so
2595
- # that a new instance, or one populated from a passed-in Hash, still has all the attributes
2596
- # that instances loaded from the database would.
2597
- def attributes_from_column_definition
2598
- self.class.columns.inject({}) do |attributes, column|
2599
- attributes[column.name] = column.default unless column.name == self.class.primary_key
2600
- attributes
2601
- end
2602
- end
2603
-
2604
- # Instantiates objects for all attribute classes that needs more than one constructor parameter. This is done
2605
- # by calling new on the column type or aggregation type (through composed_of) object with these parameters.
2606
- # So having the pairs written_on(1) = "2004", written_on(2) = "6", written_on(3) = "24", will instantiate
2607
- # written_on (a date type) with Date.new("2004", "6", "24"). You can also specify a typecast character in the
2608
- # parentheses to have the parameters typecasted before they're used in the constructor. Use i for Fixnum, f for Float,
2609
- # s for String, and a for Array. If all the values for a given attribute are empty, the attribute will be set to nil.
2610
- def assign_multiparameter_attributes(pairs)
2611
- execute_callstack_for_multiparameter_attributes(
2612
- extract_callstack_for_multiparameter_attributes(pairs)
2613
- )
2614
- end
2615
-
2616
- def instantiate_time_object(name, values)
2617
- if self.class.time_zone_aware_attributes && !self.class.skip_time_zone_conversion_for_attributes.include?(name.to_sym)
2618
- Time.zone.local(*values)
2619
- else
2620
- Time.time_with_datetime_fallback(@@default_timezone, *values)
2621
- end
2622
- end
2623
-
2624
- def execute_callstack_for_multiparameter_attributes(callstack)
2625
- errors = []
2626
- callstack.each do |name, values|
2627
- klass = (self.class.reflect_on_aggregation(name.to_sym) || column_for_attribute(name)).klass
2628
- if values.empty?
2629
- send(name + "=", nil)
2630
- else
2631
- begin
2632
- value = if Time == klass
2633
- instantiate_time_object(name, values)
2634
- elsif Date == klass
2635
- begin
2636
- Date.new(*values)
2637
- rescue ArgumentError => ex # if Date.new raises an exception on an invalid date
2638
- instantiate_time_object(name, values).to_date # we instantiate Time object and convert it back to a date thus using Time's logic in handling invalid dates
2639
- end
2640
- else
2641
- klass.new(*values)
2642
- end
2643
-
2644
- send(name + "=", value)
2645
- rescue => ex
2646
- errors << AttributeAssignmentError.new("error on assignment #{values.inspect} to #{name}", ex, name)
2647
- end
2648
- end
2649
- end
2650
- unless errors.empty?
2651
- raise MultiparameterAssignmentErrors.new(errors), "#{errors.size} error(s) on assignment of multiparameter attributes"
2652
- end
2653
- end
2654
-
2655
- def extract_callstack_for_multiparameter_attributes(pairs)
2656
- attributes = { }
2657
-
2658
- for pair in pairs
2659
- multiparameter_name, value = pair
2660
- attribute_name = multiparameter_name.split("(").first
2661
- attributes[attribute_name] = [] unless attributes.include?(attribute_name)
2662
-
2663
- unless value.empty?
2664
- attributes[attribute_name] <<
2665
- [ find_parameter_position(multiparameter_name), type_cast_attribute_value(multiparameter_name, value) ]
2666
- end
2667
- end
2668
-
2669
- attributes.each { |name, values| attributes[name] = values.sort_by{ |v| v.first }.collect { |v| v.last } }
2670
- end
2671
-
2672
- def type_cast_attribute_value(multiparameter_name, value)
2673
- multiparameter_name =~ /\([0-9]*([a-z])\)/ ? value.send("to_" + $1) : value
2674
- end
2675
-
2676
- def find_parameter_position(multiparameter_name)
2677
- multiparameter_name.scan(/\(([0-9]*).*\)/).first.first
2678
- end
2679
-
2680
- # Returns a comma-separated pair list, like "key1 = val1, key2 = val2".
2681
- def comma_pair_list(hash)
2682
- hash.inject([]) { |list, pair| list << "#{pair.first} = #{pair.last}" }.join(", ")
2683
- end
2684
-
2685
- def quoted_column_names(attributes = attributes_with_quotes)
2686
- connection = self.class.connection
2687
- attributes.keys.collect do |column_name|
2688
- connection.quote_column_name(column_name)
2689
- end
2690
- end
2691
-
2692
- def self.quoted_table_name
2693
- self.connection.quote_table_name(self.table_name)
2694
- end
2695
-
2696
- def quote_columns(quoter, hash)
2697
- hash.inject({}) do |quoted, (name, value)|
2698
- quoted[quoter.quote_column_name(name)] = value
2699
- quoted
2700
- end
2701
- end
2702
-
2703
- def quoted_comma_pair_list(quoter, hash)
2704
- comma_pair_list(quote_columns(quoter, hash))
2705
- end
2706
-
2707
- def object_from_yaml(string)
2708
- return string unless string.is_a?(String)
2709
- YAML::load(string) rescue string
2710
- end
2711
-
2712
- def clone_attributes(reader_method = :read_attribute, attributes = {})
2713
- self.attribute_names.inject(attributes) do |attrs, name|
2714
- attrs[name] = clone_attribute_value(reader_method, name)
2715
- attrs
2716
- end
2717
- end
2718
-
2719
- def clone_attribute_value(reader_method, attribute_name)
2720
- value = send(reader_method, attribute_name)
2721
- value.duplicable? ? value.clone : value
2722
- rescue TypeError, NoMethodError
2723
- value
2724
- end
2725
- end
2726
- end