backlog 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1451) hide show
  1. metadata +19 -1808
  2. data/History.txt +0 -4
  3. data/LICENSE_LOCALIZATION +0 -20
  4. data/README +0 -180
  5. data/README_LOCALIZATION +0 -61
  6. data/README_LOGIN_SUGAR +0 -194
  7. data/Rakefile +0 -10
  8. data/app/controllers/application.rb +0 -142
  9. data/app/controllers/backlogs_controller.rb +0 -117
  10. data/app/controllers/estimates_controller.rb +0 -10
  11. data/app/controllers/periods_controller.rb +0 -224
  12. data/app/controllers/tasks_controller.rb +0 -233
  13. data/app/controllers/user_controller.rb +0 -177
  14. data/app/controllers/works_controller.rb +0 -111
  15. data/app/helpers/application_helper.rb +0 -26
  16. data/app/helpers/backlogs_helper.rb +0 -2
  17. data/app/helpers/estimates_helper.rb +0 -2
  18. data/app/helpers/periods_helper.rb +0 -2
  19. data/app/helpers/tasks_helper.rb +0 -17
  20. data/app/helpers/user_helper.rb +0 -53
  21. data/app/helpers/works_helper.rb +0 -2
  22. data/app/models/backlog.rb +0 -40
  23. data/app/models/estimate.rb +0 -10
  24. data/app/models/period.rb +0 -120
  25. data/app/models/task.rb +0 -261
  26. data/app/models/user.rb +0 -101
  27. data/app/models/user_notify.rb +0 -50
  28. data/app/models/work.rb +0 -46
  29. data/app/views/backlogs/_form.rhtml +0 -49
  30. data/app/views/backlogs/edit.rhtml +0 -10
  31. data/app/views/backlogs/new.rhtml +0 -11
  32. data/app/views/backlogs/show.rhtml +0 -90
  33. data/app/views/layouts/_headers.rhtml +0 -22
  34. data/app/views/layouts/mwrt002.rhtml +0 -83
  35. data/app/views/layouts/wide.rhtml +0 -22
  36. data/app/views/periods/_burn_down_chart.rhtml +0 -8
  37. data/app/views/periods/_form.rhtml +0 -56
  38. data/app/views/periods/_show_active.rhtml +0 -61
  39. data/app/views/periods/_title.rhtml +0 -11
  40. data/app/views/periods/edit.rhtml +0 -10
  41. data/app/views/periods/new.rhtml +0 -10
  42. data/app/views/periods/show.rhtml +0 -26
  43. data/app/views/tasks/_form.rhtml +0 -29
  44. data/app/views/tasks/_task.rhtml +0 -98
  45. data/app/views/tasks/edit.rhtml +0 -11
  46. data/app/views/tasks/list.rhtml +0 -77
  47. data/app/views/tasks/list_started.rhtml +0 -64
  48. data/app/views/tasks/new.rhtml +0 -10
  49. data/app/views/user/_edit.rhtml +0 -30
  50. data/app/views/user/_password.rhtml +0 -21
  51. data/app/views/user/change_password.rhtml +0 -15
  52. data/app/views/user/edit.rhtml +0 -19
  53. data/app/views/user/forgot_password.rhtml +0 -19
  54. data/app/views/user/login.rhtml +0 -24
  55. data/app/views/user/logout.rhtml +0 -8
  56. data/app/views/user/signup.rhtml +0 -14
  57. data/app/views/user/welcome.rhtml +0 -10
  58. data/app/views/user_notify/change_password.rhtml +0 -10
  59. data/app/views/user_notify/forgot_password.rhtml +0 -11
  60. data/app/views/user_notify/signup.rhtml +0 -12
  61. data/app/views/user_notify/signup_no.rhtml +0 -12
  62. data/app/views/works/_form.rhtml +0 -81
  63. data/app/views/works/edit.rhtml +0 -11
  64. data/app/views/works/list.rhtml +0 -45
  65. data/app/views/works/new.rhtml +0 -11
  66. data/app/views/works/show.rhtml +0 -10
  67. data/app/views/works/timeliste.rhtml +0 -883
  68. data/app/views/works/weekly_work_sheet.rhtml +0 -79
  69. data/app/views/works/weekly_work_sheet2.rhtml +0 -91
  70. data/backlog +0 -27
  71. data/backlog-0.0.2.gem +0 -0
  72. data/backlog.gemspec +0 -21
  73. data/config/boot.rb +0 -45
  74. data/config/database.yml +0 -31
  75. data/config/deploy.rb +0 -34
  76. data/config/deploy_kubosch.rb +0 -106
  77. data/config/environment.rb +0 -63
  78. data/config/environments/datek_production.rb +0 -26
  79. data/config/environments/development.rb +0 -27
  80. data/config/environments/kubosch_production.rb +0 -21
  81. data/config/environments/localization_environment.rb +0 -12
  82. data/config/environments/test.rb +0 -19
  83. data/config/environments/user_environment.rb +0 -21
  84. data/config/mime_types.yaml +0 -1
  85. data/config/routes.rb +0 -5
  86. data/db/migrate/001_tasks.rb +0 -15
  87. data/db/migrate/002_backlogs.rb +0 -14
  88. data/db/migrate/003_add_estimation_points.rb +0 -16
  89. data/db/migrate/004_add_period.rb +0 -63
  90. data/db/migrate/005_add_field_work_started_at.rb +0 -9
  91. data/db/migrate/006_works_data_fix.rb +0 -13
  92. data/db/migrate/007_add_task_created_at.rb +0 -23
  93. data/db/migrate/008_add_backlog_options.rb +0 -13
  94. data/db/migrate/009_add_subtasks.rb +0 -28
  95. data/db/migrate/010_add_work_start.rb +0 -9
  96. data/db/migrate/011_login_sugar.rb +0 -21
  97. data/db/migrate/012_add_resolution.rb +0 -12
  98. data/db/migrate/013_create_estimates.rb +0 -20
  99. data/db/migrate/014_add_customer_option.rb +0 -11
  100. data/db/migrate/015_add_user_option.rb +0 -43
  101. data/db/migrate/016_add_invoicable_flag.rb +0 -11
  102. data/db/migrate/017_insert_datek_projects.rb +0 -95
  103. data/db/schema.rb +0 -92
  104. data/default_login_sugar_setup.zip +0 -0
  105. data/doc/README_FOR_APP +0 -2
  106. data/lang/en.yaml +0 -72
  107. data/lang/localizations.yaml +0 -2
  108. data/lang/no.yaml +0 -71
  109. data/lib/array_helper.rb +0 -10
  110. data/lib/clock.rb +0 -14
  111. data/lib/localization.rb +0 -88
  112. data/lib/tasks/capistrano.rake +0 -90
  113. data/lib/user_system.rb +0 -54
  114. data/log/development.log +0 -40556
  115. data/public/404.html +0 -8
  116. data/public/500.html +0 -8
  117. data/public/dispatch.cgi +0 -10
  118. data/public/dispatch.fcgi +0 -24
  119. data/public/dispatch.rb +0 -10
  120. data/public/favicon.ico +0 -0
  121. data/public/images/add.png +0 -0
  122. data/public/images/add.svg +0 -70
  123. data/public/images/appunti_architetto_franc_01.svg +0 -92
  124. data/public/images/arrow07_2.png +0 -0
  125. data/public/images/arrow07_4.png +0 -0
  126. data/public/images/arrow_down.png +0 -0
  127. data/public/images/arrow_down.svg +0 -59
  128. data/public/images/arrow_left.png +0 -0
  129. data/public/images/arrow_left.svg +0 -59
  130. data/public/images/arrow_right.png +0 -0
  131. data/public/images/arrow_right.svg +0 -59
  132. data/public/images/arrow_up.png +0 -0
  133. data/public/images/arrow_up.svg +0 -59
  134. data/public/images/blank.jpg +0 -0
  135. data/public/images/cestino_pieno_architetto_01.svg +0 -470
  136. data/public/images/checkmark.png +0 -0
  137. data/public/images/checkmark_org.png +0 -0
  138. data/public/images/clipboard.png +0 -0
  139. data/public/images/clipboard.svg +0 -62
  140. data/public/images/construction_hammer_jon__01.svg +0 -116
  141. data/public/images/eraser.png +0 -0
  142. data/public/images/eraser_org.png +0 -0
  143. data/public/images/ernes_stop.png +0 -0
  144. data/public/images/ernes_stop_org.png +0 -0
  145. data/public/images/hammer.png +0 -0
  146. data/public/images/header.jpg +0 -0
  147. data/public/images/pagebak.jpg +0 -0
  148. data/public/images/paper3.svg +0 -54
  149. data/public/images/period.png +0 -0
  150. data/public/images/period_org.png +0 -0
  151. data/public/images/question.svg +0 -56
  152. data/public/images/rails.png +0 -0
  153. data/public/images/tabella_architetto_franc_01.svg +0 -105
  154. data/public/javascripts/application.js +0 -2
  155. data/public/javascripts/controls.js +0 -833
  156. data/public/javascripts/dragdrop.js +0 -944
  157. data/public/javascripts/effects.js +0 -1088
  158. data/public/javascripts/prototype.js +0 -2515
  159. data/public/javascripts/zapatec/utils/transport.js +0 -2217
  160. data/public/javascripts/zapatec/utils/utils.js +0 -1799
  161. data/public/javascripts/zapatec/utils/zapatec.js +0 -90
  162. data/public/javascripts/zapatec/utils/zpeventdriven.js +0 -212
  163. data/public/javascripts/zapatec/utils/zpwidget.js +0 -729
  164. data/public/javascripts/zapatec/zpcal/lang/calendar-no.js +0 -124
  165. data/public/javascripts/zapatec/zpcal/src/calendar-core.js +0 -2878
  166. data/public/javascripts/zapatec/zpcal/src/calendar-date-core.js +0 -348
  167. data/public/javascripts/zapatec/zpcal/src/calendar-setup.js +0 -360
  168. data/public/javascripts/zapatec/zpcal/src/calendar.js +0 -35
  169. data/public/robots.txt +0 -1
  170. data/public/stylesheets/backlog.css +0 -65
  171. data/public/stylesheets/mwrt002.css +0 -54
  172. data/public/stylesheets/mwrt002MAC.css +0 -3
  173. data/public/stylesheets/mwrt002NN.css +0 -3
  174. data/public/stylesheets/scaffold.css +0 -74
  175. data/public/stylesheets/user.css +0 -74
  176. data/public/stylesheets/zpcal/themes/green.css +0 -153
  177. data/public/stylesheets/zpcal/themes/layouts/layout-2d.css +0 -134
  178. data/public/stylesheets/zpcal/themes/layouts/layout-common.css +0 -74
  179. data/public/stylesheets/zpcal/themes/menuarrow.gif +0 -0
  180. data/public/stylesheets/zpcal/themes/scroller-down.gif +0 -0
  181. data/public/stylesheets/zpcal/themes/scroller-up.gif +0 -0
  182. data/script/about +0 -3
  183. data/script/breakpointer +0 -3
  184. data/script/console +0 -3
  185. data/script/destroy +0 -3
  186. data/script/generate +0 -3
  187. data/script/performance/benchmarker +0 -3
  188. data/script/performance/profiler +0 -3
  189. data/script/plugin +0 -3
  190. data/script/process/inspector +0 -3
  191. data/script/process/reaper +0 -3
  192. data/script/process/spawner +0 -3
  193. data/script/runner +0 -3
  194. data/script/server +0 -3
  195. data/test/fixtures/backlogs.yml +0 -5
  196. data/test/fixtures/estimates.yml +0 -5
  197. data/test/fixtures/periods.yml +0 -7
  198. data/test/fixtures/tasks.yml +0 -6
  199. data/test/fixtures/users.yml +0 -48
  200. data/test/fixtures/works.yml +0 -5
  201. data/test/functional/backlogs_controller_test.rb +0 -88
  202. data/test/functional/estimates_controller_test.rb +0 -18
  203. data/test/functional/periods_controller_test.rb +0 -88
  204. data/test/functional/tasks_controller_test.rb +0 -88
  205. data/test/functional/user_controller_test.rb +0 -254
  206. data/test/functional/works_controller_test.rb +0 -88
  207. data/test/integration/user_system_test.rb +0 -95
  208. data/test/mocks/test/clock.rb +0 -14
  209. data/test/mocks/test/user_notify.rb +0 -16
  210. data/test/unit/backlog_item_test.rb +0 -10
  211. data/test/unit/estimate_test.rb +0 -10
  212. data/test/unit/localization_test.rb +0 -47
  213. data/test/unit/period_test.rb +0 -10
  214. data/test/unit/task_test.rb +0 -10
  215. data/test/unit/user_test.rb +0 -133
  216. data/test/unit/work_test.rb +0 -10
  217. data/vendor/plugins/activerecord_foreign_key_extensions/init.rb +0 -2
  218. data/vendor/plugins/activerecord_foreign_key_extensions/lib/active_record_extensions.rb +0 -180
  219. data/vendor/plugins/foreign_key_migrations/CHANGELOG +0 -67
  220. data/vendor/plugins/foreign_key_migrations/MIT-LICENSE +0 -20
  221. data/vendor/plugins/foreign_key_migrations/README +0 -60
  222. data/vendor/plugins/foreign_key_migrations/init.rb +0 -2
  223. data/vendor/plugins/foreign_key_migrations/install.rb +0 -1
  224. data/vendor/plugins/foreign_key_migrations/lib/red_hill_consulting/foreign_key_migrations.rb +0 -57
  225. data/vendor/plugins/redhillonrails_core/CHANGELOG +0 -85
  226. data/vendor/plugins/redhillonrails_core/MIT-LICENSE +0 -20
  227. data/vendor/plugins/redhillonrails_core/README +0 -97
  228. data/vendor/plugins/redhillonrails_core/init.rb +0 -9
  229. data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core.rb +0 -290
  230. data/vendor/rails/REVISION_6747 +0 -0
  231. data/vendor/rails/actionmailer/CHANGELOG +0 -281
  232. data/vendor/rails/actionmailer/MIT-LICENSE +0 -21
  233. data/vendor/rails/actionmailer/README +0 -145
  234. data/vendor/rails/actionmailer/Rakefile +0 -95
  235. data/vendor/rails/actionmailer/install.rb +0 -30
  236. data/vendor/rails/actionmailer/lib/action_mailer.rb +0 -51
  237. data/vendor/rails/actionmailer/lib/action_mailer/adv_attr_accessor.rb +0 -30
  238. data/vendor/rails/actionmailer/lib/action_mailer/base.rb +0 -570
  239. data/vendor/rails/actionmailer/lib/action_mailer/helpers.rb +0 -111
  240. data/vendor/rails/actionmailer/lib/action_mailer/mail_helper.rb +0 -19
  241. data/vendor/rails/actionmailer/lib/action_mailer/part.rb +0 -113
  242. data/vendor/rails/actionmailer/lib/action_mailer/part_container.rb +0 -51
  243. data/vendor/rails/actionmailer/lib/action_mailer/quoting.rb +0 -59
  244. data/vendor/rails/actionmailer/lib/action_mailer/test_helper.rb +0 -67
  245. data/vendor/rails/actionmailer/lib/action_mailer/utils.rb +0 -8
  246. data/vendor/rails/actionmailer/lib/action_mailer/vendor/text/format.rb +0 -1466
  247. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail.rb +0 -3
  248. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/address.rb +0 -242
  249. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/attachments.rb +0 -41
  250. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/base64.rb +0 -71
  251. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/config.rb +0 -69
  252. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/encode.rb +0 -467
  253. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/facade.rb +0 -552
  254. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/header.rb +0 -914
  255. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/info.rb +0 -35
  256. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/loader.rb +0 -1
  257. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/mail.rb +0 -447
  258. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb +0 -433
  259. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/mbox.rb +0 -1
  260. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/net.rb +0 -280
  261. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/obsolete.rb +0 -135
  262. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/parser.rb +0 -1522
  263. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/port.rb +0 -377
  264. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb +0 -131
  265. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/scanner.rb +0 -41
  266. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/scanner_r.rb +0 -263
  267. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/stringio.rb +0 -277
  268. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/tmail.rb +0 -1
  269. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/utils.rb +0 -238
  270. data/vendor/rails/actionmailer/lib/action_mailer/version.rb +0 -9
  271. data/vendor/rails/actionmailer/test/abstract_unit.rb +0 -39
  272. data/vendor/rails/actionmailer/test/fixtures/first_mailer/share.erb +0 -1
  273. data/vendor/rails/actionmailer/test/fixtures/first_mailer/share.rhtml +0 -0
  274. data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.erb +0 -1
  275. data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml +0 -0
  276. data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.erb +0 -1
  277. data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml +0 -0
  278. data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.erb +0 -1
  279. data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml +0 -0
  280. data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb +0 -5
  281. data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml +0 -0
  282. data/vendor/rails/actionmailer/test/fixtures/helpers/example_helper.rb +0 -5
  283. data/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb +0 -1
  284. data/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml +0 -0
  285. data/vendor/rails/actionmailer/test/fixtures/path.with.dots/multipart_with_template_path_with_dots.rhtml +0 -0
  286. data/vendor/rails/actionmailer/test/fixtures/raw_email +0 -14
  287. data/vendor/rails/actionmailer/test/fixtures/raw_email10 +0 -20
  288. data/vendor/rails/actionmailer/test/fixtures/raw_email11 +0 -34
  289. data/vendor/rails/actionmailer/test/fixtures/raw_email12 +0 -32
  290. data/vendor/rails/actionmailer/test/fixtures/raw_email13 +0 -29
  291. data/vendor/rails/actionmailer/test/fixtures/raw_email2 +0 -114
  292. data/vendor/rails/actionmailer/test/fixtures/raw_email3 +0 -70
  293. data/vendor/rails/actionmailer/test/fixtures/raw_email4 +0 -59
  294. data/vendor/rails/actionmailer/test/fixtures/raw_email5 +0 -19
  295. data/vendor/rails/actionmailer/test/fixtures/raw_email6 +0 -20
  296. data/vendor/rails/actionmailer/test/fixtures/raw_email7 +0 -66
  297. data/vendor/rails/actionmailer/test/fixtures/raw_email8 +0 -47
  298. data/vendor/rails/actionmailer/test/fixtures/raw_email9 +0 -28
  299. data/vendor/rails/actionmailer/test/fixtures/raw_email_quoted_with_0d0a +0 -14
  300. data/vendor/rails/actionmailer/test/fixtures/raw_email_with_nested_attachment +0 -100
  301. data/vendor/rails/actionmailer/test/fixtures/raw_email_with_partially_quoted_subject +0 -14
  302. data/vendor/rails/actionmailer/test/fixtures/second_mailer/share.erb +0 -1
  303. data/vendor/rails/actionmailer/test/fixtures/second_mailer/share.rhtml +0 -0
  304. data/vendor/rails/actionmailer/test/fixtures/templates/signed_up.erb +0 -3
  305. data/vendor/rails/actionmailer/test/fixtures/templates/signed_up.rhtml +0 -0
  306. data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb +0 -1
  307. data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml +0 -0
  308. data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb +0 -10
  309. data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml +0 -0
  310. data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb +0 -2
  311. data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml +0 -0
  312. data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb +0 -1
  313. data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml +0 -0
  314. data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.erb +0 -3
  315. data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.rhtml +0 -0
  316. data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb +0 -3
  317. data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml +0 -0
  318. data/vendor/rails/actionmailer/test/mail_helper_test.rb +0 -91
  319. data/vendor/rails/actionmailer/test/mail_render_test.rb +0 -79
  320. data/vendor/rails/actionmailer/test/mail_service_test.rb +0 -850
  321. data/vendor/rails/actionmailer/test/quoting_test.rb +0 -57
  322. data/vendor/rails/actionmailer/test/test_helper_test.rb +0 -79
  323. data/vendor/rails/actionmailer/test/tmail_test.rb +0 -21
  324. data/vendor/rails/actionmailer/test/url_test.rb +0 -68
  325. data/vendor/rails/actionpack/CHANGELOG +0 -3560
  326. data/vendor/rails/actionpack/MIT-LICENSE +0 -21
  327. data/vendor/rails/actionpack/README +0 -469
  328. data/vendor/rails/actionpack/RUNNING_UNIT_TESTS +0 -25
  329. data/vendor/rails/actionpack/Rakefile +0 -154
  330. data/vendor/rails/actionpack/examples/address_book/index.erb +0 -33
  331. data/vendor/rails/actionpack/examples/address_book/index.rhtml +0 -0
  332. data/vendor/rails/actionpack/examples/address_book/layout.erb +0 -8
  333. data/vendor/rails/actionpack/examples/address_book/layout.rhtml +0 -0
  334. data/vendor/rails/actionpack/examples/address_book_controller.cgi +0 -9
  335. data/vendor/rails/actionpack/examples/address_book_controller.fcgi +0 -6
  336. data/vendor/rails/actionpack/examples/address_book_controller.rb +0 -52
  337. data/vendor/rails/actionpack/examples/address_book_controller.rbx +0 -4
  338. data/vendor/rails/actionpack/examples/benchmark.rb +0 -52
  339. data/vendor/rails/actionpack/examples/benchmark_with_ar.fcgi +0 -89
  340. data/vendor/rails/actionpack/examples/blog_controller.cgi +0 -53
  341. data/vendor/rails/actionpack/examples/debate/index.erb +0 -14
  342. data/vendor/rails/actionpack/examples/debate/index.rhtml +0 -0
  343. data/vendor/rails/actionpack/examples/debate/new_topic.erb +0 -22
  344. data/vendor/rails/actionpack/examples/debate/new_topic.rhtml +0 -0
  345. data/vendor/rails/actionpack/examples/debate/topic.erb +0 -32
  346. data/vendor/rails/actionpack/examples/debate/topic.rhtml +0 -0
  347. data/vendor/rails/actionpack/examples/debate_controller.cgi +0 -57
  348. data/vendor/rails/actionpack/install.rb +0 -30
  349. data/vendor/rails/actionpack/lib/action_controller.rb +0 -85
  350. data/vendor/rails/actionpack/lib/action_controller/assertions.rb +0 -70
  351. data/vendor/rails/actionpack/lib/action_controller/assertions/dom_assertions.rb +0 -25
  352. data/vendor/rails/actionpack/lib/action_controller/assertions/model_assertions.rb +0 -12
  353. data/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb +0 -141
  354. data/vendor/rails/actionpack/lib/action_controller/assertions/routing_assertions.rb +0 -99
  355. data/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb +0 -585
  356. data/vendor/rails/actionpack/lib/action_controller/assertions/tag_assertions.rb +0 -117
  357. data/vendor/rails/actionpack/lib/action_controller/base.rb +0 -1251
  358. data/vendor/rails/actionpack/lib/action_controller/benchmarking.rb +0 -93
  359. data/vendor/rails/actionpack/lib/action_controller/caching.rb +0 -656
  360. data/vendor/rails/actionpack/lib/action_controller/cgi_ext.rb +0 -18
  361. data/vendor/rails/actionpack/lib/action_controller/cgi_ext/cookie.rb +0 -123
  362. data/vendor/rails/actionpack/lib/action_controller/cgi_ext/parameters.rb +0 -208
  363. data/vendor/rails/actionpack/lib/action_controller/cgi_ext/query_extension.rb +0 -96
  364. data/vendor/rails/actionpack/lib/action_controller/cgi_ext/session.rb +0 -63
  365. data/vendor/rails/actionpack/lib/action_controller/cgi_ext/stdinput.rb +0 -23
  366. data/vendor/rails/actionpack/lib/action_controller/cgi_process.rb +0 -217
  367. data/vendor/rails/actionpack/lib/action_controller/components.rb +0 -165
  368. data/vendor/rails/actionpack/lib/action_controller/cookies.rb +0 -78
  369. data/vendor/rails/actionpack/lib/action_controller/filters.rb +0 -752
  370. data/vendor/rails/actionpack/lib/action_controller/flash.rb +0 -184
  371. data/vendor/rails/actionpack/lib/action_controller/helpers.rb +0 -153
  372. data/vendor/rails/actionpack/lib/action_controller/http_authentication.rb +0 -121
  373. data/vendor/rails/actionpack/lib/action_controller/integration.rb +0 -552
  374. data/vendor/rails/actionpack/lib/action_controller/layout.rb +0 -318
  375. data/vendor/rails/actionpack/lib/action_controller/macros/auto_complete.rb +0 -53
  376. data/vendor/rails/actionpack/lib/action_controller/macros/in_place_editing.rb +0 -33
  377. data/vendor/rails/actionpack/lib/action_controller/mime_responds.rb +0 -191
  378. data/vendor/rails/actionpack/lib/action_controller/mime_type.rb +0 -157
  379. data/vendor/rails/actionpack/lib/action_controller/mime_types.rb +0 -20
  380. data/vendor/rails/actionpack/lib/action_controller/pagination.rb +0 -402
  381. data/vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb +0 -56
  382. data/vendor/rails/actionpack/lib/action_controller/record_identifier.rb +0 -91
  383. data/vendor/rails/actionpack/lib/action_controller/request.rb +0 -316
  384. data/vendor/rails/actionpack/lib/action_controller/rescue.rb +0 -152
  385. data/vendor/rails/actionpack/lib/action_controller/resources.rb +0 -485
  386. data/vendor/rails/actionpack/lib/action_controller/response.rb +0 -76
  387. data/vendor/rails/actionpack/lib/action_controller/routing.rb +0 -1365
  388. data/vendor/rails/actionpack/lib/action_controller/scaffolding.rb +0 -191
  389. data/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb +0 -335
  390. data/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb +0 -143
  391. data/vendor/rails/actionpack/lib/action_controller/session/drb_server.rb +0 -32
  392. data/vendor/rails/actionpack/lib/action_controller/session/drb_store.rb +0 -35
  393. data/vendor/rails/actionpack/lib/action_controller/session/mem_cache_store.rb +0 -105
  394. data/vendor/rails/actionpack/lib/action_controller/session_management.rb +0 -150
  395. data/vendor/rails/actionpack/lib/action_controller/status_codes.rb +0 -88
  396. data/vendor/rails/actionpack/lib/action_controller/streaming.rb +0 -141
  397. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_request_and_response.erb +0 -24
  398. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_request_and_response.rhtml +0 -0
  399. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_trace.erb +0 -26
  400. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_trace.rhtml +0 -0
  401. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/diagnostics.erb +0 -11
  402. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml +0 -0
  403. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.erb +0 -29
  404. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.rhtml +0 -0
  405. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/missing_template.erb +0 -2
  406. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/missing_template.rhtml +0 -0
  407. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/routing_error.erb +0 -10
  408. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/routing_error.rhtml +0 -0
  409. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/template_error.erb +0 -21
  410. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/template_error.rhtml +0 -0
  411. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/unknown_action.erb +0 -2
  412. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/unknown_action.rhtml +0 -0
  413. data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/edit.erb +0 -7
  414. data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/edit.rhtml +0 -0
  415. data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/layout.erb +0 -69
  416. data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/layout.rhtml +0 -0
  417. data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/list.erb +0 -27
  418. data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/list.rhtml +0 -0
  419. data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/new.erb +0 -6
  420. data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/new.rhtml +0 -0
  421. data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/show.erb +0 -9
  422. data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/show.rhtml +0 -0
  423. data/vendor/rails/actionpack/lib/action_controller/test_process.rb +0 -516
  424. data/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb +0 -124
  425. data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/document.rb +0 -64
  426. data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb +0 -530
  427. data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb +0 -828
  428. data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/tokenizer.rb +0 -105
  429. data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/version.rb +0 -11
  430. data/vendor/rails/actionpack/lib/action_controller/verification.rb +0 -108
  431. data/vendor/rails/actionpack/lib/action_pack.rb +0 -24
  432. data/vendor/rails/actionpack/lib/action_pack/version.rb +0 -9
  433. data/vendor/rails/actionpack/lib/action_view.rb +0 -31
  434. data/vendor/rails/actionpack/lib/action_view/base.rb +0 -625
  435. data/vendor/rails/actionpack/lib/action_view/compiled_templates.rb +0 -69
  436. data/vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb +0 -237
  437. data/vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb +0 -405
  438. data/vendor/rails/actionpack/lib/action_view/helpers/benchmark_helper.rb +0 -24
  439. data/vendor/rails/actionpack/lib/action_view/helpers/cache_helper.rb +0 -10
  440. data/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb +0 -128
  441. data/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb +0 -454
  442. data/vendor/rails/actionpack/lib/action_view/helpers/debug_helper.rb +0 -31
  443. data/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb +0 -609
  444. data/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb +0 -372
  445. data/vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb +0 -192
  446. data/vendor/rails/actionpack/lib/action_view/helpers/java_script_macros_helper.rb +0 -233
  447. data/vendor/rails/actionpack/lib/action_view/helpers/javascript_helper.rb +0 -193
  448. data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/controls.js +0 -833
  449. data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/dragdrop.js +0 -942
  450. data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/effects.js +0 -1088
  451. data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/prototype.js +0 -2515
  452. data/vendor/rails/actionpack/lib/action_view/helpers/number_helper.rb +0 -152
  453. data/vendor/rails/actionpack/lib/action_view/helpers/pagination_helper.rb +0 -86
  454. data/vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb +0 -913
  455. data/vendor/rails/actionpack/lib/action_view/helpers/record_identification_helper.rb +0 -20
  456. data/vendor/rails/actionpack/lib/action_view/helpers/record_tag_helper.rb +0 -59
  457. data/vendor/rails/actionpack/lib/action_view/helpers/scriptaculous_helper.rb +0 -140
  458. data/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb +0 -108
  459. data/vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb +0 -401
  460. data/vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb +0 -496
  461. data/vendor/rails/actionpack/lib/action_view/partials.rb +0 -128
  462. data/vendor/rails/actionpack/lib/action_view/template_error.rb +0 -102
  463. data/vendor/rails/actionpack/test/abstract_unit.rb +0 -29
  464. data/vendor/rails/actionpack/test/active_record_unit.rb +0 -108
  465. data/vendor/rails/actionpack/test/activerecord/active_record_store_test.rb +0 -142
  466. data/vendor/rails/actionpack/test/activerecord/pagination_test.rb +0 -156
  467. data/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +0 -479
  468. data/vendor/rails/actionpack/test/controller/addresses_render_test.rb +0 -43
  469. data/vendor/rails/actionpack/test/controller/assert_select_test.rb +0 -597
  470. data/vendor/rails/actionpack/test/controller/base_test.rb +0 -134
  471. data/vendor/rails/actionpack/test/controller/benchmark_test.rb +0 -33
  472. data/vendor/rails/actionpack/test/controller/caching_test.rb +0 -262
  473. data/vendor/rails/actionpack/test/controller/capture_test.rb +0 -71
  474. data/vendor/rails/actionpack/test/controller/cgi_test.rb +0 -432
  475. data/vendor/rails/actionpack/test/controller/components_test.rb +0 -129
  476. data/vendor/rails/actionpack/test/controller/content_type_test.rb +0 -139
  477. data/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/admin/user_controller.rb +0 -0
  478. data/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/user_controller.rb +0 -0
  479. data/vendor/rails/actionpack/test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib/plugin_controller.rb +0 -0
  480. data/vendor/rails/actionpack/test/controller/cookie_test.rb +0 -88
  481. data/vendor/rails/actionpack/test/controller/custom_handler_test.rb +0 -41
  482. data/vendor/rails/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb +0 -48
  483. data/vendor/rails/actionpack/test/controller/fake_controllers.rb +0 -16
  484. data/vendor/rails/actionpack/test/controller/filter_params_test.rb +0 -42
  485. data/vendor/rails/actionpack/test/controller/filters_test.rb +0 -752
  486. data/vendor/rails/actionpack/test/controller/flash_test.rb +0 -147
  487. data/vendor/rails/actionpack/test/controller/fragment_store_setting_test.rb +0 -45
  488. data/vendor/rails/actionpack/test/controller/helper_test.rb +0 -204
  489. data/vendor/rails/actionpack/test/controller/html-scanner/document_test.rb +0 -104
  490. data/vendor/rails/actionpack/test/controller/html-scanner/node_test.rb +0 -69
  491. data/vendor/rails/actionpack/test/controller/html-scanner/tag_node_test.rb +0 -239
  492. data/vendor/rails/actionpack/test/controller/html-scanner/text_node_test.rb +0 -51
  493. data/vendor/rails/actionpack/test/controller/html-scanner/tokenizer_test.rb +0 -125
  494. data/vendor/rails/actionpack/test/controller/http_authentication_test.rb +0 -42
  495. data/vendor/rails/actionpack/test/controller/integration_test.rb +0 -187
  496. data/vendor/rails/actionpack/test/controller/layout_test.rb +0 -202
  497. data/vendor/rails/actionpack/test/controller/mime_responds_test.rb +0 -358
  498. data/vendor/rails/actionpack/test/controller/mime_type_test.rb +0 -54
  499. data/vendor/rails/actionpack/test/controller/new_render_test.rb +0 -769
  500. data/vendor/rails/actionpack/test/controller/raw_post_test.rb +0 -74
  501. data/vendor/rails/actionpack/test/controller/record_identifier_test.rb +0 -103
  502. data/vendor/rails/actionpack/test/controller/redirect_test.rb +0 -180
  503. data/vendor/rails/actionpack/test/controller/render_test.rb +0 -404
  504. data/vendor/rails/actionpack/test/controller/request_test.rb +0 -393
  505. data/vendor/rails/actionpack/test/controller/rescue_test.rb +0 -215
  506. data/vendor/rails/actionpack/test/controller/resources_test.rb +0 -585
  507. data/vendor/rails/actionpack/test/controller/routing_test.rb +0 -1902
  508. data/vendor/rails/actionpack/test/controller/selector_test.rb +0 -628
  509. data/vendor/rails/actionpack/test/controller/send_file_test.rb +0 -127
  510. data/vendor/rails/actionpack/test/controller/session/cookie_store_test.rb +0 -228
  511. data/vendor/rails/actionpack/test/controller/session_management_test.rb +0 -156
  512. data/vendor/rails/actionpack/test/controller/test_test.rb +0 -520
  513. data/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +0 -218
  514. data/vendor/rails/actionpack/test/controller/verification_test.rb +0 -242
  515. data/vendor/rails/actionpack/test/controller/view_paths_test.rb +0 -79
  516. data/vendor/rails/actionpack/test/controller/webservice_test.rb +0 -181
  517. data/vendor/rails/actionpack/test/fixtures/addresses/list.erb +0 -1
  518. data/vendor/rails/actionpack/test/fixtures/addresses/list.rhtml +0 -0
  519. data/vendor/rails/actionpack/test/fixtures/companies.yml +0 -24
  520. data/vendor/rails/actionpack/test/fixtures/company.rb +0 -9
  521. data/vendor/rails/actionpack/test/fixtures/content_type/render_default_content_types_for_respond_to.rhtml +0 -1
  522. data/vendor/rails/actionpack/test/fixtures/content_type/render_default_for_rhtml.rhtml +0 -1
  523. data/vendor/rails/actionpack/test/fixtures/content_type/render_default_for_rjs.rjs +0 -1
  524. data/vendor/rails/actionpack/test/fixtures/content_type/render_default_for_rxml.rxml +0 -1
  525. data/vendor/rails/actionpack/test/fixtures/db_definitions/sqlite.sql +0 -42
  526. data/vendor/rails/actionpack/test/fixtures/developer.rb +0 -7
  527. data/vendor/rails/actionpack/test/fixtures/developers.yml +0 -21
  528. data/vendor/rails/actionpack/test/fixtures/developers_projects.yml +0 -13
  529. data/vendor/rails/actionpack/test/fixtures/fun/games/hello_world.erb +0 -1
  530. data/vendor/rails/actionpack/test/fixtures/fun/games/hello_world.rhtml +0 -0
  531. data/vendor/rails/actionpack/test/fixtures/helpers/abc_helper.rb +0 -5
  532. data/vendor/rails/actionpack/test/fixtures/helpers/fun/games_helper.rb +0 -3
  533. data/vendor/rails/actionpack/test/fixtures/helpers/fun/pdf_helper.rb +0 -3
  534. data/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/controller_name_space/nested.rhtml +0 -1
  535. data/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/item.rhtml +0 -1
  536. data/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/layout_test.rhtml +0 -1
  537. data/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/multiple_extensions.html.erb +0 -1
  538. data/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/third_party_template_library.mab +0 -1
  539. data/vendor/rails/actionpack/test/fixtures/layout_tests/views/hello.rhtml +0 -1
  540. data/vendor/rails/actionpack/test/fixtures/layouts/builder.builder +0 -3
  541. data/vendor/rails/actionpack/test/fixtures/layouts/builder.rxml +0 -0
  542. data/vendor/rails/actionpack/test/fixtures/layouts/standard.erb +0 -1
  543. data/vendor/rails/actionpack/test/fixtures/layouts/standard.rhtml +0 -0
  544. data/vendor/rails/actionpack/test/fixtures/layouts/talk_from_action.erb +0 -2
  545. data/vendor/rails/actionpack/test/fixtures/layouts/talk_from_action.rhtml +0 -0
  546. data/vendor/rails/actionpack/test/fixtures/layouts/yield.erb +0 -2
  547. data/vendor/rails/actionpack/test/fixtures/layouts/yield.rhtml +0 -0
  548. data/vendor/rails/actionpack/test/fixtures/multipart/binary_file +0 -0
  549. data/vendor/rails/actionpack/test/fixtures/multipart/large_text_file +0 -10
  550. data/vendor/rails/actionpack/test/fixtures/multipart/mixed_files +0 -0
  551. data/vendor/rails/actionpack/test/fixtures/multipart/mona_lisa.jpg +0 -0
  552. data/vendor/rails/actionpack/test/fixtures/multipart/single_parameter +0 -5
  553. data/vendor/rails/actionpack/test/fixtures/multipart/text_file +0 -10
  554. data/vendor/rails/actionpack/test/fixtures/override/test/hello_world.erb +0 -1
  555. data/vendor/rails/actionpack/test/fixtures/override/test/hello_world.rhtml +0 -0
  556. data/vendor/rails/actionpack/test/fixtures/project.rb +0 -3
  557. data/vendor/rails/actionpack/test/fixtures/projects.yml +0 -7
  558. data/vendor/rails/actionpack/test/fixtures/public/404.html +0 -1
  559. data/vendor/rails/actionpack/test/fixtures/public/500.html +0 -1
  560. data/vendor/rails/actionpack/test/fixtures/public/images/rails.png +0 -0
  561. data/vendor/rails/actionpack/test/fixtures/public/javascripts/application.js +0 -0
  562. data/vendor/rails/actionpack/test/fixtures/public/javascripts/bank.js +0 -1
  563. data/vendor/rails/actionpack/test/fixtures/public/javascripts/robber.js +0 -1
  564. data/vendor/rails/actionpack/test/fixtures/public/stylesheets/bank.css +0 -1
  565. data/vendor/rails/actionpack/test/fixtures/public/stylesheets/robber.css +0 -1
  566. data/vendor/rails/actionpack/test/fixtures/replies.yml +0 -13
  567. data/vendor/rails/actionpack/test/fixtures/reply.rb +0 -5
  568. data/vendor/rails/actionpack/test/fixtures/respond_to/all_types_with_layout.html.erb +0 -1
  569. data/vendor/rails/actionpack/test/fixtures/respond_to/all_types_with_layout.js.rjs +0 -1
  570. data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.rhtml +0 -1
  571. data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.html.erb +0 -1
  572. data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.js.rjs +0 -1
  573. data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.xml.builder +0 -1
  574. data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.html.erb +0 -1
  575. data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.js.rjs +0 -1
  576. data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder +0 -1
  577. data/vendor/rails/actionpack/test/fixtures/scope/test/modgreet.erb +0 -1
  578. data/vendor/rails/actionpack/test/fixtures/scope/test/modgreet.rhtml +0 -0
  579. data/vendor/rails/actionpack/test/fixtures/test/_customer.erb +0 -1
  580. data/vendor/rails/actionpack/test/fixtures/test/_customer.rhtml +0 -0
  581. data/vendor/rails/actionpack/test/fixtures/test/_customer_greeting.erb +0 -1
  582. data/vendor/rails/actionpack/test/fixtures/test/_customer_greeting.rhtml +0 -0
  583. data/vendor/rails/actionpack/test/fixtures/test/_hash_object.erb +0 -1
  584. data/vendor/rails/actionpack/test/fixtures/test/_hash_object.rhtml +0 -0
  585. data/vendor/rails/actionpack/test/fixtures/test/_hello.builder +0 -1
  586. data/vendor/rails/actionpack/test/fixtures/test/_hello.rxml +0 -0
  587. data/vendor/rails/actionpack/test/fixtures/test/_partial.erb +0 -1
  588. data/vendor/rails/actionpack/test/fixtures/test/_partial.html.erb +0 -1
  589. data/vendor/rails/actionpack/test/fixtures/test/_partial.js.erb +0 -1
  590. data/vendor/rails/actionpack/test/fixtures/test/_partial.rhtml +0 -0
  591. data/vendor/rails/actionpack/test/fixtures/test/_partial_only.erb +0 -1
  592. data/vendor/rails/actionpack/test/fixtures/test/_partial_only.rhtml +0 -0
  593. data/vendor/rails/actionpack/test/fixtures/test/_person.erb +0 -2
  594. data/vendor/rails/actionpack/test/fixtures/test/_person.rhtml +0 -0
  595. data/vendor/rails/actionpack/test/fixtures/test/action_talk_to_layout.erb +0 -2
  596. data/vendor/rails/actionpack/test/fixtures/test/action_talk_to_layout.rhtml +0 -0
  597. data/vendor/rails/actionpack/test/fixtures/test/block_content_for.erb +0 -2
  598. data/vendor/rails/actionpack/test/fixtures/test/block_content_for.rhtml +0 -0
  599. data/vendor/rails/actionpack/test/fixtures/test/capturing.erb +0 -4
  600. data/vendor/rails/actionpack/test/fixtures/test/capturing.rhtml +0 -0
  601. data/vendor/rails/actionpack/test/fixtures/test/content_for.erb +0 -2
  602. data/vendor/rails/actionpack/test/fixtures/test/content_for.rhtml +0 -0
  603. data/vendor/rails/actionpack/test/fixtures/test/delete_with_js.rjs +0 -2
  604. data/vendor/rails/actionpack/test/fixtures/test/dot.directory/render_file_with_ivar.erb +0 -1
  605. data/vendor/rails/actionpack/test/fixtures/test/dot.directory/render_file_with_ivar.rhtml +0 -0
  606. data/vendor/rails/actionpack/test/fixtures/test/enum_rjs_test.rjs +0 -6
  607. data/vendor/rails/actionpack/test/fixtures/test/erb_content_for.erb +0 -2
  608. data/vendor/rails/actionpack/test/fixtures/test/erb_content_for.rhtml +0 -0
  609. data/vendor/rails/actionpack/test/fixtures/test/formatted_html_erb.html.erb +0 -1
  610. data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.builder +0 -1
  611. data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.html.erb +0 -1
  612. data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.xml.erb +0 -1
  613. data/vendor/rails/actionpack/test/fixtures/test/greeting.erb +0 -1
  614. data/vendor/rails/actionpack/test/fixtures/test/greeting.rhtml +0 -0
  615. data/vendor/rails/actionpack/test/fixtures/test/hello.builder +0 -4
  616. data/vendor/rails/actionpack/test/fixtures/test/hello.rxml +0 -0
  617. data/vendor/rails/actionpack/test/fixtures/test/hello_world.builder +0 -4
  618. data/vendor/rails/actionpack/test/fixtures/test/hello_world.erb +0 -1
  619. data/vendor/rails/actionpack/test/fixtures/test/hello_world.rhtml +0 -0
  620. data/vendor/rails/actionpack/test/fixtures/test/hello_world.rxml +0 -0
  621. data/vendor/rails/actionpack/test/fixtures/test/hello_world_container.builder +0 -3
  622. data/vendor/rails/actionpack/test/fixtures/test/hello_world_container.rxml +0 -0
  623. data/vendor/rails/actionpack/test/fixtures/test/hello_world_with_layout_false.erb +0 -1
  624. data/vendor/rails/actionpack/test/fixtures/test/hello_world_with_layout_false.rhtml +0 -0
  625. data/vendor/rails/actionpack/test/fixtures/test/hello_xml_world.builder +0 -11
  626. data/vendor/rails/actionpack/test/fixtures/test/hello_xml_world.rxml +0 -0
  627. data/vendor/rails/actionpack/test/fixtures/test/list.erb +0 -1
  628. data/vendor/rails/actionpack/test/fixtures/test/list.rhtml +0 -0
  629. data/vendor/rails/actionpack/test/fixtures/test/non_erb_block_content_for.builder +0 -4
  630. data/vendor/rails/actionpack/test/fixtures/test/non_erb_block_content_for.rxml +0 -0
  631. data/vendor/rails/actionpack/test/fixtures/test/potential_conflicts.erb +0 -4
  632. data/vendor/rails/actionpack/test/fixtures/test/potential_conflicts.rhtml +0 -0
  633. data/vendor/rails/actionpack/test/fixtures/test/render_file_with_ivar.erb +0 -1
  634. data/vendor/rails/actionpack/test/fixtures/test/render_file_with_ivar.rhtml +0 -0
  635. data/vendor/rails/actionpack/test/fixtures/test/render_file_with_locals.erb +0 -1
  636. data/vendor/rails/actionpack/test/fixtures/test/render_file_with_locals.rhtml +0 -0
  637. data/vendor/rails/actionpack/test/fixtures/test/render_to_string_test.erb +0 -1
  638. data/vendor/rails/actionpack/test/fixtures/test/render_to_string_test.rhtml +0 -0
  639. data/vendor/rails/actionpack/test/fixtures/test/update_element_with_capture.erb +0 -9
  640. data/vendor/rails/actionpack/test/fixtures/test/update_element_with_capture.rhtml +0 -0
  641. data/vendor/rails/actionpack/test/fixtures/topic.rb +0 -3
  642. data/vendor/rails/actionpack/test/fixtures/topics.yml +0 -22
  643. data/vendor/rails/actionpack/test/template/active_record_helper_test.rb +0 -197
  644. data/vendor/rails/actionpack/test/template/asset_tag_helper_test.rb +0 -367
  645. data/vendor/rails/actionpack/test/template/benchmark_helper_test.rb +0 -72
  646. data/vendor/rails/actionpack/test/template/compiled_templates_test.rb +0 -168
  647. data/vendor/rails/actionpack/test/template/date_helper_test.rb +0 -1394
  648. data/vendor/rails/actionpack/test/template/form_helper_test.rb +0 -611
  649. data/vendor/rails/actionpack/test/template/form_options_helper_test.rb +0 -489
  650. data/vendor/rails/actionpack/test/template/form_tag_helper_test.rb +0 -149
  651. data/vendor/rails/actionpack/test/template/java_script_macros_helper_test.rb +0 -109
  652. data/vendor/rails/actionpack/test/template/javascript_helper_test.rb +0 -67
  653. data/vendor/rails/actionpack/test/template/number_helper_test.rb +0 -89
  654. data/vendor/rails/actionpack/test/template/prototype_helper_test.rb +0 -556
  655. data/vendor/rails/actionpack/test/template/scriptaculous_helper_test.rb +0 -90
  656. data/vendor/rails/actionpack/test/template/tag_helper_test.rb +0 -74
  657. data/vendor/rails/actionpack/test/template/text_helper_test.rb +0 -356
  658. data/vendor/rails/actionpack/test/template/url_helper_test.rb +0 -423
  659. data/vendor/rails/actionpack/test/testing_sandbox.rb +0 -11
  660. data/vendor/rails/actionwebservice/CHANGELOG +0 -265
  661. data/vendor/rails/actionwebservice/MIT-LICENSE +0 -21
  662. data/vendor/rails/actionwebservice/README +0 -364
  663. data/vendor/rails/actionwebservice/Rakefile +0 -171
  664. data/vendor/rails/actionwebservice/TODO +0 -32
  665. data/vendor/rails/actionwebservice/examples/googlesearch/README +0 -143
  666. data/vendor/rails/actionwebservice/examples/googlesearch/autoloading/google_search_api.rb +0 -50
  667. data/vendor/rails/actionwebservice/examples/googlesearch/autoloading/google_search_controller.rb +0 -57
  668. data/vendor/rails/actionwebservice/examples/googlesearch/delegated/google_search_service.rb +0 -108
  669. data/vendor/rails/actionwebservice/examples/googlesearch/delegated/search_controller.rb +0 -7
  670. data/vendor/rails/actionwebservice/examples/googlesearch/direct/google_search_api.rb +0 -50
  671. data/vendor/rails/actionwebservice/examples/googlesearch/direct/search_controller.rb +0 -58
  672. data/vendor/rails/actionwebservice/examples/metaWeblog/README +0 -17
  673. data/vendor/rails/actionwebservice/examples/metaWeblog/apis/blogger_api.rb +0 -60
  674. data/vendor/rails/actionwebservice/examples/metaWeblog/apis/blogger_service.rb +0 -34
  675. data/vendor/rails/actionwebservice/examples/metaWeblog/apis/meta_weblog_api.rb +0 -67
  676. data/vendor/rails/actionwebservice/examples/metaWeblog/apis/meta_weblog_service.rb +0 -48
  677. data/vendor/rails/actionwebservice/examples/metaWeblog/controllers/xmlrpc_controller.rb +0 -16
  678. data/vendor/rails/actionwebservice/install.rb +0 -30
  679. data/vendor/rails/actionwebservice/lib/action_web_service.rb +0 -66
  680. data/vendor/rails/actionwebservice/lib/action_web_service/api.rb +0 -301
  681. data/vendor/rails/actionwebservice/lib/action_web_service/base.rb +0 -42
  682. data/vendor/rails/actionwebservice/lib/action_web_service/casting.rb +0 -138
  683. data/vendor/rails/actionwebservice/lib/action_web_service/client.rb +0 -3
  684. data/vendor/rails/actionwebservice/lib/action_web_service/client/base.rb +0 -28
  685. data/vendor/rails/actionwebservice/lib/action_web_service/client/soap_client.rb +0 -113
  686. data/vendor/rails/actionwebservice/lib/action_web_service/client/xmlrpc_client.rb +0 -58
  687. data/vendor/rails/actionwebservice/lib/action_web_service/container.rb +0 -3
  688. data/vendor/rails/actionwebservice/lib/action_web_service/container/action_controller_container.rb +0 -93
  689. data/vendor/rails/actionwebservice/lib/action_web_service/container/delegated_container.rb +0 -86
  690. data/vendor/rails/actionwebservice/lib/action_web_service/container/direct_container.rb +0 -69
  691. data/vendor/rails/actionwebservice/lib/action_web_service/dispatcher.rb +0 -2
  692. data/vendor/rails/actionwebservice/lib/action_web_service/dispatcher/abstract.rb +0 -207
  693. data/vendor/rails/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb +0 -379
  694. data/vendor/rails/actionwebservice/lib/action_web_service/invocation.rb +0 -202
  695. data/vendor/rails/actionwebservice/lib/action_web_service/protocol.rb +0 -4
  696. data/vendor/rails/actionwebservice/lib/action_web_service/protocol/abstract.rb +0 -112
  697. data/vendor/rails/actionwebservice/lib/action_web_service/protocol/discovery.rb +0 -37
  698. data/vendor/rails/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb +0 -176
  699. data/vendor/rails/actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb +0 -235
  700. data/vendor/rails/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb +0 -122
  701. data/vendor/rails/actionwebservice/lib/action_web_service/scaffolding.rb +0 -283
  702. data/vendor/rails/actionwebservice/lib/action_web_service/struct.rb +0 -68
  703. data/vendor/rails/actionwebservice/lib/action_web_service/support/class_inheritable_options.rb +0 -26
  704. data/vendor/rails/actionwebservice/lib/action_web_service/support/signature_types.rb +0 -226
  705. data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/layout.erb +0 -65
  706. data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/layout.rhtml +0 -0
  707. data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/methods.erb +0 -6
  708. data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/methods.rhtml +0 -0
  709. data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/parameters.erb +0 -29
  710. data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/parameters.rhtml +0 -0
  711. data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/result.erb +0 -30
  712. data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/result.rhtml +0 -0
  713. data/vendor/rails/actionwebservice/lib/action_web_service/test_invoke.rb +0 -110
  714. data/vendor/rails/actionwebservice/lib/action_web_service/version.rb +0 -9
  715. data/vendor/rails/actionwebservice/setup.rb +0 -1379
  716. data/vendor/rails/actionwebservice/test/abstract_client.rb +0 -183
  717. data/vendor/rails/actionwebservice/test/abstract_dispatcher.rb +0 -551
  718. data/vendor/rails/actionwebservice/test/abstract_unit.rb +0 -45
  719. data/vendor/rails/actionwebservice/test/api_test.rb +0 -102
  720. data/vendor/rails/actionwebservice/test/apis/auto_load_api.rb +0 -3
  721. data/vendor/rails/actionwebservice/test/apis/broken_auto_load_api.rb +0 -2
  722. data/vendor/rails/actionwebservice/test/base_test.rb +0 -42
  723. data/vendor/rails/actionwebservice/test/casting_test.rb +0 -86
  724. data/vendor/rails/actionwebservice/test/client_soap_test.rb +0 -153
  725. data/vendor/rails/actionwebservice/test/client_xmlrpc_test.rb +0 -152
  726. data/vendor/rails/actionwebservice/test/container_test.rb +0 -73
  727. data/vendor/rails/actionwebservice/test/dispatcher_action_controller_soap_test.rb +0 -137
  728. data/vendor/rails/actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb +0 -59
  729. data/vendor/rails/actionwebservice/test/fixtures/db_definitions/mysql.sql +0 -8
  730. data/vendor/rails/actionwebservice/test/fixtures/users.yml +0 -12
  731. data/vendor/rails/actionwebservice/test/gencov +0 -3
  732. data/vendor/rails/actionwebservice/test/invocation_test.rb +0 -185
  733. data/vendor/rails/actionwebservice/test/run +0 -6
  734. data/vendor/rails/actionwebservice/test/scaffolded_controller_test.rb +0 -146
  735. data/vendor/rails/actionwebservice/test/struct_test.rb +0 -52
  736. data/vendor/rails/actionwebservice/test/test_invoke_test.rb +0 -112
  737. data/vendor/rails/activerecord/CHANGELOG +0 -3195
  738. data/vendor/rails/activerecord/MIT-LICENSE +0 -20
  739. data/vendor/rails/activerecord/README +0 -360
  740. data/vendor/rails/activerecord/RUNNING_UNIT_TESTS +0 -64
  741. data/vendor/rails/activerecord/Rakefile +0 -223
  742. data/vendor/rails/activerecord/benchmarks/benchmark.rb +0 -26
  743. data/vendor/rails/activerecord/benchmarks/mysql_benchmark.rb +0 -19
  744. data/vendor/rails/activerecord/examples/associations.png +0 -0
  745. data/vendor/rails/activerecord/examples/associations.rb +0 -87
  746. data/vendor/rails/activerecord/examples/shared_setup.rb +0 -15
  747. data/vendor/rails/activerecord/examples/validation.rb +0 -85
  748. data/vendor/rails/activerecord/install.rb +0 -30
  749. data/vendor/rails/activerecord/lib/active_record.rb +0 -85
  750. data/vendor/rails/activerecord/lib/active_record/acts/list.rb +0 -253
  751. data/vendor/rails/activerecord/lib/active_record/acts/nested_set.rb +0 -211
  752. data/vendor/rails/activerecord/lib/active_record/acts/tree.rb +0 -96
  753. data/vendor/rails/activerecord/lib/active_record/aggregations.rb +0 -191
  754. data/vendor/rails/activerecord/lib/active_record/associations.rb +0 -1701
  755. data/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb +0 -212
  756. data/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb +0 -162
  757. data/vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb +0 -56
  758. data/vendor/rails/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb +0 -50
  759. data/vendor/rails/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +0 -163
  760. data/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb +0 -196
  761. data/vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb +0 -245
  762. data/vendor/rails/activerecord/lib/active_record/associations/has_one_association.rb +0 -96
  763. data/vendor/rails/activerecord/lib/active_record/attribute_methods.rb +0 -75
  764. data/vendor/rails/activerecord/lib/active_record/base.rb +0 -2276
  765. data/vendor/rails/activerecord/lib/active_record/calculations.rb +0 -274
  766. data/vendor/rails/activerecord/lib/active_record/callbacks.rb +0 -371
  767. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +0 -279
  768. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +0 -135
  769. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +0 -61
  770. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +0 -393
  771. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +0 -303
  772. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +0 -157
  773. data/vendor/rails/activerecord/lib/active_record/connection_adapters/db2_adapter.rb +0 -228
  774. data/vendor/rails/activerecord/lib/active_record/connection_adapters/firebird_adapter.rb +0 -728
  775. data/vendor/rails/activerecord/lib/active_record/connection_adapters/frontbase_adapter.rb +0 -863
  776. data/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +0 -421
  777. data/vendor/rails/activerecord/lib/active_record/connection_adapters/openbase_adapter.rb +0 -349
  778. data/vendor/rails/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb +0 -710
  779. data/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +0 -582
  780. data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +0 -415
  781. data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb +0 -606
  782. data/vendor/rails/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb +0 -666
  783. data/vendor/rails/activerecord/lib/active_record/deprecated_associations.rb +0 -104
  784. data/vendor/rails/activerecord/lib/active_record/deprecated_finders.rb +0 -44
  785. data/vendor/rails/activerecord/lib/active_record/fixtures.rb +0 -639
  786. data/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb +0 -137
  787. data/vendor/rails/activerecord/lib/active_record/locking/pessimistic.rb +0 -77
  788. data/vendor/rails/activerecord/lib/active_record/migration.rb +0 -393
  789. data/vendor/rails/activerecord/lib/active_record/observer.rb +0 -178
  790. data/vendor/rails/activerecord/lib/active_record/query_cache.rb +0 -111
  791. data/vendor/rails/activerecord/lib/active_record/reflection.rb +0 -219
  792. data/vendor/rails/activerecord/lib/active_record/schema.rb +0 -58
  793. data/vendor/rails/activerecord/lib/active_record/schema_dumper.rb +0 -164
  794. data/vendor/rails/activerecord/lib/active_record/timestamp.rb +0 -50
  795. data/vendor/rails/activerecord/lib/active_record/transactions.rb +0 -128
  796. data/vendor/rails/activerecord/lib/active_record/validations.rb +0 -902
  797. data/vendor/rails/activerecord/lib/active_record/vendor/db2.rb +0 -362
  798. data/vendor/rails/activerecord/lib/active_record/vendor/mysql.rb +0 -1214
  799. data/vendor/rails/activerecord/lib/active_record/version.rb +0 -9
  800. data/vendor/rails/activerecord/lib/active_record/wrappers/yaml_wrapper.rb +0 -15
  801. data/vendor/rails/activerecord/lib/active_record/wrappings.rb +0 -58
  802. data/vendor/rails/activerecord/lib/active_record/xml_serialization.rb +0 -327
  803. data/vendor/rails/activerecord/test/aaa_create_tables_test.rb +0 -59
  804. data/vendor/rails/activerecord/test/abstract_unit.rb +0 -79
  805. data/vendor/rails/activerecord/test/active_schema_test_mysql.rb +0 -31
  806. data/vendor/rails/activerecord/test/adapter_test.rb +0 -87
  807. data/vendor/rails/activerecord/test/adapter_test_sqlserver.rb +0 -95
  808. data/vendor/rails/activerecord/test/aggregations_test.rb +0 -95
  809. data/vendor/rails/activerecord/test/all.sh +0 -8
  810. data/vendor/rails/activerecord/test/ar_schema_test.rb +0 -33
  811. data/vendor/rails/activerecord/test/association_inheritance_reload.rb +0 -14
  812. data/vendor/rails/activerecord/test/associations/callbacks_test.rb +0 -126
  813. data/vendor/rails/activerecord/test/associations/cascaded_eager_loading_test.rb +0 -138
  814. data/vendor/rails/activerecord/test/associations/eager_singularization_test.rb +0 -145
  815. data/vendor/rails/activerecord/test/associations/eager_test.rb +0 -393
  816. data/vendor/rails/activerecord/test/associations/extension_test.rb +0 -42
  817. data/vendor/rails/activerecord/test/associations/join_model_test.rb +0 -497
  818. data/vendor/rails/activerecord/test/associations_test.rb +0 -1880
  819. data/vendor/rails/activerecord/test/attribute_methods_test.rb +0 -49
  820. data/vendor/rails/activerecord/test/base_test.rb +0 -1656
  821. data/vendor/rails/activerecord/test/binary_test.rb +0 -37
  822. data/vendor/rails/activerecord/test/calculations_test.rb +0 -219
  823. data/vendor/rails/activerecord/test/callbacks_test.rb +0 -400
  824. data/vendor/rails/activerecord/test/class_inheritable_attributes_test.rb +0 -32
  825. data/vendor/rails/activerecord/test/column_alias_test.rb +0 -17
  826. data/vendor/rails/activerecord/test/connection_test_firebird.rb +0 -8
  827. data/vendor/rails/activerecord/test/connections/native_db2/connection.rb +0 -25
  828. data/vendor/rails/activerecord/test/connections/native_firebird/connection.rb +0 -26
  829. data/vendor/rails/activerecord/test/connections/native_frontbase/connection.rb +0 -27
  830. data/vendor/rails/activerecord/test/connections/native_mysql/connection.rb +0 -27
  831. data/vendor/rails/activerecord/test/connections/native_openbase/connection.rb +0 -21
  832. data/vendor/rails/activerecord/test/connections/native_oracle/connection.rb +0 -27
  833. data/vendor/rails/activerecord/test/connections/native_postgresql/connection.rb +0 -23
  834. data/vendor/rails/activerecord/test/connections/native_sqlite/connection.rb +0 -25
  835. data/vendor/rails/activerecord/test/connections/native_sqlite3/connection.rb +0 -25
  836. data/vendor/rails/activerecord/test/connections/native_sqlite3/in_memory_connection.rb +0 -18
  837. data/vendor/rails/activerecord/test/connections/native_sqlserver/connection.rb +0 -23
  838. data/vendor/rails/activerecord/test/connections/native_sqlserver_odbc/connection.rb +0 -25
  839. data/vendor/rails/activerecord/test/connections/native_sybase/connection.rb +0 -23
  840. data/vendor/rails/activerecord/test/copy_table_test_sqlite.rb +0 -65
  841. data/vendor/rails/activerecord/test/datatype_test_postgresql.rb +0 -52
  842. data/vendor/rails/activerecord/test/default_test_firebird.rb +0 -16
  843. data/vendor/rails/activerecord/test/defaults_test.rb +0 -60
  844. data/vendor/rails/activerecord/test/deprecated_associations_test.rb +0 -396
  845. data/vendor/rails/activerecord/test/deprecated_finder_test.rb +0 -151
  846. data/vendor/rails/activerecord/test/empty_date_time_test.rb +0 -25
  847. data/vendor/rails/activerecord/test/finder_test.rb +0 -523
  848. data/vendor/rails/activerecord/test/fixtures/accounts.yml +0 -28
  849. data/vendor/rails/activerecord/test/fixtures/all/developers.yml +0 -0
  850. data/vendor/rails/activerecord/test/fixtures/all/people.csv +0 -0
  851. data/vendor/rails/activerecord/test/fixtures/all/tasks.yml +0 -0
  852. data/vendor/rails/activerecord/test/fixtures/author.rb +0 -99
  853. data/vendor/rails/activerecord/test/fixtures/author_favorites.yml +0 -4
  854. data/vendor/rails/activerecord/test/fixtures/authors.yml +0 -7
  855. data/vendor/rails/activerecord/test/fixtures/auto_id.rb +0 -4
  856. data/vendor/rails/activerecord/test/fixtures/bad_fixtures/attr_with_numeric_first_char +0 -1
  857. data/vendor/rails/activerecord/test/fixtures/bad_fixtures/attr_with_spaces +0 -1
  858. data/vendor/rails/activerecord/test/fixtures/bad_fixtures/blank_line +0 -3
  859. data/vendor/rails/activerecord/test/fixtures/bad_fixtures/duplicate_attributes +0 -3
  860. data/vendor/rails/activerecord/test/fixtures/bad_fixtures/missing_value +0 -1
  861. data/vendor/rails/activerecord/test/fixtures/binary.rb +0 -2
  862. data/vendor/rails/activerecord/test/fixtures/categories.yml +0 -14
  863. data/vendor/rails/activerecord/test/fixtures/categories/special_categories.yml +0 -9
  864. data/vendor/rails/activerecord/test/fixtures/categories/subsubdir/arbitrary_filename.yml +0 -4
  865. data/vendor/rails/activerecord/test/fixtures/categories_ordered.yml +0 -7
  866. data/vendor/rails/activerecord/test/fixtures/categories_posts.yml +0 -23
  867. data/vendor/rails/activerecord/test/fixtures/categorization.rb +0 -5
  868. data/vendor/rails/activerecord/test/fixtures/categorizations.yml +0 -17
  869. data/vendor/rails/activerecord/test/fixtures/category.rb +0 -20
  870. data/vendor/rails/activerecord/test/fixtures/column_name.rb +0 -3
  871. data/vendor/rails/activerecord/test/fixtures/comment.rb +0 -23
  872. data/vendor/rails/activerecord/test/fixtures/comments.yml +0 -59
  873. data/vendor/rails/activerecord/test/fixtures/companies.yml +0 -55
  874. data/vendor/rails/activerecord/test/fixtures/company.rb +0 -111
  875. data/vendor/rails/activerecord/test/fixtures/company_in_module.rb +0 -59
  876. data/vendor/rails/activerecord/test/fixtures/computer.rb +0 -3
  877. data/vendor/rails/activerecord/test/fixtures/computers.yml +0 -4
  878. data/vendor/rails/activerecord/test/fixtures/course.rb +0 -3
  879. data/vendor/rails/activerecord/test/fixtures/courses.yml +0 -7
  880. data/vendor/rails/activerecord/test/fixtures/customer.rb +0 -55
  881. data/vendor/rails/activerecord/test/fixtures/customers.yml +0 -17
  882. data/vendor/rails/activerecord/test/fixtures/db_definitions/db2.drop.sql +0 -32
  883. data/vendor/rails/activerecord/test/fixtures/db_definitions/db2.sql +0 -231
  884. data/vendor/rails/activerecord/test/fixtures/db_definitions/db22.drop.sql +0 -2
  885. data/vendor/rails/activerecord/test/fixtures/db_definitions/db22.sql +0 -5
  886. data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird.drop.sql +0 -63
  887. data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird.sql +0 -304
  888. data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird2.drop.sql +0 -2
  889. data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird2.sql +0 -6
  890. data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase.drop.sql +0 -32
  891. data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase.sql +0 -268
  892. data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase2.drop.sql +0 -1
  893. data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase2.sql +0 -4
  894. data/vendor/rails/activerecord/test/fixtures/db_definitions/mysql.drop.sql +0 -32
  895. data/vendor/rails/activerecord/test/fixtures/db_definitions/mysql.sql +0 -234
  896. data/vendor/rails/activerecord/test/fixtures/db_definitions/mysql2.drop.sql +0 -2
  897. data/vendor/rails/activerecord/test/fixtures/db_definitions/mysql2.sql +0 -5
  898. data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase.drop.sql +0 -2
  899. data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase.sql +0 -302
  900. data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase2.drop.sql +0 -2
  901. data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase2.sql +0 -7
  902. data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle.drop.sql +0 -65
  903. data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle.sql +0 -325
  904. data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle2.drop.sql +0 -2
  905. data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle2.sql +0 -6
  906. data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql.drop.sql +0 -37
  907. data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql.sql +0 -247
  908. data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql2.drop.sql +0 -2
  909. data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql2.sql +0 -4
  910. data/vendor/rails/activerecord/test/fixtures/db_definitions/schema.rb +0 -74
  911. data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite.drop.sql +0 -32
  912. data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite.sql +0 -215
  913. data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite2.drop.sql +0 -2
  914. data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite2.sql +0 -5
  915. data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlserver.drop.sql +0 -34
  916. data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlserver.sql +0 -243
  917. data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlserver2.drop.sql +0 -2
  918. data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlserver2.sql +0 -5
  919. data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase.drop.sql +0 -34
  920. data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase.sql +0 -218
  921. data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase2.drop.sql +0 -4
  922. data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase2.sql +0 -5
  923. data/vendor/rails/activerecord/test/fixtures/default.rb +0 -2
  924. data/vendor/rails/activerecord/test/fixtures/developer.rb +0 -52
  925. data/vendor/rails/activerecord/test/fixtures/developers.yml +0 -21
  926. data/vendor/rails/activerecord/test/fixtures/developers_projects.yml +0 -17
  927. data/vendor/rails/activerecord/test/fixtures/developers_projects/david_action_controller +0 -3
  928. data/vendor/rails/activerecord/test/fixtures/developers_projects/david_active_record +0 -3
  929. data/vendor/rails/activerecord/test/fixtures/developers_projects/jamis_active_record +0 -2
  930. data/vendor/rails/activerecord/test/fixtures/edge.rb +0 -5
  931. data/vendor/rails/activerecord/test/fixtures/edges.yml +0 -6
  932. data/vendor/rails/activerecord/test/fixtures/entrant.rb +0 -3
  933. data/vendor/rails/activerecord/test/fixtures/entrants.yml +0 -14
  934. data/vendor/rails/activerecord/test/fixtures/fk_test_has_fk.yml +0 -3
  935. data/vendor/rails/activerecord/test/fixtures/fk_test_has_pk.yml +0 -2
  936. data/vendor/rails/activerecord/test/fixtures/flowers.jpg +0 -0
  937. data/vendor/rails/activerecord/test/fixtures/funny_jokes.yml +0 -10
  938. data/vendor/rails/activerecord/test/fixtures/joke.rb +0 -6
  939. data/vendor/rails/activerecord/test/fixtures/keyboard.rb +0 -3
  940. data/vendor/rails/activerecord/test/fixtures/legacy_thing.rb +0 -3
  941. data/vendor/rails/activerecord/test/fixtures/legacy_things.yml +0 -3
  942. data/vendor/rails/activerecord/test/fixtures/migrations/1_people_have_last_names.rb +0 -9
  943. data/vendor/rails/activerecord/test/fixtures/migrations/2_we_need_reminders.rb +0 -12
  944. data/vendor/rails/activerecord/test/fixtures/migrations/3_innocent_jointable.rb +0 -12
  945. data/vendor/rails/activerecord/test/fixtures/migrations_with_decimal/1_give_me_big_numbers.rb +0 -15
  946. data/vendor/rails/activerecord/test/fixtures/migrations_with_duplicate/1_people_have_last_names.rb +0 -9
  947. data/vendor/rails/activerecord/test/fixtures/migrations_with_duplicate/2_we_need_reminders.rb +0 -12
  948. data/vendor/rails/activerecord/test/fixtures/migrations_with_duplicate/3_foo.rb +0 -7
  949. data/vendor/rails/activerecord/test/fixtures/migrations_with_duplicate/3_innocent_jointable.rb +0 -12
  950. data/vendor/rails/activerecord/test/fixtures/migrations_with_missing_versions/1000_people_have_middle_names.rb +0 -9
  951. data/vendor/rails/activerecord/test/fixtures/migrations_with_missing_versions/1_people_have_last_names.rb +0 -9
  952. data/vendor/rails/activerecord/test/fixtures/migrations_with_missing_versions/3_we_need_reminders.rb +0 -12
  953. data/vendor/rails/activerecord/test/fixtures/migrations_with_missing_versions/4_innocent_jointable.rb +0 -12
  954. data/vendor/rails/activerecord/test/fixtures/mixed_case_monkey.rb +0 -3
  955. data/vendor/rails/activerecord/test/fixtures/mixed_case_monkeys.yml +0 -6
  956. data/vendor/rails/activerecord/test/fixtures/mixin.rb +0 -63
  957. data/vendor/rails/activerecord/test/fixtures/mixins.yml +0 -127
  958. data/vendor/rails/activerecord/test/fixtures/movie.rb +0 -5
  959. data/vendor/rails/activerecord/test/fixtures/movies.yml +0 -7
  960. data/vendor/rails/activerecord/test/fixtures/naked/csv/accounts.csv +0 -1
  961. data/vendor/rails/activerecord/test/fixtures/naked/yml/accounts.yml +0 -1
  962. data/vendor/rails/activerecord/test/fixtures/naked/yml/companies.yml +0 -1
  963. data/vendor/rails/activerecord/test/fixtures/naked/yml/courses.yml +0 -1
  964. data/vendor/rails/activerecord/test/fixtures/order.rb +0 -4
  965. data/vendor/rails/activerecord/test/fixtures/people.yml +0 -3
  966. data/vendor/rails/activerecord/test/fixtures/person.rb +0 -4
  967. data/vendor/rails/activerecord/test/fixtures/post.rb +0 -58
  968. data/vendor/rails/activerecord/test/fixtures/posts.yml +0 -48
  969. data/vendor/rails/activerecord/test/fixtures/project.rb +0 -27
  970. data/vendor/rails/activerecord/test/fixtures/projects.yml +0 -7
  971. data/vendor/rails/activerecord/test/fixtures/reader.rb +0 -4
  972. data/vendor/rails/activerecord/test/fixtures/readers.yml +0 -4
  973. data/vendor/rails/activerecord/test/fixtures/reply.rb +0 -37
  974. data/vendor/rails/activerecord/test/fixtures/subject.rb +0 -4
  975. data/vendor/rails/activerecord/test/fixtures/subscriber.rb +0 -6
  976. data/vendor/rails/activerecord/test/fixtures/subscribers/first +0 -2
  977. data/vendor/rails/activerecord/test/fixtures/subscribers/second +0 -2
  978. data/vendor/rails/activerecord/test/fixtures/tag.rb +0 -7
  979. data/vendor/rails/activerecord/test/fixtures/tagging.rb +0 -6
  980. data/vendor/rails/activerecord/test/fixtures/taggings.yml +0 -18
  981. data/vendor/rails/activerecord/test/fixtures/tags.yml +0 -7
  982. data/vendor/rails/activerecord/test/fixtures/task.rb +0 -3
  983. data/vendor/rails/activerecord/test/fixtures/tasks.yml +0 -7
  984. data/vendor/rails/activerecord/test/fixtures/topic.rb +0 -25
  985. data/vendor/rails/activerecord/test/fixtures/topics.yml +0 -22
  986. data/vendor/rails/activerecord/test/fixtures/vertex.rb +0 -9
  987. data/vendor/rails/activerecord/test/fixtures/vertices.yml +0 -4
  988. data/vendor/rails/activerecord/test/fixtures_test.rb +0 -410
  989. data/vendor/rails/activerecord/test/inheritance_test.rb +0 -212
  990. data/vendor/rails/activerecord/test/lifecycle_test.rb +0 -137
  991. data/vendor/rails/activerecord/test/locking_test.rb +0 -241
  992. data/vendor/rails/activerecord/test/method_scoping_test.rb +0 -416
  993. data/vendor/rails/activerecord/test/migration_test.rb +0 -781
  994. data/vendor/rails/activerecord/test/migration_test_firebird.rb +0 -124
  995. data/vendor/rails/activerecord/test/mixin_nested_set_test.rb +0 -196
  996. data/vendor/rails/activerecord/test/mixin_test.rb +0 -550
  997. data/vendor/rails/activerecord/test/modules_test.rb +0 -34
  998. data/vendor/rails/activerecord/test/multiple_db_test.rb +0 -60
  999. data/vendor/rails/activerecord/test/pk_test.rb +0 -101
  1000. data/vendor/rails/activerecord/test/query_cache_test.rb +0 -107
  1001. data/vendor/rails/activerecord/test/readonly_test.rb +0 -107
  1002. data/vendor/rails/activerecord/test/reflection_test.rb +0 -166
  1003. data/vendor/rails/activerecord/test/schema_authorization_test_postgresql.rb +0 -75
  1004. data/vendor/rails/activerecord/test/schema_dumper_test.rb +0 -124
  1005. data/vendor/rails/activerecord/test/schema_test_postgresql.rb +0 -64
  1006. data/vendor/rails/activerecord/test/synonym_test_oracle.rb +0 -17
  1007. data/vendor/rails/activerecord/test/table_name_test_sqlserver.rb +0 -23
  1008. data/vendor/rails/activerecord/test/threaded_connections_test.rb +0 -48
  1009. data/vendor/rails/activerecord/test/transactions_test.rb +0 -268
  1010. data/vendor/rails/activerecord/test/unconnected_test.rb +0 -32
  1011. data/vendor/rails/activerecord/test/validations_test.rb +0 -1131
  1012. data/vendor/rails/activerecord/test/xml_serialization_test.rb +0 -153
  1013. data/vendor/rails/activeresource/CHANGELOG +0 -177
  1014. data/vendor/rails/activeresource/MIT-LICENSE +0 -20
  1015. data/vendor/rails/activeresource/README +0 -235
  1016. data/vendor/rails/activeresource/Rakefile +0 -132
  1017. data/vendor/rails/activeresource/lib/active_resource.rb +0 -47
  1018. data/vendor/rails/activeresource/lib/active_resource/base.rb +0 -424
  1019. data/vendor/rails/activeresource/lib/active_resource/connection.rb +0 -161
  1020. data/vendor/rails/activeresource/lib/active_resource/custom_methods.rb +0 -104
  1021. data/vendor/rails/activeresource/lib/active_resource/http_mock.rb +0 -131
  1022. data/vendor/rails/activeresource/lib/active_resource/struct.rb +0 -16
  1023. data/vendor/rails/activeresource/lib/active_resource/validations.rb +0 -161
  1024. data/vendor/rails/activeresource/lib/active_resource/version.rb +0 -9
  1025. data/vendor/rails/activeresource/test/abstract_unit.rb +0 -10
  1026. data/vendor/rails/activeresource/test/authorization_test.rb +0 -82
  1027. data/vendor/rails/activeresource/test/base/custom_methods_test.rb +0 -87
  1028. data/vendor/rails/activeresource/test/base/equality_test.rb +0 -43
  1029. data/vendor/rails/activeresource/test/base/load_test.rb +0 -111
  1030. data/vendor/rails/activeresource/test/base_errors_test.rb +0 -35
  1031. data/vendor/rails/activeresource/test/base_test.rb +0 -390
  1032. data/vendor/rails/activeresource/test/connection_test.rb +0 -148
  1033. data/vendor/rails/activeresource/test/fixtures/beast.rb +0 -14
  1034. data/vendor/rails/activeresource/test/fixtures/person.rb +0 -3
  1035. data/vendor/rails/activeresource/test/fixtures/street_address.rb +0 -4
  1036. data/vendor/rails/activeresource/test/setter_trap.rb +0 -29
  1037. data/vendor/rails/activesupport/CHANGELOG +0 -787
  1038. data/vendor/rails/activesupport/MIT-LICENSE +0 -20
  1039. data/vendor/rails/activesupport/README +0 -43
  1040. data/vendor/rails/activesupport/Rakefile +0 -82
  1041. data/vendor/rails/activesupport/install.rb +0 -30
  1042. data/vendor/rails/activesupport/lib/active_support.rb +0 -46
  1043. data/vendor/rails/activesupport/lib/active_support/caching_tools.rb +0 -62
  1044. data/vendor/rails/activesupport/lib/active_support/clean_logger.rb +0 -78
  1045. data/vendor/rails/activesupport/lib/active_support/core_ext.rb +0 -1
  1046. data/vendor/rails/activesupport/lib/active_support/core_ext/array.rb +0 -7
  1047. data/vendor/rails/activesupport/lib/active_support/core_ext/array/conversions.rb +0 -72
  1048. data/vendor/rails/activesupport/lib/active_support/core_ext/array/grouping.rb +0 -55
  1049. data/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal.rb +0 -3
  1050. data/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal/formatting.rb +0 -7
  1051. data/vendor/rails/activesupport/lib/active_support/core_ext/blank.rb +0 -50
  1052. data/vendor/rails/activesupport/lib/active_support/core_ext/cgi.rb +0 -5
  1053. data/vendor/rails/activesupport/lib/active_support/core_ext/cgi/escape_skipping_slashes.rb +0 -14
  1054. data/vendor/rails/activesupport/lib/active_support/core_ext/class.rb +0 -3
  1055. data/vendor/rails/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb +0 -48
  1056. data/vendor/rails/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb +0 -140
  1057. data/vendor/rails/activesupport/lib/active_support/core_ext/class/removal.rb +0 -24
  1058. data/vendor/rails/activesupport/lib/active_support/core_ext/date.rb +0 -10
  1059. data/vendor/rails/activesupport/lib/active_support/core_ext/date/behavior.rb +0 -13
  1060. data/vendor/rails/activesupport/lib/active_support/core_ext/date/calculations.rb +0 -45
  1061. data/vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb +0 -40
  1062. data/vendor/rails/activesupport/lib/active_support/core_ext/date_time.rb +0 -8
  1063. data/vendor/rails/activesupport/lib/active_support/core_ext/date_time/calculations.rb +0 -173
  1064. data/vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb +0 -33
  1065. data/vendor/rails/activesupport/lib/active_support/core_ext/enumerable.rb +0 -62
  1066. data/vendor/rails/activesupport/lib/active_support/core_ext/exception.rb +0 -33
  1067. data/vendor/rails/activesupport/lib/active_support/core_ext/file.rb +0 -21
  1068. data/vendor/rails/activesupport/lib/active_support/core_ext/hash.rb +0 -12
  1069. data/vendor/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb +0 -221
  1070. data/vendor/rails/activesupport/lib/active_support/core_ext/hash/diff.rb +0 -11
  1071. data/vendor/rails/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb +0 -101
  1072. data/vendor/rails/activesupport/lib/active_support/core_ext/hash/keys.rb +0 -53
  1073. data/vendor/rails/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb +0 -25
  1074. data/vendor/rails/activesupport/lib/active_support/core_ext/hash/slice.rb +0 -28
  1075. data/vendor/rails/activesupport/lib/active_support/core_ext/integer.rb +0 -7
  1076. data/vendor/rails/activesupport/lib/active_support/core_ext/integer/even_odd.rb +0 -24
  1077. data/vendor/rails/activesupport/lib/active_support/core_ext/integer/inflections.rb +0 -21
  1078. data/vendor/rails/activesupport/lib/active_support/core_ext/kernel.rb +0 -5
  1079. data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/agnostics.rb +0 -11
  1080. data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/daemonizing.rb +0 -15
  1081. data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/debugger.rb +0 -13
  1082. data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb +0 -51
  1083. data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/requires.rb +0 -24
  1084. data/vendor/rails/activesupport/lib/active_support/core_ext/load_error.rb +0 -38
  1085. data/vendor/rails/activesupport/lib/active_support/core_ext/logger.rb +0 -16
  1086. data/vendor/rails/activesupport/lib/active_support/core_ext/module.rb +0 -8
  1087. data/vendor/rails/activesupport/lib/active_support/core_ext/module/aliasing.rb +0 -70
  1088. data/vendor/rails/activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb +0 -31
  1089. data/vendor/rails/activesupport/lib/active_support/core_ext/module/attr_internal.rb +0 -31
  1090. data/vendor/rails/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb +0 -48
  1091. data/vendor/rails/activesupport/lib/active_support/core_ext/module/delegation.rb +0 -41
  1092. data/vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb +0 -11
  1093. data/vendor/rails/activesupport/lib/active_support/core_ext/module/introspection.rb +0 -35
  1094. data/vendor/rails/activesupport/lib/active_support/core_ext/module/loading.rb +0 -13
  1095. data/vendor/rails/activesupport/lib/active_support/core_ext/name_error.rb +0 -17
  1096. data/vendor/rails/activesupport/lib/active_support/core_ext/numeric.rb +0 -7
  1097. data/vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb +0 -44
  1098. data/vendor/rails/activesupport/lib/active_support/core_ext/numeric/time.rb +0 -91
  1099. data/vendor/rails/activesupport/lib/active_support/core_ext/object.rb +0 -2
  1100. data/vendor/rails/activesupport/lib/active_support/core_ext/object/extending.rb +0 -47
  1101. data/vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb +0 -54
  1102. data/vendor/rails/activesupport/lib/active_support/core_ext/pathname.rb +0 -7
  1103. data/vendor/rails/activesupport/lib/active_support/core_ext/pathname/clean_within.rb +0 -14
  1104. data/vendor/rails/activesupport/lib/active_support/core_ext/proc.rb +0 -12
  1105. data/vendor/rails/activesupport/lib/active_support/core_ext/range.rb +0 -5
  1106. data/vendor/rails/activesupport/lib/active_support/core_ext/range/conversions.rb +0 -21
  1107. data/vendor/rails/activesupport/lib/active_support/core_ext/string.rb +0 -15
  1108. data/vendor/rails/activesupport/lib/active_support/core_ext/string/access.rb +0 -58
  1109. data/vendor/rails/activesupport/lib/active_support/core_ext/string/conversions.rb +0 -19
  1110. data/vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb +0 -153
  1111. data/vendor/rails/activesupport/lib/active_support/core_ext/string/iterators.rb +0 -17
  1112. data/vendor/rails/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb +0 -20
  1113. data/vendor/rails/activesupport/lib/active_support/core_ext/string/unicode.rb +0 -42
  1114. data/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb +0 -12
  1115. data/vendor/rails/activesupport/lib/active_support/core_ext/test.rb +0 -2
  1116. data/vendor/rails/activesupport/lib/active_support/core_ext/test/difference.rb +0 -40
  1117. data/vendor/rails/activesupport/lib/active_support/core_ext/time.rb +0 -19
  1118. data/vendor/rails/activesupport/lib/active_support/core_ext/time/behavior.rb +0 -13
  1119. data/vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb +0 -239
  1120. data/vendor/rails/activesupport/lib/active_support/core_ext/time/conversions.rb +0 -39
  1121. data/vendor/rails/activesupport/lib/active_support/dependencies.rb +0 -539
  1122. data/vendor/rails/activesupport/lib/active_support/deprecation.rb +0 -202
  1123. data/vendor/rails/activesupport/lib/active_support/duration.rb +0 -89
  1124. data/vendor/rails/activesupport/lib/active_support/inflections.rb +0 -52
  1125. data/vendor/rails/activesupport/lib/active_support/inflector.rb +0 -275
  1126. data/vendor/rails/activesupport/lib/active_support/json.rb +0 -31
  1127. data/vendor/rails/activesupport/lib/active_support/json/decoding.rb +0 -40
  1128. data/vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb +0 -5
  1129. data/vendor/rails/activesupport/lib/active_support/json/encoders/false_class.rb +0 -5
  1130. data/vendor/rails/activesupport/lib/active_support/json/encoders/hash.rb +0 -12
  1131. data/vendor/rails/activesupport/lib/active_support/json/encoders/nil_class.rb +0 -5
  1132. data/vendor/rails/activesupport/lib/active_support/json/encoders/numeric.rb +0 -5
  1133. data/vendor/rails/activesupport/lib/active_support/json/encoders/object.rb +0 -10
  1134. data/vendor/rails/activesupport/lib/active_support/json/encoders/regexp.rb +0 -5
  1135. data/vendor/rails/activesupport/lib/active_support/json/encoders/string.rb +0 -27
  1136. data/vendor/rails/activesupport/lib/active_support/json/encoders/symbol.rb +0 -5
  1137. data/vendor/rails/activesupport/lib/active_support/json/encoders/true_class.rb +0 -5
  1138. data/vendor/rails/activesupport/lib/active_support/json/encoding.rb +0 -45
  1139. data/vendor/rails/activesupport/lib/active_support/json/variable.rb +0 -10
  1140. data/vendor/rails/activesupport/lib/active_support/multibyte.rb +0 -7
  1141. data/vendor/rails/activesupport/lib/active_support/multibyte/chars.rb +0 -129
  1142. data/vendor/rails/activesupport/lib/active_support/multibyte/generators/generate_tables.rb +0 -149
  1143. data/vendor/rails/activesupport/lib/active_support/multibyte/handlers/passthru_handler.rb +0 -9
  1144. data/vendor/rails/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb +0 -458
  1145. data/vendor/rails/activesupport/lib/active_support/multibyte/handlers/utf8_handler_proc.rb +0 -43
  1146. data/vendor/rails/activesupport/lib/active_support/option_merger.rb +0 -25
  1147. data/vendor/rails/activesupport/lib/active_support/ordered_options.rb +0 -44
  1148. data/vendor/rails/activesupport/lib/active_support/reloadable.rb +0 -60
  1149. data/vendor/rails/activesupport/lib/active_support/values/time_zone.rb +0 -180
  1150. data/vendor/rails/activesupport/lib/active_support/values/unicode_tables.dat +0 -0
  1151. data/vendor/rails/activesupport/lib/active_support/vendor/builder.rb +0 -13
  1152. data/vendor/rails/activesupport/lib/active_support/vendor/builder/blankslate.rb +0 -63
  1153. data/vendor/rails/activesupport/lib/active_support/vendor/builder/xchar.rb +0 -112
  1154. data/vendor/rails/activesupport/lib/active_support/vendor/builder/xmlbase.rb +0 -145
  1155. data/vendor/rails/activesupport/lib/active_support/vendor/builder/xmlevents.rb +0 -63
  1156. data/vendor/rails/activesupport/lib/active_support/vendor/builder/xmlmarkup.rb +0 -327
  1157. data/vendor/rails/activesupport/lib/active_support/vendor/xml_simple.rb +0 -1021
  1158. data/vendor/rails/activesupport/lib/active_support/version.rb +0 -9
  1159. data/vendor/rails/activesupport/lib/active_support/whiny_nil.rb +0 -38
  1160. data/vendor/rails/activesupport/test/abstract_unit.rb +0 -7
  1161. data/vendor/rails/activesupport/test/autoloading_fixtures/a/b.rb +0 -2
  1162. data/vendor/rails/activesupport/test/autoloading_fixtures/a/c/d.rb +0 -2
  1163. data/vendor/rails/activesupport/test/autoloading_fixtures/a/c/e/f.rb +0 -2
  1164. data/vendor/rails/activesupport/test/autoloading_fixtures/application.rb +0 -1
  1165. data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder.rb +0 -3
  1166. data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/class_folder_subclass.rb +0 -3
  1167. data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/inline_class.rb +0 -2
  1168. data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/nested_class.rb +0 -7
  1169. data/vendor/rails/activesupport/test/autoloading_fixtures/conflict.rb +0 -1
  1170. data/vendor/rails/activesupport/test/autoloading_fixtures/counting_loader.rb +0 -5
  1171. data/vendor/rails/activesupport/test/autoloading_fixtures/cross_site_dependency.rb +0 -2
  1172. data/vendor/rails/activesupport/test/autoloading_fixtures/e.rb +0 -2
  1173. data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/inline_class.rb +0 -2
  1174. data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/nested_class.rb +0 -4
  1175. data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/nested_sibling.rb +0 -2
  1176. data/vendor/rails/activesupport/test/autoloading_fixtures/module_with_custom_const_missing/a/b.rb +0 -1
  1177. data/vendor/rails/activesupport/test/autoloading_fixtures/multiple_constant_file.rb +0 -2
  1178. data/vendor/rails/activesupport/test/autoloading_fixtures/raises_name_error.rb +0 -3
  1179. data/vendor/rails/activesupport/test/autoloading_fixtures/raises_no_method_error.rb +0 -3
  1180. data/vendor/rails/activesupport/test/caching_tools_test.rb +0 -79
  1181. data/vendor/rails/activesupport/test/clean_logger_test.rb +0 -87
  1182. data/vendor/rails/activesupport/test/core_ext/array_ext_test.rb +0 -182
  1183. data/vendor/rails/activesupport/test/core_ext/blank_test.rb +0 -11
  1184. data/vendor/rails/activesupport/test/core_ext/cgi_ext_test.rb +0 -14
  1185. data/vendor/rails/activesupport/test/core_ext/class/attribute_accessor_test.rb +0 -31
  1186. data/vendor/rails/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb +0 -208
  1187. data/vendor/rails/activesupport/test/core_ext/class_test.rb +0 -36
  1188. data/vendor/rails/activesupport/test/core_ext/date_ext_test.rb +0 -21
  1189. data/vendor/rails/activesupport/test/core_ext/date_time_ext_test.rb +0 -152
  1190. data/vendor/rails/activesupport/test/core_ext/duration_test.rb +0 -21
  1191. data/vendor/rails/activesupport/test/core_ext/enumerable_test.rb +0 -61
  1192. data/vendor/rails/activesupport/test/core_ext/exception_test.rb +0 -64
  1193. data/vendor/rails/activesupport/test/core_ext/file_test.rb +0 -29
  1194. data/vendor/rails/activesupport/test/core_ext/hash_ext_test.rb +0 -622
  1195. data/vendor/rails/activesupport/test/core_ext/integer_ext_test.rb +0 -37
  1196. data/vendor/rails/activesupport/test/core_ext/kernel_test.rb +0 -43
  1197. data/vendor/rails/activesupport/test/core_ext/load_error_tests.rb +0 -16
  1198. data/vendor/rails/activesupport/test/core_ext/module/attr_accessor_with_default.rb +0 -30
  1199. data/vendor/rails/activesupport/test/core_ext/module/attr_accessor_with_default_test.rb +0 -30
  1200. data/vendor/rails/activesupport/test/core_ext/module/attr_internal_test.rb +0 -52
  1201. data/vendor/rails/activesupport/test/core_ext/module/attribute_accessor_test.rb +0 -33
  1202. data/vendor/rails/activesupport/test/core_ext/module/attribute_aliasing_test.rb +0 -31
  1203. data/vendor/rails/activesupport/test/core_ext/module_test.rb +0 -274
  1204. data/vendor/rails/activesupport/test/core_ext/name_error_test.rb +0 -24
  1205. data/vendor/rails/activesupport/test/core_ext/numeric_ext_test.rb +0 -104
  1206. data/vendor/rails/activesupport/test/core_ext/object_and_class_ext_test.rb +0 -216
  1207. data/vendor/rails/activesupport/test/core_ext/pathname_test.rb +0 -9
  1208. data/vendor/rails/activesupport/test/core_ext/proc_test.rb +0 -11
  1209. data/vendor/rails/activesupport/test/core_ext/range_ext_test.rb +0 -13
  1210. data/vendor/rails/activesupport/test/core_ext/string_ext_test.rb +0 -152
  1211. data/vendor/rails/activesupport/test/core_ext/symbol_test.rb +0 -9
  1212. data/vendor/rails/activesupport/test/core_ext/time_ext_test.rb +0 -373
  1213. data/vendor/rails/activesupport/test/dependencies/check_warnings.rb +0 -2
  1214. data/vendor/rails/activesupport/test/dependencies/conflict.rb +0 -1
  1215. data/vendor/rails/activesupport/test/dependencies/cross_site_depender.rb +0 -3
  1216. data/vendor/rails/activesupport/test/dependencies/mutual_one.rb +0 -4
  1217. data/vendor/rails/activesupport/test/dependencies/mutual_two.rb +0 -4
  1218. data/vendor/rails/activesupport/test/dependencies/raises_exception.rb +0 -3
  1219. data/vendor/rails/activesupport/test/dependencies/requires_nonexistent0.rb +0 -1
  1220. data/vendor/rails/activesupport/test/dependencies/requires_nonexistent1.rb +0 -1
  1221. data/vendor/rails/activesupport/test/dependencies/service_one.rb +0 -5
  1222. data/vendor/rails/activesupport/test/dependencies/service_two.rb +0 -2
  1223. data/vendor/rails/activesupport/test/dependencies_test.rb +0 -752
  1224. data/vendor/rails/activesupport/test/deprecation_test.rb +0 -151
  1225. data/vendor/rails/activesupport/test/inflector_test.rb +0 -438
  1226. data/vendor/rails/activesupport/test/json/decoding_test.rb +0 -28
  1227. data/vendor/rails/activesupport/test/json/encoding_test.rb +0 -96
  1228. data/vendor/rails/activesupport/test/multibyte_chars_test.rb +0 -164
  1229. data/vendor/rails/activesupport/test/multibyte_conformance.rb +0 -141
  1230. data/vendor/rails/activesupport/test/multibyte_handler_test.rb +0 -277
  1231. data/vendor/rails/activesupport/test/option_merger_test.rb +0 -50
  1232. data/vendor/rails/activesupport/test/ordered_options_test.rb +0 -80
  1233. data/vendor/rails/activesupport/test/reloadable_test.rb +0 -123
  1234. data/vendor/rails/activesupport/test/test_test.rb +0 -56
  1235. data/vendor/rails/activesupport/test/time_zone_test.rb +0 -91
  1236. data/vendor/rails/activesupport/test/whiny_nil_test.rb +0 -38
  1237. data/vendor/rails/railties/CHANGELOG +0 -1407
  1238. data/vendor/rails/railties/MIT-LICENSE +0 -20
  1239. data/vendor/rails/railties/README +0 -180
  1240. data/vendor/rails/railties/Rakefile +0 -355
  1241. data/vendor/rails/railties/bin/about +0 -3
  1242. data/vendor/rails/railties/bin/console +0 -3
  1243. data/vendor/rails/railties/bin/destroy +0 -3
  1244. data/vendor/rails/railties/bin/generate +0 -3
  1245. data/vendor/rails/railties/bin/performance/benchmarker +0 -3
  1246. data/vendor/rails/railties/bin/performance/profiler +0 -3
  1247. data/vendor/rails/railties/bin/plugin +0 -3
  1248. data/vendor/rails/railties/bin/process/inspector +0 -3
  1249. data/vendor/rails/railties/bin/process/reaper +0 -3
  1250. data/vendor/rails/railties/bin/process/spawner +0 -3
  1251. data/vendor/rails/railties/bin/rails +0 -19
  1252. data/vendor/rails/railties/bin/runner +0 -3
  1253. data/vendor/rails/railties/bin/server +0 -3
  1254. data/vendor/rails/railties/builtin/rails_info/rails/info.rb +0 -123
  1255. data/vendor/rails/railties/builtin/rails_info/rails/info_controller.rb +0 -9
  1256. data/vendor/rails/railties/builtin/rails_info/rails/info_helper.rb +0 -2
  1257. data/vendor/rails/railties/builtin/rails_info/rails_info_controller.rb +0 -2
  1258. data/vendor/rails/railties/configs/apache.conf +0 -40
  1259. data/vendor/rails/railties/configs/databases/frontbase.yml +0 -28
  1260. data/vendor/rails/railties/configs/databases/mysql.yml +0 -48
  1261. data/vendor/rails/railties/configs/databases/oracle.yml +0 -39
  1262. data/vendor/rails/railties/configs/databases/postgresql.yml +0 -44
  1263. data/vendor/rails/railties/configs/databases/sqlite2.yml +0 -16
  1264. data/vendor/rails/railties/configs/databases/sqlite3.yml +0 -19
  1265. data/vendor/rails/railties/configs/initializers/inflections.rb +0 -8
  1266. data/vendor/rails/railties/configs/initializers/mime_types.rb +0 -3
  1267. data/vendor/rails/railties/configs/lighttpd.conf +0 -54
  1268. data/vendor/rails/railties/configs/routes.rb +0 -27
  1269. data/vendor/rails/railties/dispatches/dispatch.fcgi +0 -24
  1270. data/vendor/rails/railties/dispatches/dispatch.rb +0 -10
  1271. data/vendor/rails/railties/dispatches/gateway.cgi +0 -97
  1272. data/vendor/rails/railties/doc/README_FOR_APP +0 -2
  1273. data/vendor/rails/railties/environments/boot.rb +0 -36
  1274. data/vendor/rails/railties/environments/development.rb +0 -18
  1275. data/vendor/rails/railties/environments/environment.rb +0 -55
  1276. data/vendor/rails/railties/environments/production.rb +0 -18
  1277. data/vendor/rails/railties/environments/test.rb +0 -19
  1278. data/vendor/rails/railties/fresh_rakefile +0 -10
  1279. data/vendor/rails/railties/helpers/application.rb +0 -6
  1280. data/vendor/rails/railties/helpers/application_helper.rb +0 -3
  1281. data/vendor/rails/railties/helpers/test_helper.rb +0 -36
  1282. data/vendor/rails/railties/html/404.html +0 -30
  1283. data/vendor/rails/railties/html/500.html +0 -30
  1284. data/vendor/rails/railties/html/favicon.ico +0 -0
  1285. data/vendor/rails/railties/html/images/rails.png +0 -0
  1286. data/vendor/rails/railties/html/index.html +0 -277
  1287. data/vendor/rails/railties/html/javascripts/application.js +0 -2
  1288. data/vendor/rails/railties/html/javascripts/controls.js +0 -833
  1289. data/vendor/rails/railties/html/javascripts/dragdrop.js +0 -942
  1290. data/vendor/rails/railties/html/javascripts/effects.js +0 -1088
  1291. data/vendor/rails/railties/html/javascripts/prototype.js +0 -2515
  1292. data/vendor/rails/railties/html/robots.txt +0 -1
  1293. data/vendor/rails/railties/lib/code_statistics.rb +0 -107
  1294. data/vendor/rails/railties/lib/commands.rb +0 -17
  1295. data/vendor/rails/railties/lib/commands/about.rb +0 -2
  1296. data/vendor/rails/railties/lib/commands/console.rb +0 -32
  1297. data/vendor/rails/railties/lib/commands/destroy.rb +0 -6
  1298. data/vendor/rails/railties/lib/commands/generate.rb +0 -6
  1299. data/vendor/rails/railties/lib/commands/ncgi/listener +0 -86
  1300. data/vendor/rails/railties/lib/commands/ncgi/tracker +0 -69
  1301. data/vendor/rails/railties/lib/commands/performance/benchmarker.rb +0 -24
  1302. data/vendor/rails/railties/lib/commands/performance/profiler.rb +0 -50
  1303. data/vendor/rails/railties/lib/commands/plugin.rb +0 -918
  1304. data/vendor/rails/railties/lib/commands/process/inspector.rb +0 -68
  1305. data/vendor/rails/railties/lib/commands/process/reaper.rb +0 -149
  1306. data/vendor/rails/railties/lib/commands/process/spawner.rb +0 -209
  1307. data/vendor/rails/railties/lib/commands/process/spinner.rb +0 -57
  1308. data/vendor/rails/railties/lib/commands/runner.rb +0 -48
  1309. data/vendor/rails/railties/lib/commands/server.rb +0 -39
  1310. data/vendor/rails/railties/lib/commands/servers/base.rb +0 -31
  1311. data/vendor/rails/railties/lib/commands/servers/lighttpd.rb +0 -94
  1312. data/vendor/rails/railties/lib/commands/servers/mongrel.rb +0 -69
  1313. data/vendor/rails/railties/lib/commands/servers/webrick.rb +0 -65
  1314. data/vendor/rails/railties/lib/commands/update.rb +0 -4
  1315. data/vendor/rails/railties/lib/console_app.rb +0 -27
  1316. data/vendor/rails/railties/lib/console_sandbox.rb +0 -6
  1317. data/vendor/rails/railties/lib/console_with_helpers.rb +0 -23
  1318. data/vendor/rails/railties/lib/dispatcher.rb +0 -181
  1319. data/vendor/rails/railties/lib/fcgi_handler.rb +0 -207
  1320. data/vendor/rails/railties/lib/initializer.rb +0 -693
  1321. data/vendor/rails/railties/lib/rails/plugin/loader.rb +0 -123
  1322. data/vendor/rails/railties/lib/rails/plugin/locator.rb +0 -59
  1323. data/vendor/rails/railties/lib/rails/version.rb +0 -9
  1324. data/vendor/rails/railties/lib/rails_generator.rb +0 -43
  1325. data/vendor/rails/railties/lib/rails_generator/base.rb +0 -261
  1326. data/vendor/rails/railties/lib/rails_generator/commands.rb +0 -581
  1327. data/vendor/rails/railties/lib/rails_generator/generated_attribute.rb +0 -42
  1328. data/vendor/rails/railties/lib/rails_generator/generators/applications/app/USAGE +0 -16
  1329. data/vendor/rails/railties/lib/rails_generator/generators/applications/app/app_generator.rb +0 -175
  1330. data/vendor/rails/railties/lib/rails_generator/generators/components/controller/USAGE +0 -30
  1331. data/vendor/rails/railties/lib/rails_generator/generators/components/controller/controller_generator.rb +0 -37
  1332. data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/controller.rb +0 -10
  1333. data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/functional_test.rb +0 -18
  1334. data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/helper.rb +0 -2
  1335. data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/view.html.erb +0 -2
  1336. data/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/USAGE +0 -14
  1337. data/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/integration_test_generator.rb +0 -16
  1338. data/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb +0 -10
  1339. data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/USAGE +0 -18
  1340. data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb +0 -34
  1341. data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/fixture.erb +0 -3
  1342. data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/fixture.rhtml +0 -0
  1343. data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/mailer.rb +0 -13
  1344. data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +0 -37
  1345. data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/view.erb +0 -3
  1346. data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/view.rhtml +0 -0
  1347. data/vendor/rails/railties/lib/rails_generator/generators/components/migration/USAGE +0 -14
  1348. data/vendor/rails/railties/lib/rails_generator/generators/components/migration/migration_generator.rb +0 -7
  1349. data/vendor/rails/railties/lib/rails_generator/generators/components/migration/templates/migration.rb +0 -7
  1350. data/vendor/rails/railties/lib/rails_generator/generators/components/model/USAGE +0 -26
  1351. data/vendor/rails/railties/lib/rails_generator/generators/components/model/model_generator.rb +0 -38
  1352. data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml +0 -11
  1353. data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/migration.rb +0 -13
  1354. data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/model.rb +0 -2
  1355. data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/unit_test.rb +0 -10
  1356. data/vendor/rails/railties/lib/rails_generator/generators/components/observer/USAGE +0 -15
  1357. data/vendor/rails/railties/lib/rails_generator/generators/components/observer/observer_generator.rb +0 -16
  1358. data/vendor/rails/railties/lib/rails_generator/generators/components/observer/templates/observer.rb +0 -2
  1359. data/vendor/rails/railties/lib/rails_generator/generators/components/observer/templates/unit_test.rb +0 -10
  1360. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/USAGE +0 -35
  1361. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/plugin_generator.rb +0 -39
  1362. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/MIT-LICENSE +0 -20
  1363. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/README +0 -13
  1364. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/Rakefile +0 -22
  1365. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/USAGE +0 -8
  1366. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/generator.rb +0 -8
  1367. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/init.rb +0 -1
  1368. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/install.rb +0 -1
  1369. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/plugin.rb +0 -1
  1370. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/tasks.rake +0 -4
  1371. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/uninstall.rb +0 -1
  1372. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/unit_test.rb +0 -8
  1373. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE +0 -30
  1374. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/resource_generator.rb +0 -63
  1375. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/USAGE +0 -18
  1376. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/controller.rb +0 -2
  1377. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/fixtures.yml +0 -0
  1378. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb +0 -20
  1379. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/helper.rb +0 -2
  1380. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/migration.rb +0 -0
  1381. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/model.rb +0 -0
  1382. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/unit_test.rb +0 -0
  1383. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/USAGE +0 -37
  1384. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +0 -92
  1385. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb +0 -85
  1386. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/fixtures.yml +0 -11
  1387. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb +0 -57
  1388. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/helper.rb +0 -2
  1389. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/layout.html.erb +0 -17
  1390. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/migration.rb +0 -13
  1391. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/model.rb +0 -2
  1392. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/style.css +0 -74
  1393. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/unit_test.rb +0 -10
  1394. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.html.erb +0 -19
  1395. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_index.html.erb +0 -24
  1396. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.html.erb +0 -18
  1397. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.html.erb +0 -10
  1398. data/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/USAGE +0 -15
  1399. data/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/session_migration_generator.rb +0 -18
  1400. data/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/templates/migration.rb +0 -16
  1401. data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/USAGE +0 -28
  1402. data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/templates/api_definition.rb +0 -5
  1403. data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/templates/controller.rb +0 -8
  1404. data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/templates/functional_test.rb +0 -19
  1405. data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/web_service_generator.rb +0 -29
  1406. data/vendor/rails/railties/lib/rails_generator/lookup.rb +0 -209
  1407. data/vendor/rails/railties/lib/rails_generator/manifest.rb +0 -53
  1408. data/vendor/rails/railties/lib/rails_generator/options.rb +0 -143
  1409. data/vendor/rails/railties/lib/rails_generator/scripts.rb +0 -83
  1410. data/vendor/rails/railties/lib/rails_generator/scripts/destroy.rb +0 -30
  1411. data/vendor/rails/railties/lib/rails_generator/scripts/generate.rb +0 -7
  1412. data/vendor/rails/railties/lib/rails_generator/scripts/update.rb +0 -12
  1413. data/vendor/rails/railties/lib/rails_generator/simple_logger.rb +0 -46
  1414. data/vendor/rails/railties/lib/rails_generator/spec.rb +0 -44
  1415. data/vendor/rails/railties/lib/railties_path.rb +0 -1
  1416. data/vendor/rails/railties/lib/ruby_version_check.rb +0 -17
  1417. data/vendor/rails/railties/lib/rubyprof_ext.rb +0 -35
  1418. data/vendor/rails/railties/lib/tasks/annotations.rake +0 -84
  1419. data/vendor/rails/railties/lib/tasks/databases.rake +0 -187
  1420. data/vendor/rails/railties/lib/tasks/documentation.rake +0 -82
  1421. data/vendor/rails/railties/lib/tasks/framework.rake +0 -112
  1422. data/vendor/rails/railties/lib/tasks/log.rake +0 -9
  1423. data/vendor/rails/railties/lib/tasks/misc.rake +0 -4
  1424. data/vendor/rails/railties/lib/tasks/pre_namespace_aliases.rake +0 -53
  1425. data/vendor/rails/railties/lib/tasks/rails.rb +0 -8
  1426. data/vendor/rails/railties/lib/tasks/statistics.rake +0 -18
  1427. data/vendor/rails/railties/lib/tasks/testing.rake +0 -120
  1428. data/vendor/rails/railties/lib/tasks/tmp.rake +0 -37
  1429. data/vendor/rails/railties/lib/test_help.rb +0 -17
  1430. data/vendor/rails/railties/lib/webrick_server.rb +0 -165
  1431. data/vendor/rails/railties/test/abstract_unit.rb +0 -17
  1432. data/vendor/rails/railties/test/dispatcher_test.rb +0 -139
  1433. data/vendor/rails/railties/test/fcgi_dispatcher_test.rb +0 -266
  1434. data/vendor/rails/railties/test/fixtures/environment_with_constant.rb +0 -1
  1435. data/vendor/rails/railties/test/fixtures/lib/generators/missing_class/missing_class_generator.rb +0 -0
  1436. data/vendor/rails/railties/test/fixtures/lib/generators/working/working_generator.rb +0 -2
  1437. data/vendor/rails/railties/test/fixtures/plugins/default/plugin_with_no_lib_dir/init.rb +0 -0
  1438. data/vendor/rails/railties/test/fixtures/plugins/default/stubby/init.rb +0 -7
  1439. data/vendor/rails/railties/test/fixtures/plugins/default/stubby/lib/stubby_mixin.rb +0 -2
  1440. data/vendor/rails/railties/test/initializer_test.rb +0 -22
  1441. data/vendor/rails/railties/test/mocks/dispatcher.rb +0 -13
  1442. data/vendor/rails/railties/test/mocks/fcgi.rb +0 -15
  1443. data/vendor/rails/railties/test/mocks/routes.rb +0 -6
  1444. data/vendor/rails/railties/test/mocks/stubbed_breakpoint.rb +0 -2
  1445. data/vendor/rails/railties/test/mocks/stubbed_kernel.rb +0 -5
  1446. data/vendor/rails/railties/test/plugin_loader_test.rb +0 -78
  1447. data/vendor/rails/railties/test/plugin_locator_test.rb +0 -41
  1448. data/vendor/rails/railties/test/plugin_test_helper.rb +0 -18
  1449. data/vendor/rails/railties/test/rails_generator_test.rb +0 -137
  1450. data/vendor/rails/railties/test/rails_info_controller_test.rb +0 -48
  1451. data/vendor/rails/railties/test/rails_info_test.rb +0 -98
@@ -1,96 +0,0 @@
1
- module ActiveRecord
2
- module Associations
3
- class HasOneAssociation < BelongsToAssociation #:nodoc:
4
- def initialize(owner, reflection)
5
- super
6
- construct_sql
7
- end
8
-
9
- def create(attrs = {}, replace_existing = true)
10
- new_record(replace_existing) { |klass| klass.create(attrs) }
11
- end
12
-
13
- def create!(attrs = {}, replace_existing = true)
14
- new_record(replace_existing) { |klass| klass.create!(attrs) }
15
- end
16
-
17
- def build(attrs = {}, replace_existing = true)
18
- new_record(replace_existing) { |klass| klass.new(attrs) }
19
- end
20
-
21
- def replace(obj, dont_save = false)
22
- load_target
23
-
24
- unless @target.nil?
25
- if dependent? && !dont_save && @target != obj
26
- @target.destroy unless @target.new_record?
27
- @owner.clear_association_cache
28
- else
29
- @target[@reflection.primary_key_name] = nil
30
- @target.save unless @owner.new_record? || @target.new_record?
31
- end
32
- end
33
-
34
- if obj.nil?
35
- @target = nil
36
- else
37
- raise_on_type_mismatch(obj)
38
- set_belongs_to_association_for(obj)
39
- @target = (AssociationProxy === obj ? obj.target : obj)
40
- end
41
-
42
- @loaded = true
43
-
44
- unless @owner.new_record? or obj.nil? or dont_save
45
- return (obj.save ? self : false)
46
- else
47
- return (obj.nil? ? nil : self)
48
- end
49
- end
50
-
51
- private
52
- def find_target
53
- @reflection.klass.find(:first,
54
- :conditions => @finder_sql,
55
- :order => @reflection.options[:order],
56
- :include => @reflection.options[:include]
57
- )
58
- end
59
-
60
- def construct_sql
61
- case
62
- when @reflection.options[:as]
63
- @finder_sql =
64
- "#{@reflection.klass.table_name}.#{@reflection.options[:as]}_id = #{@owner.quoted_id} AND " +
65
- "#{@reflection.klass.table_name}.#{@reflection.options[:as]}_type = #{@owner.class.quote_value(@owner.class.base_class.name.to_s)}"
66
- else
67
- @finder_sql = "#{@reflection.table_name}.#{@reflection.primary_key_name} = #{@owner.quoted_id}"
68
- end
69
- @finder_sql << " AND (#{conditions})" if conditions
70
- end
71
-
72
- def construct_scope
73
- create_scoping = {}
74
- set_belongs_to_association_for(create_scoping)
75
- { :create => create_scoping }
76
- end
77
-
78
- def new_record(replace_existing)
79
- # make sure we load the target first, if we plan on replacing the existing
80
- # instance. Otherwise, if the target has not previously been loaded
81
- # elsewhere, the instance we create will get orphaned.
82
- load_target if replace_existing
83
- record = @reflection.klass.with_scope(:create => construct_scope[:create]) { yield @reflection.klass }
84
-
85
- if replace_existing
86
- replace(record, true)
87
- else
88
- record[@reflection.primary_key_name] = @owner.id unless @owner.new_record?
89
- self.target = record
90
- end
91
-
92
- record
93
- end
94
- end
95
- end
96
- end
@@ -1,75 +0,0 @@
1
- module ActiveRecord
2
- module AttributeMethods #:nodoc:
3
- DEFAULT_SUFFIXES = %w(= ? _before_type_cast)
4
-
5
- def self.included(base)
6
- base.extend ClassMethods
7
- base.attribute_method_suffix *DEFAULT_SUFFIXES
8
- end
9
-
10
- # Declare and check for suffixed attribute methods.
11
- module ClassMethods
12
- # Declare a method available for all attributes with the given suffix.
13
- # Uses method_missing and respond_to? to rewrite the method
14
- # #{attr}#{suffix}(*args, &block)
15
- # to
16
- # attribute#{suffix}(#{attr}, *args, &block)
17
- #
18
- # An attribute#{suffix} instance method must exist and accept at least
19
- # the attr argument.
20
- #
21
- # For example:
22
- # class Person < ActiveRecord::Base
23
- # attribute_method_suffix '_changed?'
24
- #
25
- # private
26
- # def attribute_changed?(attr)
27
- # ...
28
- # end
29
- # end
30
- #
31
- # person = Person.find(1)
32
- # person.name_changed? # => false
33
- # person.name = 'Hubert'
34
- # person.name_changed? # => true
35
- def attribute_method_suffix(*suffixes)
36
- attribute_method_suffixes.concat suffixes
37
- rebuild_attribute_method_regexp
38
- end
39
-
40
- # Returns MatchData if method_name is an attribute method.
41
- def match_attribute_method?(method_name)
42
- rebuild_attribute_method_regexp unless defined?(@@attribute_method_regexp) && @@attribute_method_regexp
43
- @@attribute_method_regexp.match(method_name)
44
- end
45
-
46
- private
47
- # Suffixes a, ?, c become regexp /(a|\?|c)$/
48
- def rebuild_attribute_method_regexp
49
- suffixes = attribute_method_suffixes.map { |s| Regexp.escape(s) }
50
- @@attribute_method_regexp = /(#{suffixes.join('|')})$/.freeze
51
- end
52
-
53
- # Default to =, ?, _before_type_cast
54
- def attribute_method_suffixes
55
- @@attribute_method_suffixes ||= []
56
- end
57
- end
58
-
59
- private
60
- # Handle *? for method_missing.
61
- def attribute?(attribute_name)
62
- query_attribute(attribute_name)
63
- end
64
-
65
- # Handle *= for method_missing.
66
- def attribute=(attribute_name, value)
67
- write_attribute(attribute_name, value)
68
- end
69
-
70
- # Handle *_before_type_cast for method_missing.
71
- def attribute_before_type_cast(attribute_name)
72
- read_attribute_before_type_cast(attribute_name)
73
- end
74
- end
75
- end
@@ -1,2276 +0,0 @@
1
- require 'base64'
2
- require 'yaml'
3
- require 'set'
4
- require 'active_record/deprecated_finders'
5
-
6
- module ActiveRecord #:nodoc:
7
- class ActiveRecordError < StandardError #:nodoc:
8
- end
9
- class SubclassNotFound < ActiveRecordError #:nodoc:
10
- end
11
- class AssociationTypeMismatch < ActiveRecordError #:nodoc:
12
- end
13
- class SerializationTypeMismatch < ActiveRecordError #:nodoc:
14
- end
15
- class AdapterNotSpecified < ActiveRecordError # :nodoc:
16
- end
17
- class AdapterNotFound < ActiveRecordError # :nodoc:
18
- end
19
- class ConnectionNotEstablished < ActiveRecordError #:nodoc:
20
- end
21
- class ConnectionFailed < ActiveRecordError #:nodoc:
22
- end
23
- class RecordNotFound < ActiveRecordError #:nodoc:
24
- end
25
- class RecordNotSaved < ActiveRecordError #:nodoc:
26
- end
27
- class StatementInvalid < ActiveRecordError #:nodoc:
28
- end
29
- class PreparedStatementInvalid < ActiveRecordError #:nodoc:
30
- end
31
- class StaleObjectError < ActiveRecordError #:nodoc:
32
- end
33
- class ConfigurationError < StandardError #:nodoc:
34
- end
35
- class ReadOnlyRecord < StandardError #:nodoc:
36
- end
37
-
38
- class AttributeAssignmentError < ActiveRecordError #:nodoc:
39
- attr_reader :exception, :attribute
40
- def initialize(message, exception, attribute)
41
- @exception = exception
42
- @attribute = attribute
43
- @message = message
44
- end
45
- end
46
-
47
- class MultiparameterAssignmentErrors < ActiveRecordError #:nodoc:
48
- attr_reader :errors
49
- def initialize(errors)
50
- @errors = errors
51
- end
52
- end
53
-
54
- # Active Record objects don't specify their attributes directly, but rather infer them from the table definition with
55
- # which they're linked. Adding, removing, and changing attributes and their type is done directly in the database. Any change
56
- # is instantly reflected in the Active Record objects. The mapping that binds a given Active Record class to a certain
57
- # database table will happen automatically in most common cases, but can be overwritten for the uncommon ones.
58
- #
59
- # See the mapping rules in table_name and the full example in link:files/README.html for more insight.
60
- #
61
- # == Creation
62
- #
63
- # Active Records accept constructor parameters either in a hash or as a block. The hash method is especially useful when
64
- # you're receiving the data from somewhere else, like a HTTP request. It works like this:
65
- #
66
- # user = User.new(:name => "David", :occupation => "Code Artist")
67
- # user.name # => "David"
68
- #
69
- # You can also use block initialization:
70
- #
71
- # user = User.new do |u|
72
- # u.name = "David"
73
- # u.occupation = "Code Artist"
74
- # end
75
- #
76
- # And of course you can just create a bare object and specify the attributes after the fact:
77
- #
78
- # user = User.new
79
- # user.name = "David"
80
- # user.occupation = "Code Artist"
81
- #
82
- # == Conditions
83
- #
84
- # Conditions can either be specified as a string, array, or hash representing the WHERE-part of an SQL statement.
85
- # The array form is to be used when the condition input is tainted and requires sanitization. The string form can
86
- # be used for statements that don't involve tainted data. The hash form works much like the array form, except
87
- # only equality and range is possible. Examples:
88
- #
89
- # class User < ActiveRecord::Base
90
- # def self.authenticate_unsafely(user_name, password)
91
- # find(:first, :conditions => "user_name = '#{user_name}' AND password = '#{password}'")
92
- # end
93
- #
94
- # def self.authenticate_safely(user_name, password)
95
- # find(:first, :conditions => [ "user_name = ? AND password = ?", user_name, password ])
96
- # end
97
- #
98
- # def self.authenticate_safely_simply(user_name, password)
99
- # find(:first, :conditions => { :user_name => user_name, :password => password })
100
- # end
101
- # end
102
- #
103
- # The <tt>authenticate_unsafely</tt> method inserts the parameters directly into the query and is thus susceptible to SQL-injection
104
- # attacks if the <tt>user_name</tt> and +password+ parameters come directly from a HTTP request. The <tt>authenticate_safely</tt> and
105
- # <tt>authenticate_safely_simply</tt> both will sanitize the <tt>user_name</tt> and +password+ before inserting them in the query,
106
- # which will ensure that an attacker can't escape the query and fake the login (or worse).
107
- #
108
- # When using multiple parameters in the conditions, it can easily become hard to read exactly what the fourth or fifth
109
- # question mark is supposed to represent. In those cases, you can resort to named bind variables instead. That's done by replacing
110
- # the question marks with symbols and supplying a hash with values for the matching symbol keys:
111
- #
112
- # Company.find(:first, [
113
- # "id = :id AND name = :name AND division = :division AND created_at > :accounting_date",
114
- # { :id => 3, :name => "37signals", :division => "First", :accounting_date => '2005-01-01' }
115
- # ])
116
- #
117
- # Similarly, a simple hash without a statement will generate conditions based on equality with the SQL AND
118
- # operator. For instance:
119
- #
120
- # Student.find(:all, :conditions => { :first_name => "Harvey", :status => 1 })
121
- # Student.find(:all, :conditions => params[:student])
122
- #
123
- # A range may be used in the hash to use the SQL BETWEEN operator:
124
- #
125
- # Student.find(:all, :conditions => { :grade => 9..12 })
126
- #
127
- # == Overwriting default accessors
128
- #
129
- # All column values are automatically available through basic accessors on the Active Record object, but some times you
130
- # want to specialize this behavior. This can be done by either by overwriting the default accessors (using the same
131
- # name as the attribute) calling read_attribute(attr_name) and write_attribute(attr_name, value) to actually change things.
132
- # Example:
133
- #
134
- # class Song < ActiveRecord::Base
135
- # # Uses an integer of seconds to hold the length of the song
136
- #
137
- # def length=(minutes)
138
- # write_attribute(:length, minutes * 60)
139
- # end
140
- #
141
- # def length
142
- # read_attribute(:length) / 60
143
- # end
144
- # end
145
- #
146
- # You can alternatively use self[:attribute]=(value) and self[:attribute] instead of write_attribute(:attribute, vaule) and
147
- # read_attribute(:attribute) as a shorter form.
148
- #
149
- # == Accessing attributes before they have been typecasted
150
- #
151
- # Sometimes you want to be able to read the raw attribute data without having the column-determined typecast run its course first.
152
- # That can be done by using the <attribute>_before_type_cast accessors that all attributes have. For example, if your Account model
153
- # has a balance attribute, you can call account.balance_before_type_cast or account.id_before_type_cast.
154
- #
155
- # This is especially useful in validation situations where the user might supply a string for an integer field and you want to display
156
- # the original string back in an error message. Accessing the attribute normally would typecast the string to 0, which isn't what you
157
- # want.
158
- #
159
- # == Dynamic attribute-based finders
160
- #
161
- # Dynamic attribute-based finders are a cleaner way of getting (and/or creating) objects by simple queries without turning to SQL. They work by
162
- # appending the name of an attribute to <tt>find_by_</tt> or <tt>find_all_by_</tt>, so you get finders like Person.find_by_user_name,
163
- # Person.find_all_by_last_name, Payment.find_by_transaction_id. So instead of writing
164
- # <tt>Person.find(:first, ["user_name = ?", user_name])</tt>, you just do <tt>Person.find_by_user_name(user_name)</tt>.
165
- # And instead of writing <tt>Person.find(:all, ["last_name = ?", last_name])</tt>, you just do <tt>Person.find_all_by_last_name(last_name)</tt>.
166
- #
167
- # It's also possible to use multiple attributes in the same find by separating them with "_and_", so you get finders like
168
- # <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
169
- # <tt>Person.find(:first, ["user_name = ? AND password = ?", user_name, password])</tt>, you just do
170
- # <tt>Person.find_by_user_name_and_password(user_name, password)</tt>.
171
- #
172
- # It's even possible to use all the additional parameters to find. For example, the full interface for Payment.find_all_by_amount
173
- # is actually Payment.find_all_by_amount(amount, options). And the full interface to Person.find_by_user_name is
174
- # actually Person.find_by_user_name(user_name, options). So you could call <tt>Payment.find_all_by_amount(50, :order => "created_on")</tt>.
175
- #
176
- # The same dynamic finder style can be used to create the object if it doesn't already exist. This dynamic finder is called with
177
- # <tt>find_or_create_by_</tt> and will return the object if it already exists and otherwise creates it, then returns it. Example:
178
- #
179
- # # No 'Summer' tag exists
180
- # Tag.find_or_create_by_name("Summer") # equal to Tag.create(:name => "Summer")
181
- #
182
- # # Now the 'Summer' tag does exist
183
- # Tag.find_or_create_by_name("Summer") # equal to Tag.find_by_name("Summer")
184
- #
185
- # Use the <tt>find_or_initialize_by_</tt> finder if you want to return a new record without saving it first. Example:
186
- #
187
- # # No 'Winter' tag exists
188
- # winter = Tag.find_or_initialize_by_name("Winter")
189
- # winter.new_record? # true
190
- #
191
- # To find by a subset of the attributes to be used for instantiating a new object, pass a hash instead of
192
- # a list of parameters. For example:
193
- #
194
- # Tag.find_or_create_by_name(:name => "rails", :creator => current_user)
195
- #
196
- # That will either find an existing tag named "rails", or create a new one while setting the user that created it.
197
- #
198
- # == Saving arrays, hashes, and other non-mappable objects in text columns
199
- #
200
- # 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+.
201
- # This makes it possible to store arrays, hashes, and other non-mappable objects without doing any additional work. Example:
202
- #
203
- # class User < ActiveRecord::Base
204
- # serialize :preferences
205
- # end
206
- #
207
- # user = User.create(:preferences => { "background" => "black", "display" => large })
208
- # User.find(user.id).preferences # => { "background" => "black", "display" => large }
209
- #
210
- # You can also specify a class option as the second parameter that'll raise an exception if a serialized object is retrieved as a
211
- # descendent of a class not in the hierarchy. Example:
212
- #
213
- # class User < ActiveRecord::Base
214
- # serialize :preferences, Hash
215
- # end
216
- #
217
- # user = User.create(:preferences => %w( one two three ))
218
- # User.find(user.id).preferences # raises SerializationTypeMismatch
219
- #
220
- # == Single table inheritance
221
- #
222
- # Active Record allows inheritance by storing the name of the class in a column that by default is called "type" (can be changed
223
- # by overwriting <tt>Base.inheritance_column</tt>). This means that an inheritance looking like this:
224
- #
225
- # class Company < ActiveRecord::Base; end
226
- # class Firm < Company; end
227
- # class Client < Company; end
228
- # class PriorityClient < Client; end
229
- #
230
- # When you do Firm.create(:name => "37signals"), this record will be saved in the companies table with type = "Firm". You can then
231
- # fetch this row again using Company.find(:first, "name = '37signals'") and it will return a Firm object.
232
- #
233
- # 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
234
- # like normal subclasses with no special magic for differentiating between them or reloading the right type with find.
235
- #
236
- # Note, all the attributes for all the cases are kept in the same table. Read more:
237
- # http://www.martinfowler.com/eaaCatalog/singleTableInheritance.html
238
- #
239
- # == Connection to multiple databases in different models
240
- #
241
- # Connections are usually created through ActiveRecord::Base.establish_connection and retrieved by ActiveRecord::Base.connection.
242
- # All classes inheriting from ActiveRecord::Base will use this connection. But you can also set a class-specific connection.
243
- # For example, if Course is a ActiveRecord::Base, but resides in a different database you can just say Course.establish_connection
244
- # and Course *and all its subclasses* will use this connection instead.
245
- #
246
- # This feature is implemented by keeping a connection pool in ActiveRecord::Base that is a Hash indexed by the class. If a connection is
247
- # requested, the retrieve_connection method will go up the class-hierarchy until a connection is found in the connection pool.
248
- #
249
- # == Exceptions
250
- #
251
- # * +ActiveRecordError+ -- generic error class and superclass of all other errors raised by Active Record
252
- # * +AdapterNotSpecified+ -- the configuration hash used in <tt>establish_connection</tt> didn't include a
253
- # <tt>:adapter</tt> key.
254
- # * +AdapterNotFound+ -- the <tt>:adapter</tt> key used in <tt>establish_connection</tt> specified an non-existent adapter
255
- # (or a bad spelling of an existing one).
256
- # * +AssociationTypeMismatch+ -- the object assigned to the association wasn't of the type specified in the association definition.
257
- # * +SerializationTypeMismatch+ -- the object serialized wasn't of the class specified as the second parameter.
258
- # * +ConnectionNotEstablished+ -- no connection has been established. Use <tt>establish_connection</tt> before querying.
259
- # * +RecordNotFound+ -- no record responded to the find* method.
260
- # Either the row with the given ID doesn't exist or the row didn't meet the additional restrictions.
261
- # * +StatementInvalid+ -- the database server rejected the SQL statement. The precise error is added in the message.
262
- # Either the record with the given ID doesn't exist or the record didn't meet the additional restrictions.
263
- # * +MultiparameterAssignmentErrors+ -- collection of errors that occurred during a mass assignment using the
264
- # +attributes=+ method. The +errors+ property of this exception contains an array of +AttributeAssignmentError+
265
- # objects that should be inspected to determine which attributes triggered the errors.
266
- # * +AttributeAssignmentError+ -- an error occurred while doing a mass assignment through the +attributes=+ method.
267
- # You can inspect the +attribute+ property of the exception object to determine which attribute triggered the error.
268
- #
269
- # *Note*: The attributes listed are class-level attributes (accessible from both the class and instance level).
270
- # So it's possible to assign a logger to the class through Base.logger= which will then be used by all
271
- # instances in the current object space.
272
- class Base
273
- # Accepts a logger conforming to the interface of Log4r or the default Ruby 1.8+ Logger class, which is then passed
274
- # on to any new database connections made and which can be retrieved on both a class and instance level by calling +logger+.
275
- cattr_accessor :logger, :instance_writer => false
276
-
277
- include Reloadable::Deprecated
278
-
279
- def self.inherited(child) #:nodoc:
280
- @@subclasses[self] ||= []
281
- @@subclasses[self] << child
282
- super
283
- end
284
-
285
- def self.reset_subclasses #:nodoc:
286
- nonreloadables = []
287
- subclasses.each do |klass|
288
- unless Dependencies.autoloaded? klass
289
- nonreloadables << klass
290
- next
291
- end
292
- klass.instance_variables.each { |var| klass.send(:remove_instance_variable, var) }
293
- klass.instance_methods(false).each { |m| klass.send :undef_method, m }
294
- end
295
- @@subclasses = {}
296
- nonreloadables.each { |klass| (@@subclasses[klass.superclass] ||= []) << klass }
297
- end
298
-
299
- @@subclasses = {}
300
-
301
- cattr_accessor :configurations, :instance_writer => false
302
- @@configurations = {}
303
-
304
- # Accessor for the prefix type that will be prepended to every primary key column name. The options are :table_name and
305
- # :table_name_with_underscore. If the first is specified, the Product class will look for "productid" instead of "id" as
306
- # the primary column. If the latter is specified, the Product class will look for "product_id" instead of "id". Remember
307
- # that this is a global setting for all Active Records.
308
- cattr_accessor :primary_key_prefix_type, :instance_writer => false
309
- @@primary_key_prefix_type = nil
310
-
311
- # Accessor for the name of the prefix string to prepend to every table name. So if set to "basecamp_", all
312
- # table names will be named like "basecamp_projects", "basecamp_people", etc. This is a convenient way of creating a namespace
313
- # for tables in a shared database. By default, the prefix is the empty string.
314
- cattr_accessor :table_name_prefix, :instance_writer => false
315
- @@table_name_prefix = ""
316
-
317
- # Works like +table_name_prefix+, but appends instead of prepends (set to "_basecamp" gives "projects_basecamp",
318
- # "people_basecamp"). By default, the suffix is the empty string.
319
- cattr_accessor :table_name_suffix, :instance_writer => false
320
- @@table_name_suffix = ""
321
-
322
- # Indicates whether or not table names should be the pluralized versions of the corresponding class names.
323
- # If true, the default table name for a +Product+ class will be +products+. If false, it would just be +product+.
324
- # See table_name for the full rules on table/class naming. This is true, by default.
325
- cattr_accessor :pluralize_table_names, :instance_writer => false
326
- @@pluralize_table_names = true
327
-
328
- # Determines whether or not to use ANSI codes to colorize the logging statements committed by the connection adapter. These colors
329
- # make it much easier to overview things during debugging (when used through a reader like +tail+ and on a black background), but
330
- # may complicate matters if you use software like syslog. This is true, by default.
331
- cattr_accessor :colorize_logging, :instance_writer => false
332
- @@colorize_logging = true
333
-
334
- # Determines whether to use Time.local (using :local) or Time.utc (using :utc) when pulling dates and times from the database.
335
- # This is set to :local by default.
336
- cattr_accessor :default_timezone, :instance_writer => false
337
- @@default_timezone = :local
338
-
339
- # Determines whether or not to use a connection for each thread, or a single shared connection for all threads.
340
- # Defaults to false. Set to true if you're writing a threaded application.
341
- cattr_accessor :allow_concurrency, :instance_writer => false
342
- @@allow_concurrency = false
343
-
344
- # Determines whether to speed up access by generating optimized reader
345
- # methods to avoid expensive calls to method_missing when accessing
346
- # attributes by name. You might want to set this to false in development
347
- # mode, because the methods would be regenerated on each request.
348
- cattr_accessor :generate_read_methods, :instance_writer => false
349
- @@generate_read_methods = true
350
-
351
- # Specifies the format to use when dumping the database schema with Rails'
352
- # Rakefile. If :sql, the schema is dumped as (potentially database-
353
- # specific) SQL statements. If :ruby, the schema is dumped as an
354
- # ActiveRecord::Schema file which can be loaded into any database that
355
- # supports migrations. Use :ruby if you want to have different database
356
- # adapters for, e.g., your development and test environments.
357
- cattr_accessor :schema_format , :instance_writer => false
358
- @@schema_format = :ruby
359
-
360
- class << self # Class methods
361
- # Find operates with three different retrieval approaches:
362
- #
363
- # * 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]).
364
- # If no record can be found for all of the listed ids, then RecordNotFound will be raised.
365
- # * Find first: This will return the first record matched by the options used. These options can either be specific
366
- # conditions or merely an order. If no record can matched, nil is returned.
367
- # * Find all: This will return all the records matched by the options used. If no records are found, an empty array is returned.
368
- #
369
- # All approaches accept an option hash as their last parameter. The options are:
370
- #
371
- # * <tt>:conditions</tt>: An SQL fragment like "administrator = 1" or [ "user_name = ?", username ]. See conditions in the intro.
372
- # * <tt>:order</tt>: An SQL fragment like "created_at DESC, name".
373
- # * <tt>:group</tt>: An attribute name by which the result should be grouped. Uses the GROUP BY SQL-clause.
374
- # * <tt>:limit</tt>: An integer determining the limit on the number of rows that should be returned.
375
- # * <tt>:offset</tt>: An integer determining the offset from where the rows should be fetched. So at 5, it would skip the first 4 rows.
376
- # * <tt>:joins</tt>: An SQL fragment for additional joins like "LEFT JOIN comments ON comments.post_id = id". (Rarely needed).
377
- # The records will be returned read-only since they will have attributes that do not correspond to the table's columns.
378
- # Pass :readonly => false to override.
379
- # * <tt>:include</tt>: Names associations that should be loaded alongside using LEFT OUTER JOINs. The symbols named refer
380
- # to already defined associations. See eager loading under Associations.
381
- # * <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
382
- # include the joined columns.
383
- # * <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
384
- # of a database view).
385
- # * <tt>:readonly</tt>: Mark the returned records read-only so they cannot be saved or updated.
386
- # * <tt>:lock</tt>: An SQL fragment like "FOR UPDATE" or "LOCK IN SHARE MODE".
387
- # :lock => true gives connection's default exclusive lock, usually "FOR UPDATE".
388
- #
389
- # Examples for find by id:
390
- # Person.find(1) # returns the object for ID = 1
391
- # Person.find(1, 2, 6) # returns an array for objects with IDs in (1, 2, 6)
392
- # Person.find([7, 17]) # returns an array for objects with IDs in (7, 17)
393
- # Person.find([1]) # returns an array for objects the object with ID = 1
394
- # Person.find(1, :conditions => "administrator = 1", :order => "created_on DESC")
395
- #
396
- # Note that returned records may not be in the same order as the ids you
397
- # provide since database rows are unordered. Give an explicit :order
398
- # to ensure the results are sorted.
399
- #
400
- # Examples for find first:
401
- # Person.find(:first) # returns the first object fetched by SELECT * FROM people
402
- # Person.find(:first, :conditions => [ "user_name = ?", user_name])
403
- # Person.find(:first, :order => "created_on DESC", :offset => 5)
404
- #
405
- # Examples for find all:
406
- # Person.find(:all) # returns an array of objects for all the rows fetched by SELECT * FROM people
407
- # Person.find(:all, :conditions => [ "category IN (?)", categories], :limit => 50)
408
- # Person.find(:all, :offset => 10, :limit => 10)
409
- # Person.find(:all, :include => [ :account, :friends ])
410
- # Person.find(:all, :group => "category")
411
- #
412
- # Example for find with a lock. Imagine two concurrent transactions:
413
- # each will read person.visits == 2, add 1 to it, and save, resulting
414
- # in two saves of person.visits = 3. By locking the row, the second
415
- # transaction has to wait until the first is finished; we get the
416
- # expected person.visits == 4.
417
- # Person.transaction do
418
- # person = Person.find(1, :lock => true)
419
- # person.visits += 1
420
- # person.save!
421
- # end
422
- def find(*args)
423
- options = extract_options_from_args!(args)
424
- validate_find_options(options)
425
- set_readonly_option!(options)
426
-
427
- case args.first
428
- when :first then find_initial(options)
429
- when :all then find_every(options)
430
- else find_from_ids(args, options)
431
- end
432
- end
433
-
434
- # Works like find(:all), but requires a complete SQL string. Examples:
435
- # Post.find_by_sql "SELECT p.*, c.author FROM posts p, comments c WHERE p.id = c.post_id"
436
- # Post.find_by_sql ["SELECT * FROM posts WHERE author = ? AND created > ?", author_id, start_date]
437
- def find_by_sql(sql)
438
- connection.select_all(sanitize_sql(sql), "#{name} Load").collect! { |record| instantiate(record) }
439
- end
440
-
441
- # Returns true if the given +id+ represents the primary key of a record in the database, false otherwise.
442
- # You can also pass a set of SQL conditions.
443
- # Example:
444
- # Person.exists?(5)
445
- # Person.exists?('5')
446
- # Person.exists?(:name => "David")
447
- # Person.exists?(['name LIKE ?', "%#{query}%"])
448
- def exists?(id_or_conditions)
449
- !find(:first, :conditions => expand_id_conditions(id_or_conditions)).nil?
450
- rescue ActiveRecord::ActiveRecordError
451
- false
452
- end
453
-
454
- # Creates an object, instantly saves it as a record (if the validation permits it), and returns it. If the save
455
- # fails under validations, the unsaved object is still returned.
456
- def create(attributes = nil)
457
- if attributes.is_a?(Array)
458
- attributes.collect { |attr| create(attr) }
459
- else
460
- object = new(attributes)
461
- object.save
462
- object
463
- end
464
- end
465
-
466
- # Finds the record from the passed +id+, instantly saves it with the passed +attributes+ (if the validation permits it),
467
- # and returns it. If the save fails under validations, the unsaved object is still returned.
468
- #
469
- # The arguments may also be given as arrays in which case the update method is called for each pair of +id+ and
470
- # +attributes+ and an array of objects is returned.
471
- #
472
- # Example of updating one record:
473
- # Person.update(15, {:user_name => 'Samuel', :group => 'expert'})
474
- #
475
- # Example of updating multiple records:
476
- # people = { 1 => { "first_name" => "David" }, 2 => { "first_name" => "Jeremy"} }
477
- # Person.update(people.keys, people.values)
478
- def update(id, attributes)
479
- if id.is_a?(Array)
480
- idx = -1
481
- id.collect { |id| idx += 1; update(id, attributes[idx]) }
482
- else
483
- object = find(id)
484
- object.update_attributes(attributes)
485
- object
486
- end
487
- end
488
-
489
- # Deletes the record with the given +id+ without instantiating an object first. If an array of ids is provided, all of them
490
- # are deleted.
491
- def delete(id)
492
- delete_all([ "#{connection.quote_column_name(primary_key)} IN (?)", id ])
493
- end
494
-
495
- # Destroys the record with the given +id+ by instantiating the object and calling #destroy (all the callbacks are the triggered).
496
- # If an array of ids is provided, all of them are destroyed.
497
- def destroy(id)
498
- id.is_a?(Array) ? id.each { |id| destroy(id) } : find(id).destroy
499
- end
500
-
501
- # Updates all records with the SET-part of an SQL update statement in +updates+ and returns an integer with the number of rows updated.
502
- # A subset of the records can be selected by specifying +conditions+. Example:
503
- # Billing.update_all "category = 'authorized', approved = 1", "author = 'David'"
504
- #
505
- # Optional :order and :limit options may be given as the third parameter,
506
- # but their behavior is database-specific.
507
- def update_all(updates, conditions = nil, options = {})
508
- sql = "UPDATE #{table_name} SET #{sanitize_sql_for_assignment(updates)} "
509
- scope = scope(:find)
510
- add_conditions!(sql, conditions, scope)
511
- add_order!(sql, options[:order], scope)
512
- add_limit!(sql, options, scope)
513
- connection.update(sql, "#{name} Update")
514
- end
515
-
516
- # Destroys the objects for all the records that match the +condition+ by instantiating each object and calling
517
- # the destroy method. Example:
518
- # Person.destroy_all "last_login < '2004-04-04'"
519
- def destroy_all(conditions = nil)
520
- find(:all, :conditions => conditions).each { |object| object.destroy }
521
- end
522
-
523
- # Deletes all the records that match the +condition+ without instantiating the objects first (and hence not
524
- # calling the destroy method). Example:
525
- # Post.delete_all "person_id = 5 AND (category = 'Something' OR category = 'Else')"
526
- def delete_all(conditions = nil)
527
- sql = "DELETE FROM #{table_name} "
528
- add_conditions!(sql, conditions, scope(:find))
529
- connection.delete(sql, "#{name} Delete all")
530
- end
531
-
532
- # Returns the result of an SQL statement that should only include a COUNT(*) in the SELECT part.
533
- # The use of this method should be restricted to complicated SQL queries that can't be executed
534
- # using the ActiveRecord::Calculations class methods. Look into those before using this.
535
- #
536
- # ==== Options
537
- #
538
- # +sql+: An SQL statement which should return a count query from the database, see the example below
539
- #
540
- # ==== Examples
541
- #
542
- # Product.count_by_sql "SELECT COUNT(*) FROM sales s, customers c WHERE s.customer_id = c.id"
543
- def count_by_sql(sql)
544
- sql = sanitize_conditions(sql)
545
- connection.select_value(sql, "#{name} Count").to_i
546
- end
547
-
548
- # A generic "counter updater" implementation, intended primarily to be
549
- # used by increment_counter and decrement_counter, but which may also
550
- # be useful on its own. It simply does a direct SQL update for the record
551
- # with the given ID, altering the given hash of counters by the amount
552
- # given by the corresponding value:
553
- #
554
- # Post.update_counters 5, :comment_count => -1, :action_count => 1
555
- # # UPDATE posts
556
- # # SET comment_count = comment_count - 1,
557
- # # action_count = action_count + 1
558
- # # WHERE id = 5
559
- def update_counters(id, counters)
560
- updates = counters.inject([]) { |list, (counter_name, increment)|
561
- sign = increment < 0 ? "-" : "+"
562
- list << "#{connection.quote_column_name(counter_name)} = #{connection.quote_column_name(counter_name)} #{sign} #{increment.abs}"
563
- }.join(", ")
564
- update_all(updates, "#{connection.quote_column_name(primary_key)} = #{quote_value(id)}")
565
- end
566
-
567
- # Increment a number field by one, usually representing a count.
568
- #
569
- # This is used for caching aggregate values, so that they don't need to be computed every time.
570
- # For example, a DiscussionBoard may cache post_count and comment_count otherwise every time the board is
571
- # shown it would have to run a SQL query to find how many posts and comments there are.
572
- #
573
- # ==== Options
574
- #
575
- # +counter_name+ The name of the field that should be incremented
576
- # +id+ The id of the object that should be incremented
577
- #
578
- # ==== Examples
579
- #
580
- # # Increment the post_count column for the record with an id of 5
581
- # DiscussionBoard.increment_counter(:post_count, 5)
582
- def increment_counter(counter_name, id)
583
- update_counters(id, counter_name => 1)
584
- end
585
-
586
- # Decrement a number field by one, usually representing a count.
587
- #
588
- # This works the same as increment_counter but reduces the column value by 1 instead of increasing it.
589
- #
590
- # ==== Options
591
- #
592
- # +counter_name+ The name of the field that should be decremented
593
- # +id+ The id of the object that should be decremented
594
- #
595
- # ==== Examples
596
- #
597
- # # Decrement the post_count column for the record with an id of 5
598
- # DiscussionBoard.decrement_counter(:post_count, 5)
599
- def decrement_counter(counter_name, id)
600
- update_counters(id, counter_name => -1)
601
- end
602
-
603
-
604
- # Attributes named in this macro are protected from mass-assignment, such as <tt>new(attributes)</tt> and
605
- # <tt>attributes=(attributes)</tt>. Their assignment will simply be ignored. Instead, you can use the direct writer
606
- # methods to do assignment. This is meant to protect sensitive attributes from being overwritten by URL/form hackers. Example:
607
- #
608
- # class Customer < ActiveRecord::Base
609
- # attr_protected :credit_rating
610
- # end
611
- #
612
- # customer = Customer.new("name" => David, "credit_rating" => "Excellent")
613
- # customer.credit_rating # => nil
614
- # customer.attributes = { "description" => "Jolly fellow", "credit_rating" => "Superb" }
615
- # customer.credit_rating # => nil
616
- #
617
- # customer.credit_rating = "Average"
618
- # customer.credit_rating # => "Average"
619
- def attr_protected(*attributes)
620
- write_inheritable_array("attr_protected", attributes - (protected_attributes || []))
621
- end
622
-
623
- # Returns an array of all the attributes that have been protected from mass-assignment.
624
- def protected_attributes # :nodoc:
625
- read_inheritable_attribute("attr_protected")
626
- end
627
-
628
- # If this macro is used, only those attributes named in it will be accessible for mass-assignment, such as
629
- # <tt>new(attributes)</tt> and <tt>attributes=(attributes)</tt>. This is the more conservative choice for mass-assignment
630
- # protection. If you'd rather start from an all-open default and restrict attributes as needed, have a look at
631
- # attr_protected.
632
- def attr_accessible(*attributes)
633
- write_inheritable_array("attr_accessible", attributes - (accessible_attributes || []))
634
- end
635
-
636
- # Returns an array of all the attributes that have been made accessible to mass-assignment.
637
- def accessible_attributes # :nodoc:
638
- read_inheritable_attribute("attr_accessible")
639
- end
640
-
641
-
642
- # Specifies that the attribute by the name of +attr_name+ should be serialized before saving to the database and unserialized
643
- # after loading from the database. The serialization is done through YAML. If +class_name+ is specified, the serialized
644
- # object must be of that class on retrieval or +SerializationTypeMismatch+ will be raised.
645
- def serialize(attr_name, class_name = Object)
646
- serialized_attributes[attr_name.to_s] = class_name
647
- end
648
-
649
- # Returns a hash of all the attributes that have been specified for serialization as keys and their class restriction as values.
650
- def serialized_attributes
651
- read_inheritable_attribute("attr_serialized") or write_inheritable_attribute("attr_serialized", {})
652
- end
653
-
654
-
655
- # Guesses the table name (in forced lower-case) based on the name of the class in the inheritance hierarchy descending
656
- # directly from ActiveRecord. So if the hierarchy looks like: Reply < Message < ActiveRecord, then Message is used
657
- # to guess the table name from even when called on Reply. The rules used to do the guess are handled by the Inflector class
658
- # in Active Support, which knows almost all common English inflections (report a bug if your inflection isn't covered).
659
- #
660
- # Nested classes are given table names prefixed by the singular form of
661
- # the parent's table name. Example:
662
- # file class table_name
663
- # invoice.rb Invoice invoices
664
- # invoice/lineitem.rb Invoice::Lineitem invoice_lineitems
665
- #
666
- # Additionally, the class-level table_name_prefix is prepended and the
667
- # table_name_suffix is appended. So if you have "myapp_" as a prefix,
668
- # the table name guess for an Invoice class becomes "myapp_invoices".
669
- # Invoice::Lineitem becomes "myapp_invoice_lineitems".
670
- #
671
- # You can also overwrite this class method to allow for unguessable
672
- # links, such as a Mouse class with a link to a "mice" table. Example:
673
- #
674
- # class Mouse < ActiveRecord::Base
675
- # set_table_name "mice"
676
- # end
677
- def table_name
678
- reset_table_name
679
- end
680
-
681
- def reset_table_name #:nodoc:
682
- base = base_class
683
-
684
- name =
685
- # STI subclasses always use their superclass' table.
686
- unless self == base
687
- base.table_name
688
- else
689
- # Nested classes are prefixed with singular parent table name.
690
- if parent < ActiveRecord::Base && !parent.abstract_class?
691
- contained = parent.table_name
692
- contained = contained.singularize if parent.pluralize_table_names
693
- contained << '_'
694
- end
695
- name = "#{table_name_prefix}#{contained}#{undecorated_table_name(base.name)}#{table_name_suffix}"
696
- end
697
-
698
- set_table_name(name)
699
- name
700
- end
701
-
702
- # Defines the primary key field -- can be overridden in subclasses. Overwriting will negate any effect of the
703
- # primary_key_prefix_type setting, though.
704
- def primary_key
705
- reset_primary_key
706
- end
707
-
708
- def reset_primary_key #:nodoc:
709
- key = 'id'
710
- case primary_key_prefix_type
711
- when :table_name
712
- key = Inflector.foreign_key(base_class.name, false)
713
- when :table_name_with_underscore
714
- key = Inflector.foreign_key(base_class.name)
715
- end
716
- set_primary_key(key)
717
- key
718
- end
719
-
720
- # Defines the column name for use with single table inheritance
721
- # -- can be set in subclasses like so: self.inheritance_column = "type_id"
722
- def inheritance_column
723
- @inheritance_column ||= "type".freeze
724
- end
725
-
726
- # Lazy-set the sequence name to the connection's default. This method
727
- # is only ever called once since set_sequence_name overrides it.
728
- def sequence_name #:nodoc:
729
- reset_sequence_name
730
- end
731
-
732
- def reset_sequence_name #:nodoc:
733
- default = connection.default_sequence_name(table_name, primary_key)
734
- set_sequence_name(default)
735
- default
736
- end
737
-
738
- # Sets the table name to use to the given value, or (if the value
739
- # is nil or false) to the value returned by the given block.
740
- #
741
- # Example:
742
- #
743
- # class Project < ActiveRecord::Base
744
- # set_table_name "project"
745
- # end
746
- def set_table_name(value = nil, &block)
747
- define_attr_method :table_name, value, &block
748
- end
749
- alias :table_name= :set_table_name
750
-
751
- # Sets the name of the primary key column to use to the given value,
752
- # or (if the value is nil or false) to the value returned by the given
753
- # block.
754
- #
755
- # Example:
756
- #
757
- # class Project < ActiveRecord::Base
758
- # set_primary_key "sysid"
759
- # end
760
- def set_primary_key(value = nil, &block)
761
- define_attr_method :primary_key, value, &block
762
- end
763
- alias :primary_key= :set_primary_key
764
-
765
- # Sets the name of the inheritance column to use to the given value,
766
- # or (if the value # is nil or false) to the value returned by the
767
- # given block.
768
- #
769
- # Example:
770
- #
771
- # class Project < ActiveRecord::Base
772
- # set_inheritance_column do
773
- # original_inheritance_column + "_id"
774
- # end
775
- # end
776
- def set_inheritance_column(value = nil, &block)
777
- define_attr_method :inheritance_column, value, &block
778
- end
779
- alias :inheritance_column= :set_inheritance_column
780
-
781
- # Sets the name of the sequence to use when generating ids to the given
782
- # value, or (if the value is nil or false) to the value returned by the
783
- # given block. This is required for Oracle and is useful for any
784
- # database which relies on sequences for primary key generation.
785
- #
786
- # If a sequence name is not explicitly set when using Oracle or Firebird,
787
- # it will default to the commonly used pattern of: #{table_name}_seq
788
- #
789
- # If a sequence name is not explicitly set when using PostgreSQL, it
790
- # will discover the sequence corresponding to your primary key for you.
791
- #
792
- # Example:
793
- #
794
- # class Project < ActiveRecord::Base
795
- # set_sequence_name "projectseq" # default would have been "project_seq"
796
- # end
797
- def set_sequence_name(value = nil, &block)
798
- define_attr_method :sequence_name, value, &block
799
- end
800
- alias :sequence_name= :set_sequence_name
801
-
802
- # Turns the +table_name+ back into a class name following the reverse rules of +table_name+.
803
- def class_name(table_name = table_name) # :nodoc:
804
- # remove any prefix and/or suffix from the table name
805
- class_name = table_name[table_name_prefix.length..-(table_name_suffix.length + 1)].camelize
806
- class_name = class_name.singularize if pluralize_table_names
807
- class_name
808
- end
809
-
810
- # Indicates whether the table associated with this class exists
811
- def table_exists?
812
- if connection.respond_to?(:tables)
813
- connection.tables.include? table_name
814
- else
815
- # if the connection adapter hasn't implemented tables, there are two crude tests that can be
816
- # used - see if getting column info raises an error, or if the number of columns returned is zero
817
- begin
818
- reset_column_information
819
- columns.size > 0
820
- rescue ActiveRecord::StatementInvalid
821
- false
822
- end
823
- end
824
- end
825
-
826
- # Returns an array of column objects for the table associated with this class.
827
- def columns
828
- unless @columns
829
- @columns = connection.columns(table_name, "#{name} Columns")
830
- @columns.each {|column| column.primary = column.name == primary_key}
831
- end
832
- @columns
833
- end
834
-
835
- # Returns a hash of column objects for the table associated with this class.
836
- def columns_hash
837
- @columns_hash ||= columns.inject({}) { |hash, column| hash[column.name] = column; hash }
838
- end
839
-
840
- # Returns an array of column names as strings.
841
- def column_names
842
- @column_names ||= columns.map { |column| column.name }
843
- end
844
-
845
- # Returns an array of column objects where the primary id, all columns ending in "_id" or "_count",
846
- # and columns used for single table inheritance have been removed.
847
- def content_columns
848
- @content_columns ||= columns.reject { |c| c.primary || c.name =~ /(_id|_count)$/ || c.name == inheritance_column }
849
- end
850
-
851
- # 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
852
- # 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
853
- # is available.
854
- def column_methods_hash #:nodoc:
855
- @dynamic_methods_hash ||= column_names.inject(Hash.new(false)) do |methods, attr|
856
- attr_name = attr.to_s
857
- methods[attr.to_sym] = attr_name
858
- methods["#{attr}=".to_sym] = attr_name
859
- methods["#{attr}?".to_sym] = attr_name
860
- methods["#{attr}_before_type_cast".to_sym] = attr_name
861
- methods
862
- end
863
- end
864
-
865
- # Contains the names of the generated reader methods.
866
- def read_methods #:nodoc:
867
- @read_methods ||= Set.new
868
- end
869
-
870
- # Resets all the cached information about columns, which will cause them to be reloaded on the next request.
871
- def reset_column_information
872
- read_methods.each { |name| undef_method(name) }
873
- @column_names = @columns = @columns_hash = @content_columns = @dynamic_methods_hash = @read_methods = @inheritance_column = nil
874
- end
875
-
876
- def reset_column_information_and_inheritable_attributes_for_all_subclasses#:nodoc:
877
- subclasses.each { |klass| klass.reset_inheritable_attributes; klass.reset_column_information }
878
- end
879
-
880
- # Transforms attribute key names into a more humane format, such as "First name" instead of "first_name". Example:
881
- # Person.human_attribute_name("first_name") # => "First name"
882
- # Deprecated in favor of just calling "first_name".humanize
883
- def human_attribute_name(attribute_key_name) #:nodoc:
884
- attribute_key_name.humanize
885
- end
886
-
887
- # True if this isn't a concrete subclass needing a STI type condition.
888
- def descends_from_active_record?
889
- if superclass.abstract_class?
890
- superclass.descends_from_active_record?
891
- else
892
- superclass == Base || !columns_hash.include?(inheritance_column)
893
- end
894
- end
895
-
896
- # Returns a string looking like: #<Post id:integer, title:string, body:text>
897
- def inspect
898
- "#<#{name} #{columns.collect { |c| "#{c.name}:#{c.type}" }.join(", ")}>"
899
- end
900
-
901
-
902
- def quote_value(value, column = nil) #:nodoc:
903
- connection.quote(value,column)
904
- end
905
-
906
- def quote(value, column = nil) #:nodoc:
907
- connection.quote(value, column)
908
- end
909
- deprecate :quote => :quote_value
910
-
911
- # Used to sanitize objects before they're used in an SELECT SQL-statement. Delegates to <tt>connection.quote</tt>.
912
- def sanitize(object) #:nodoc:
913
- connection.quote(object)
914
- end
915
-
916
- # Log and benchmark multiple statements in a single block. Example:
917
- #
918
- # Project.benchmark("Creating project") do
919
- # project = Project.create("name" => "stuff")
920
- # project.create_manager("name" => "David")
921
- # project.milestones << Milestone.find(:all)
922
- # end
923
- #
924
- # The benchmark is only recorded if the current level of the logger matches the <tt>log_level</tt>, which makes it
925
- # easy to include benchmarking statements in production software that will remain inexpensive because the benchmark
926
- # will only be conducted if the log level is low enough.
927
- #
928
- # The logging of the multiple statements is turned off unless <tt>use_silence</tt> is set to false.
929
- def benchmark(title, log_level = Logger::DEBUG, use_silence = true)
930
- if logger && logger.level == log_level
931
- result = nil
932
- seconds = Benchmark.realtime { result = use_silence ? silence { yield } : yield }
933
- logger.add(log_level, "#{title} (#{'%.5f' % seconds})")
934
- result
935
- else
936
- yield
937
- end
938
- end
939
-
940
- # Silences the logger for the duration of the block.
941
- def silence
942
- old_logger_level, logger.level = logger.level, Logger::ERROR if logger
943
- yield
944
- ensure
945
- logger.level = old_logger_level if logger
946
- end
947
-
948
- # Scope parameters to method calls within the block. Takes a hash of method_name => parameters hash.
949
- # method_name may be :find or :create. :find parameters may include the <tt>:conditions</tt>, <tt>:joins</tt>,
950
- # <tt>:include</tt>, <tt>:offset</tt>, <tt>:limit</tt>, and <tt>:readonly</tt> options. :create parameters are an attributes hash.
951
- #
952
- # Article.with_scope(:find => { :conditions => "blog_id = 1" }, :create => { :blog_id => 1 }) do
953
- # Article.find(1) # => SELECT * from articles WHERE blog_id = 1 AND id = 1
954
- # a = Article.create(1)
955
- # a.blog_id # => 1
956
- # end
957
- #
958
- # In nested scopings, all previous parameters are overwritten by inner rule
959
- # except :conditions in :find, that are merged as hash.
960
- #
961
- # Article.with_scope(:find => { :conditions => "blog_id = 1", :limit => 1 }, :create => { :blog_id => 1 }) do
962
- # Article.with_scope(:find => { :limit => 10})
963
- # Article.find(:all) # => SELECT * from articles WHERE blog_id = 1 LIMIT 10
964
- # end
965
- # Article.with_scope(:find => { :conditions => "author_id = 3" })
966
- # Article.find(:all) # => SELECT * from articles WHERE blog_id = 1 AND author_id = 3 LIMIT 1
967
- # end
968
- # end
969
- #
970
- # You can ignore any previous scopings by using <tt>with_exclusive_scope</tt> method.
971
- #
972
- # Article.with_scope(:find => { :conditions => "blog_id = 1", :limit => 1 }) do
973
- # Article.with_exclusive_scope(:find => { :limit => 10 })
974
- # Article.find(:all) # => SELECT * from articles LIMIT 10
975
- # end
976
- # end
977
- def with_scope(method_scoping = {}, action = :merge, &block)
978
- method_scoping = method_scoping.method_scoping if method_scoping.respond_to?(:method_scoping)
979
-
980
- # Dup first and second level of hash (method and params).
981
- method_scoping = method_scoping.inject({}) do |hash, (method, params)|
982
- hash[method] = (params == true) ? params : params.dup
983
- hash
984
- end
985
-
986
- method_scoping.assert_valid_keys([ :find, :create ])
987
-
988
- if f = method_scoping[:find]
989
- f.assert_valid_keys([ :conditions, :joins, :select, :include, :from, :offset, :limit, :order, :readonly, :lock ])
990
- set_readonly_option! f
991
- end
992
-
993
- # Merge scopings
994
- if action == :merge && current_scoped_methods
995
- method_scoping = current_scoped_methods.inject(method_scoping) do |hash, (method, params)|
996
- case hash[method]
997
- when Hash
998
- if method == :find
999
- (hash[method].keys + params.keys).uniq.each do |key|
1000
- merge = hash[method][key] && params[key] # merge if both scopes have the same key
1001
- if key == :conditions && merge
1002
- hash[method][key] = [params[key], hash[method][key]].collect{ |sql| "( %s )" % sanitize_sql(sql) }.join(" AND ")
1003
- elsif key == :include && merge
1004
- hash[method][key] = merge_includes(hash[method][key], params[key]).uniq
1005
- else
1006
- hash[method][key] = hash[method][key] || params[key]
1007
- end
1008
- end
1009
- else
1010
- hash[method] = params.merge(hash[method])
1011
- end
1012
- else
1013
- hash[method] = params
1014
- end
1015
- hash
1016
- end
1017
- end
1018
-
1019
- self.scoped_methods << method_scoping
1020
-
1021
- begin
1022
- yield
1023
- ensure
1024
- self.scoped_methods.pop
1025
- end
1026
- end
1027
-
1028
- # Works like with_scope, but discards any nested properties.
1029
- def with_exclusive_scope(method_scoping = {}, &block)
1030
- with_scope(method_scoping, :overwrite, &block)
1031
- end
1032
-
1033
- # Overwrite the default class equality method to provide support for association proxies.
1034
- def ===(object)
1035
- object.is_a?(self)
1036
- end
1037
-
1038
- # Deprecated
1039
- def threaded_connections #:nodoc:
1040
- allow_concurrency
1041
- end
1042
-
1043
- # Deprecated
1044
- def threaded_connections=(value) #:nodoc:
1045
- self.allow_concurrency = value
1046
- end
1047
-
1048
- # Returns the base AR subclass that this class descends from. If A
1049
- # extends AR::Base, A.base_class will return A. If B descends from A
1050
- # through some arbitrarily deep hierarchy, B.base_class will return A.
1051
- def base_class
1052
- class_of_active_record_descendant(self)
1053
- end
1054
-
1055
- # Set this to true if this is an abstract class (see #abstract_class?).
1056
- attr_accessor :abstract_class
1057
-
1058
- # Returns whether this class is a base AR class. If A is a base class and
1059
- # B descends from A, then B.base_class will return B.
1060
- def abstract_class?
1061
- abstract_class == true
1062
- end
1063
-
1064
- private
1065
- def find_initial(options)
1066
- options.update(:limit => 1) unless options[:include]
1067
- find_every(options).first
1068
- end
1069
-
1070
- def find_every(options)
1071
- records = scoped?(:find, :include) || options[:include] ?
1072
- find_with_associations(options) :
1073
- find_by_sql(construct_finder_sql(options))
1074
-
1075
- records.each { |record| record.readonly! } if options[:readonly]
1076
-
1077
- records
1078
- end
1079
-
1080
- def find_from_ids(ids, options)
1081
- expects_array = ids.first.kind_of?(Array)
1082
- return ids.first if expects_array && ids.first.empty?
1083
-
1084
- ids = ids.flatten.compact.uniq
1085
-
1086
- case ids.size
1087
- when 0
1088
- raise RecordNotFound, "Couldn't find #{name} without an ID"
1089
- when 1
1090
- result = find_one(ids.first, options)
1091
- expects_array ? [ result ] : result
1092
- else
1093
- find_some(ids, options)
1094
- end
1095
- end
1096
-
1097
- def find_one(id, options)
1098
- conditions = " AND (#{sanitize_sql(options[:conditions])})" if options[:conditions]
1099
- options.update :conditions => "#{table_name}.#{connection.quote_column_name(primary_key)} = #{quote_value(id,columns_hash[primary_key])}#{conditions}"
1100
-
1101
- # Use find_every(options).first since the primary key condition
1102
- # already ensures we have a single record. Using find_initial adds
1103
- # a superfluous :limit => 1.
1104
- if result = find_every(options).first
1105
- result
1106
- else
1107
- raise RecordNotFound, "Couldn't find #{name} with ID=#{id}#{conditions}"
1108
- end
1109
- end
1110
-
1111
- def find_some(ids, options)
1112
- conditions = " AND (#{sanitize_sql(options[:conditions])})" if options[:conditions]
1113
- ids_list = ids.map { |id| quote_value(id,columns_hash[primary_key]) }.join(',')
1114
- options.update :conditions => "#{table_name}.#{connection.quote_column_name(primary_key)} IN (#{ids_list})#{conditions}"
1115
-
1116
- result = find_every(options)
1117
-
1118
- if result.size == ids.size
1119
- result
1120
- else
1121
- raise RecordNotFound, "Couldn't find all #{name.pluralize} with IDs (#{ids_list})#{conditions}"
1122
- end
1123
- end
1124
-
1125
- # Finder methods must instantiate through this method to work with the
1126
- # single-table inheritance model that makes it possible to create
1127
- # objects of different types from the same table.
1128
- def instantiate(record)
1129
- object =
1130
- if subclass_name = record[inheritance_column]
1131
- # No type given.
1132
- if subclass_name.empty?
1133
- allocate
1134
-
1135
- else
1136
- # Ignore type if no column is present since it was probably
1137
- # pulled in from a sloppy join.
1138
- unless columns_hash.include?(inheritance_column)
1139
- allocate
1140
-
1141
- else
1142
- begin
1143
- compute_type(subclass_name).allocate
1144
- rescue NameError
1145
- raise SubclassNotFound,
1146
- "The single-table inheritance mechanism failed to locate the subclass: '#{record[inheritance_column]}'. " +
1147
- "This error is raised because the column '#{inheritance_column}' is reserved for storing the class in case of inheritance. " +
1148
- "Please rename this column if you didn't intend it to be used for storing the inheritance class " +
1149
- "or overwrite #{self.to_s}.inheritance_column to use another column for that information."
1150
- end
1151
- end
1152
- end
1153
- else
1154
- allocate
1155
- end
1156
-
1157
- object.instance_variable_set("@attributes", record)
1158
- object
1159
- end
1160
-
1161
- # Nest the type name in the same module as this class.
1162
- # Bar is "MyApp::Business::Bar" relative to MyApp::Business::Foo
1163
- def type_name_with_module(type_name)
1164
- (/^::/ =~ type_name) ? type_name : "#{parent.name}::#{type_name}"
1165
- end
1166
-
1167
- def construct_finder_sql(options)
1168
- scope = scope(:find)
1169
- sql = "SELECT #{(scope && scope[:select]) || options[:select] || '*'} "
1170
- sql << "FROM #{(scope && scope[:from]) || options[:from] || table_name} "
1171
-
1172
- add_joins!(sql, options, scope)
1173
- add_conditions!(sql, options[:conditions], scope)
1174
-
1175
- sql << " GROUP BY #{options[:group]} " if options[:group]
1176
-
1177
- add_order!(sql, options[:order], scope)
1178
- add_limit!(sql, options, scope)
1179
- add_lock!(sql, options, scope)
1180
-
1181
- sql
1182
- end
1183
-
1184
- # Merges includes so that the result is a valid +include+
1185
- def merge_includes(first, second)
1186
- (safe_to_array(first) + safe_to_array(second)).uniq
1187
- end
1188
-
1189
- # Object#to_a is deprecated, though it does have the desired behavior
1190
- def safe_to_array(o)
1191
- case o
1192
- when NilClass
1193
- []
1194
- when Array
1195
- o
1196
- else
1197
- [o]
1198
- end
1199
- end
1200
-
1201
- def add_order!(sql, order, scope = :auto)
1202
- scope = scope(:find) if :auto == scope
1203
- scoped_order = scope[:order] if scope
1204
- if order
1205
- sql << " ORDER BY #{order}"
1206
- sql << ", #{scoped_order}" if scoped_order
1207
- else
1208
- sql << " ORDER BY #{scoped_order}" if scoped_order
1209
- end
1210
- end
1211
-
1212
- # The optional scope argument is for the current :find scope.
1213
- def add_limit!(sql, options, scope = :auto)
1214
- scope = scope(:find) if :auto == scope
1215
- options = options.reverse_merge(:limit => scope[:limit], :offset => scope[:offset]) if scope
1216
- connection.add_limit_offset!(sql, options)
1217
- end
1218
-
1219
- # The optional scope argument is for the current :find scope.
1220
- # The :lock option has precedence over a scoped :lock.
1221
- def add_lock!(sql, options, scope = :auto)
1222
- scope = scope(:find) if :auto == scope
1223
- options = options.reverse_merge(:lock => scope[:lock]) if scope
1224
- connection.add_lock!(sql, options)
1225
- end
1226
-
1227
- # The optional scope argument is for the current :find scope.
1228
- def add_joins!(sql, options, scope = :auto)
1229
- scope = scope(:find) if :auto == scope
1230
- join = (scope && scope[:joins]) || options[:joins]
1231
- sql << " #{join} " if join
1232
- end
1233
-
1234
- # Adds a sanitized version of +conditions+ to the +sql+ string. Note that the passed-in +sql+ string is changed.
1235
- # The optional scope argument is for the current :find scope.
1236
- def add_conditions!(sql, conditions, scope = :auto)
1237
- scope = scope(:find) if :auto == scope
1238
- segments = []
1239
- segments << sanitize_sql(scope[:conditions]) if scope && scope[:conditions]
1240
- segments << sanitize_sql(conditions) unless conditions.nil?
1241
- segments << type_condition unless descends_from_active_record?
1242
- segments.compact!
1243
- sql << "WHERE (#{segments.join(") AND (")}) " unless segments.empty?
1244
- end
1245
-
1246
- def type_condition
1247
- quoted_inheritance_column = connection.quote_column_name(inheritance_column)
1248
- type_condition = subclasses.inject("#{table_name}.#{quoted_inheritance_column} = '#{name.demodulize}' ") do |condition, subclass|
1249
- condition << "OR #{table_name}.#{quoted_inheritance_column} = '#{subclass.name.demodulize}' "
1250
- end
1251
-
1252
- " (#{type_condition}) "
1253
- end
1254
-
1255
- # Guesses the table name, but does not decorate it with prefix and suffix information.
1256
- def undecorated_table_name(class_name = base_class.name)
1257
- table_name = Inflector.underscore(Inflector.demodulize(class_name))
1258
- table_name = Inflector.pluralize(table_name) if pluralize_table_names
1259
- table_name
1260
- end
1261
-
1262
- # Enables dynamic finders like find_by_user_name(user_name) and find_by_user_name_and_password(user_name, password) that are turned into
1263
- # find(:first, :conditions => ["user_name = ?", user_name]) and find(:first, :conditions => ["user_name = ? AND password = ?", user_name, password])
1264
- # respectively. Also works for find(:all), but using find_all_by_amount(50) that are turned into find(:all, :conditions => ["amount = ?", 50]).
1265
- #
1266
- # It's even possible to use all the additional parameters to find. For example, the full interface for find_all_by_amount
1267
- # is actually find_all_by_amount(amount, options).
1268
- #
1269
- # This also enables you to initialize a record if it is not found, such as find_or_initialize_by_amount(amount)
1270
- # or find_or_create_by_user_and_password(user, password).
1271
- def method_missing(method_id, *arguments)
1272
- if match = /^find_(all_by|by)_([_a-zA-Z]\w*)$/.match(method_id.to_s)
1273
- finder, deprecated_finder = determine_finder(match), determine_deprecated_finder(match)
1274
-
1275
- attribute_names = extract_attribute_names_from_match(match)
1276
- super unless all_attributes_exists?(attribute_names)
1277
-
1278
- attributes = construct_attributes_from_arguments(attribute_names, arguments)
1279
-
1280
- case extra_options = arguments[attribute_names.size]
1281
- when nil
1282
- options = { :conditions => attributes }
1283
- set_readonly_option!(options)
1284
- ActiveSupport::Deprecation.silence { send(finder, options) }
1285
-
1286
- when Hash
1287
- finder_options = extra_options.merge(:conditions => attributes)
1288
- validate_find_options(finder_options)
1289
- set_readonly_option!(finder_options)
1290
-
1291
- if extra_options[:conditions]
1292
- with_scope(:find => { :conditions => extra_options[:conditions] }) do
1293
- ActiveSupport::Deprecation.silence { send(finder, finder_options) }
1294
- end
1295
- else
1296
- ActiveSupport::Deprecation.silence { send(finder, finder_options) }
1297
- end
1298
-
1299
- else
1300
- ActiveSupport::Deprecation.silence do
1301
- send(deprecated_finder, sanitize_sql(attributes), *arguments[attribute_names.length..-1])
1302
- end
1303
- end
1304
- elsif match = /^find_or_(initialize|create)_by_([_a-zA-Z]\w*)$/.match(method_id.to_s)
1305
- instantiator = determine_instantiator(match)
1306
- attribute_names = extract_attribute_names_from_match(match)
1307
- super unless all_attributes_exists?(attribute_names)
1308
-
1309
- if arguments[0].is_a?(Hash)
1310
- attributes = arguments[0].with_indifferent_access
1311
- find_attributes = attributes.slice(*attribute_names)
1312
- else
1313
- find_attributes = attributes = construct_attributes_from_arguments(attribute_names, arguments)
1314
- end
1315
- options = { :conditions => find_attributes }
1316
- set_readonly_option!(options)
1317
-
1318
- find_initial(options) || send(instantiator, attributes)
1319
- else
1320
- super
1321
- end
1322
- end
1323
-
1324
- def determine_finder(match)
1325
- match.captures.first == 'all_by' ? :find_every : :find_initial
1326
- end
1327
-
1328
- def determine_deprecated_finder(match)
1329
- match.captures.first == 'all_by' ? :find_all : :find_first
1330
- end
1331
-
1332
- def determine_instantiator(match)
1333
- match.captures.first == 'initialize' ? :new : :create
1334
- end
1335
-
1336
- def extract_attribute_names_from_match(match)
1337
- match.captures.last.split('_and_')
1338
- end
1339
-
1340
- def construct_attributes_from_arguments(attribute_names, arguments)
1341
- attributes = {}
1342
- attribute_names.each_with_index { |name, idx| attributes[name] = arguments[idx] }
1343
- attributes
1344
- end
1345
-
1346
- def all_attributes_exists?(attribute_names)
1347
- attribute_names.all? { |name| column_methods_hash.include?(name.to_sym) }
1348
- end
1349
-
1350
- def attribute_condition(argument)
1351
- case argument
1352
- when nil then "IS ?"
1353
- when Array then "IN (?)"
1354
- when Range then "BETWEEN ? AND ?"
1355
- else "= ?"
1356
- end
1357
- end
1358
-
1359
- # Interpret Array and Hash as conditions and anything else as an id.
1360
- def expand_id_conditions(id_or_conditions)
1361
- case id_or_conditions
1362
- when Array, Hash then id_or_conditions
1363
- else sanitize_sql(primary_key => id_or_conditions)
1364
- end
1365
- end
1366
-
1367
-
1368
- # Defines an "attribute" method (like #inheritance_column or
1369
- # #table_name). A new (class) method will be created with the
1370
- # given name. If a value is specified, the new method will
1371
- # return that value (as a string). Otherwise, the given block
1372
- # will be used to compute the value of the method.
1373
- #
1374
- # The original method will be aliased, with the new name being
1375
- # prefixed with "original_". This allows the new method to
1376
- # access the original value.
1377
- #
1378
- # Example:
1379
- #
1380
- # class A < ActiveRecord::Base
1381
- # define_attr_method :primary_key, "sysid"
1382
- # define_attr_method( :inheritance_column ) do
1383
- # original_inheritance_column + "_id"
1384
- # end
1385
- # end
1386
- def define_attr_method(name, value=nil, &block)
1387
- sing = class << self; self; end
1388
- sing.send :alias_method, "original_#{name}", name
1389
- if block_given?
1390
- sing.send :define_method, name, &block
1391
- else
1392
- # use eval instead of a block to work around a memory leak in dev
1393
- # mode in fcgi
1394
- sing.class_eval "def #{name}; #{value.to_s.inspect}; end"
1395
- end
1396
- end
1397
-
1398
- protected
1399
- def subclasses #:nodoc:
1400
- @@subclasses[self] ||= []
1401
- @@subclasses[self] + extra = @@subclasses[self].inject([]) {|list, subclass| list + subclass.subclasses }
1402
- end
1403
-
1404
- # Test whether the given method and optional key are scoped.
1405
- def scoped?(method, key = nil) #:nodoc:
1406
- if current_scoped_methods && (scope = current_scoped_methods[method])
1407
- !key || scope.has_key?(key)
1408
- end
1409
- end
1410
-
1411
- # Retrieve the scope for the given method and optional key.
1412
- def scope(method, key = nil) #:nodoc:
1413
- if current_scoped_methods && (scope = current_scoped_methods[method])
1414
- key ? scope[key] : scope
1415
- end
1416
- end
1417
-
1418
- def thread_safe_scoped_methods #:nodoc:
1419
- scoped_methods = (Thread.current[:scoped_methods] ||= {})
1420
- scoped_methods[self] ||= []
1421
- end
1422
-
1423
- def single_threaded_scoped_methods #:nodoc:
1424
- @scoped_methods ||= []
1425
- end
1426
-
1427
- # pick up the correct scoped_methods version from @@allow_concurrency
1428
- if @@allow_concurrency
1429
- alias_method :scoped_methods, :thread_safe_scoped_methods
1430
- else
1431
- alias_method :scoped_methods, :single_threaded_scoped_methods
1432
- end
1433
-
1434
- def current_scoped_methods #:nodoc:
1435
- scoped_methods.last
1436
- end
1437
-
1438
- # Returns the class type of the record using the current module as a prefix. So descendents of
1439
- # MyApp::Business::Account would appear as MyApp::Business::AccountSubclass.
1440
- def compute_type(type_name)
1441
- modularized_name = type_name_with_module(type_name)
1442
- begin
1443
- class_eval(modularized_name, __FILE__, __LINE__)
1444
- rescue NameError
1445
- class_eval(type_name, __FILE__, __LINE__)
1446
- end
1447
- end
1448
-
1449
- # Returns the class descending directly from ActiveRecord in the inheritance hierarchy.
1450
- def class_of_active_record_descendant(klass)
1451
- if klass.superclass == Base || klass.superclass.abstract_class?
1452
- klass
1453
- elsif klass.superclass.nil?
1454
- raise ActiveRecordError, "#{name} doesn't belong in a hierarchy descending from ActiveRecord"
1455
- else
1456
- class_of_active_record_descendant(klass.superclass)
1457
- end
1458
- end
1459
-
1460
- # Returns the name of the class descending directly from ActiveRecord in the inheritance hierarchy.
1461
- def class_name_of_active_record_descendant(klass) #:nodoc:
1462
- klass.base_class.name
1463
- end
1464
-
1465
- # Accepts an array, hash, or string of sql conditions and sanitizes
1466
- # them into a valid SQL fragment for a WHERE clause.
1467
- # ["name='%s' and group_id='%s'", "foo'bar", 4] returns "name='foo''bar' and group_id='4'"
1468
- # { :name => "foo'bar", :group_id => 4 } returns "name='foo''bar' and group_id='4'"
1469
- # "name='foo''bar' and group_id='4'" returns "name='foo''bar' and group_id='4'"
1470
- def sanitize_sql_for_conditions(condition)
1471
- case condition
1472
- when Array; sanitize_sql_array(condition)
1473
- when Hash; sanitize_sql_hash_for_conditions(condition)
1474
- else condition
1475
- end
1476
- end
1477
- alias_method :sanitize_sql, :sanitize_sql_for_conditions
1478
-
1479
- # Accepts an array, hash, or string of sql conditions and sanitizes
1480
- # them into a valid SQL fragment for a SET clause.
1481
- # { :name => nil, :group_id => 4 } returns "name = NULL , group_id='4'"
1482
- def sanitize_sql_for_assignment(assignments)
1483
- case assignments
1484
- when Array; sanitize_sql_array(assignments)
1485
- when Hash; sanitize_sql_hash_for_assignment(assignments)
1486
- else assignments
1487
- end
1488
- end
1489
-
1490
- # Sanitizes a hash of attribute/value pairs into SQL conditions for a WHERE clause.
1491
- # { :name => "foo'bar", :group_id => 4 }
1492
- # # => "name='foo''bar' and group_id= 4"
1493
- # { :status => nil, :group_id => [1,2,3] }
1494
- # # => "status IS NULL and group_id IN (1,2,3)"
1495
- # { :age => 13..18 }
1496
- # # => "age BETWEEN 13 AND 18"
1497
- def sanitize_sql_hash_for_conditions(attrs)
1498
- conditions = attrs.map do |attr, value|
1499
- "#{table_name}.#{connection.quote_column_name(attr)} #{attribute_condition(value)}"
1500
- end.join(' AND ')
1501
-
1502
- replace_bind_variables(conditions, expand_range_bind_variables(attrs.values))
1503
- end
1504
- alias_method :sanitize_sql_hash, :sanitize_sql_hash_for_conditions
1505
-
1506
- # Sanitizes a hash of attribute/value pairs into SQL conditions for a SET clause.
1507
- # { :status => nil, :group_id => 1 }
1508
- # # => "status = NULL , group_id = 1"
1509
- def sanitize_sql_hash_for_assignment(attrs)
1510
- conditions = attrs.map do |attr, value|
1511
- "#{connection.quote_column_name(attr)} = #{quote_bound_value(value)}"
1512
- end.join(', ')
1513
- end
1514
-
1515
- # Accepts an array of conditions. The array has each value
1516
- # sanitized and interpolated into the sql statement.
1517
- # ["name='%s' and group_id='%s'", "foo'bar", 4] returns "name='foo''bar' and group_id='4'"
1518
- def sanitize_sql_array(ary)
1519
- statement, *values = ary
1520
- if values.first.is_a?(Hash) and statement =~ /:\w+/
1521
- replace_named_bind_variables(statement, values.first)
1522
- elsif statement.include?('?')
1523
- replace_bind_variables(statement, values)
1524
- else
1525
- statement % values.collect { |value| connection.quote_string(value.to_s) }
1526
- end
1527
- end
1528
-
1529
- alias_method :sanitize_conditions, :sanitize_sql
1530
-
1531
- def replace_bind_variables(statement, values) #:nodoc:
1532
- raise_if_bind_arity_mismatch(statement, statement.count('?'), values.size)
1533
- bound = values.dup
1534
- statement.gsub('?') { quote_bound_value(bound.shift) }
1535
- end
1536
-
1537
- def replace_named_bind_variables(statement, bind_vars) #:nodoc:
1538
- statement.gsub(/:(\w+)/) do
1539
- match = $1.to_sym
1540
- if bind_vars.include?(match)
1541
- quote_bound_value(bind_vars[match])
1542
- else
1543
- raise PreparedStatementInvalid, "missing value for :#{match} in #{statement}"
1544
- end
1545
- end
1546
- end
1547
-
1548
- def expand_range_bind_variables(bind_vars) #:nodoc:
1549
- bind_vars.each_with_index do |var, index|
1550
- bind_vars[index, 1] = [var.first, var.last] if var.is_a?(Range)
1551
- end
1552
- bind_vars
1553
- end
1554
-
1555
- def quote_bound_value(value) #:nodoc:
1556
- if value.respond_to?(:map) && !value.is_a?(String)
1557
- if value.respond_to?(:empty?) && value.empty?
1558
- connection.quote(nil)
1559
- else
1560
- value.map { |v| connection.quote(v) }.join(',')
1561
- end
1562
- else
1563
- connection.quote(value)
1564
- end
1565
- end
1566
-
1567
- def raise_if_bind_arity_mismatch(statement, expected, provided) #:nodoc:
1568
- unless expected == provided
1569
- raise PreparedStatementInvalid, "wrong number of bind variables (#{provided} for #{expected}) in: #{statement}"
1570
- end
1571
- end
1572
-
1573
- def extract_options_from_args!(args) #:nodoc:
1574
- args.last.is_a?(Hash) ? args.pop : {}
1575
- end
1576
-
1577
- VALID_FIND_OPTIONS = [ :conditions, :include, :joins, :limit, :offset,
1578
- :order, :select, :readonly, :group, :from, :lock ]
1579
-
1580
- def validate_find_options(options) #:nodoc:
1581
- options.assert_valid_keys(VALID_FIND_OPTIONS)
1582
- end
1583
-
1584
- def set_readonly_option!(options) #:nodoc:
1585
- # Inherit :readonly from finder scope if set. Otherwise,
1586
- # if :joins is not blank then :readonly defaults to true.
1587
- unless options.has_key?(:readonly)
1588
- if scoped?(:find, :readonly)
1589
- options[:readonly] = scope(:find, :readonly)
1590
- elsif !options[:joins].blank? && !options[:select]
1591
- options[:readonly] = true
1592
- end
1593
- end
1594
- end
1595
-
1596
- def encode_quoted_value(value) #:nodoc:
1597
- quoted_value = connection.quote(value)
1598
- quoted_value = "'#{quoted_value[1..-2].gsub(/\'/, "\\\\'")}'" if quoted_value.include?("\\\'") # (for ruby mode) "
1599
- quoted_value
1600
- end
1601
- end
1602
-
1603
- public
1604
- # New objects can be instantiated as either empty (pass no construction parameter) or pre-set with
1605
- # attributes but not yet saved (pass a hash with key names matching the associated table column names).
1606
- # In both instances, valid attribute keys are determined by the column names of the associated table --
1607
- # hence you can't have attributes that aren't part of the table columns.
1608
- def initialize(attributes = nil)
1609
- @attributes = attributes_from_column_definition
1610
- @new_record = true
1611
- ensure_proper_type
1612
- self.attributes = attributes unless attributes.nil?
1613
- self.class.send(:scope, :create).each { |att,value| self.send("#{att}=", value) } if self.class.send(:scoped?, :create)
1614
- yield self if block_given?
1615
- end
1616
-
1617
- # A model instance's primary key is always available as model.id
1618
- # whether you name it the default 'id' or set it to something else.
1619
- def id
1620
- attr_name = self.class.primary_key
1621
- column = column_for_attribute(attr_name)
1622
- define_read_method(:id, attr_name, column) if self.class.generate_read_methods
1623
- read_attribute(attr_name)
1624
- end
1625
-
1626
- # Enables Active Record objects to be used as URL parameters in Action Pack automatically.
1627
- def to_param
1628
- # We can't use alias_method here, because method 'id' optimizes itself on the fly.
1629
- (id = self.id) ? id.to_s : nil # Be sure to stringify the id for routes
1630
- end
1631
-
1632
- def id_before_type_cast #:nodoc:
1633
- read_attribute_before_type_cast(self.class.primary_key)
1634
- end
1635
-
1636
- def quoted_id #:nodoc:
1637
- quote_value(id, column_for_attribute(self.class.primary_key))
1638
- end
1639
-
1640
- # Sets the primary ID.
1641
- def id=(value)
1642
- write_attribute(self.class.primary_key, value)
1643
- end
1644
-
1645
- # Returns true if this object hasn't been saved yet -- that is, a record for the object doesn't exist yet.
1646
- def new_record?
1647
- @new_record
1648
- end
1649
-
1650
- # * No record exists: Creates a new record with values matching those of the object attributes.
1651
- # * A record does exist: Updates the record with values matching those of the object attributes.
1652
- def save
1653
- create_or_update
1654
- end
1655
-
1656
- # Attempts to save the record, but instead of just returning false if it couldn't happen, it raises a
1657
- # RecordNotSaved exception
1658
- def save!
1659
- create_or_update || raise(RecordNotSaved)
1660
- end
1661
-
1662
- # Deletes the record in the database and freezes this instance to reflect that no changes should
1663
- # be made (since they can't be persisted).
1664
- def destroy
1665
- unless new_record?
1666
- connection.delete <<-end_sql, "#{self.class.name} Destroy"
1667
- DELETE FROM #{self.class.table_name}
1668
- WHERE #{connection.quote_column_name(self.class.primary_key)} = #{quoted_id}
1669
- end_sql
1670
- end
1671
-
1672
- freeze
1673
- end
1674
-
1675
- # Returns a clone of the record that hasn't been assigned an id yet and
1676
- # is treated as a new record. Note that this is a "shallow" clone:
1677
- # it copies the object's attributes only, not its associations.
1678
- # The extent of a "deep" clone is application-specific and is therefore
1679
- # left to the application to implement according to its need.
1680
- def clone
1681
- attrs = self.attributes_before_type_cast
1682
- attrs.delete(self.class.primary_key)
1683
- self.class.new do |record|
1684
- record.send :instance_variable_set, '@attributes', attrs
1685
- end
1686
- end
1687
-
1688
- # Updates a single attribute and saves the record. This is especially useful for boolean flags on existing records.
1689
- # Note: This method is overwritten by the Validation module that'll make sure that updates made with this method
1690
- # doesn't get subjected to validation checks. Hence, attributes can be updated even if the full object isn't valid.
1691
- def update_attribute(name, value)
1692
- send(name.to_s + '=', value)
1693
- save
1694
- end
1695
-
1696
- # Updates all the attributes from the passed-in Hash and saves the record. If the object is invalid, the saving will
1697
- # fail and false will be returned.
1698
- def update_attributes(attributes)
1699
- self.attributes = attributes
1700
- save
1701
- end
1702
-
1703
- # Updates an object just like Base.update_attributes but calls save! instead of save so an exception is raised if the record is invalid.
1704
- def update_attributes!(attributes)
1705
- self.attributes = attributes
1706
- save!
1707
- end
1708
-
1709
- # Initializes the +attribute+ to zero if nil and adds one. Only makes sense for number-based attributes. Returns self.
1710
- def increment(attribute)
1711
- self[attribute] ||= 0
1712
- self[attribute] += 1
1713
- self
1714
- end
1715
-
1716
- # Increments the +attribute+ and saves the record.
1717
- def increment!(attribute)
1718
- increment(attribute).update_attribute(attribute, self[attribute])
1719
- end
1720
-
1721
- # Initializes the +attribute+ to zero if nil and subtracts one. Only makes sense for number-based attributes. Returns self.
1722
- def decrement(attribute)
1723
- self[attribute] ||= 0
1724
- self[attribute] -= 1
1725
- self
1726
- end
1727
-
1728
- # Decrements the +attribute+ and saves the record.
1729
- def decrement!(attribute)
1730
- decrement(attribute).update_attribute(attribute, self[attribute])
1731
- end
1732
-
1733
- # Turns an +attribute+ that's currently true into false and vice versa. Returns self.
1734
- def toggle(attribute)
1735
- self[attribute] = !send("#{attribute}?")
1736
- self
1737
- end
1738
-
1739
- # Toggles the +attribute+ and saves the record.
1740
- def toggle!(attribute)
1741
- toggle(attribute).update_attribute(attribute, self[attribute])
1742
- end
1743
-
1744
- # Reloads the attributes of this object from the database.
1745
- # The optional options argument is passed to find when reloading so you
1746
- # may do e.g. record.reload(:lock => true) to reload the same record with
1747
- # an exclusive row lock.
1748
- def reload(options = nil)
1749
- clear_aggregation_cache
1750
- clear_association_cache
1751
- @attributes.update(self.class.find(self.id, options).instance_variable_get('@attributes'))
1752
- self
1753
- end
1754
-
1755
- # Returns the value of the attribute identified by <tt>attr_name</tt> after it has been typecast (for example,
1756
- # "2004-12-12" in a data column is cast to a date object, like Date.new(2004, 12, 12)).
1757
- # (Alias for the protected read_attribute method).
1758
- def [](attr_name)
1759
- read_attribute(attr_name)
1760
- end
1761
-
1762
- # Updates the attribute identified by <tt>attr_name</tt> with the specified +value+.
1763
- # (Alias for the protected write_attribute method).
1764
- def []=(attr_name, value)
1765
- write_attribute(attr_name, value)
1766
- end
1767
-
1768
- # Allows you to set all the attributes at once by passing in a hash with keys
1769
- # matching the attribute names (which again matches the column names). Sensitive attributes can be protected
1770
- # from this form of mass-assignment by using the +attr_protected+ macro. Or you can alternatively
1771
- # specify which attributes *can* be accessed in with the +attr_accessible+ macro. Then all the
1772
- # attributes not included in that won't be allowed to be mass-assigned.
1773
- def attributes=(new_attributes)
1774
- return if new_attributes.nil?
1775
- attributes = new_attributes.dup
1776
- attributes.stringify_keys!
1777
-
1778
- multi_parameter_attributes = []
1779
- remove_attributes_protected_from_mass_assignment(attributes).each do |k, v|
1780
- k.include?("(") ? multi_parameter_attributes << [ k, v ] : send(k + "=", v)
1781
- end
1782
-
1783
- assign_multiparameter_attributes(multi_parameter_attributes)
1784
- end
1785
-
1786
-
1787
- # Returns a hash of all the attributes with their names as keys and clones of their objects as values.
1788
- def attributes(options = nil)
1789
- attributes = clone_attributes :read_attribute
1790
-
1791
- if options.nil?
1792
- attributes
1793
- else
1794
- if except = options[:except]
1795
- except = Array(except).collect { |attribute| attribute.to_s }
1796
- except.each { |attribute_name| attributes.delete(attribute_name) }
1797
- attributes
1798
- elsif only = options[:only]
1799
- only = Array(only).collect { |attribute| attribute.to_s }
1800
- attributes.delete_if { |key, value| !only.include?(key) }
1801
- attributes
1802
- else
1803
- raise ArgumentError, "Options does not specify :except or :only (#{options.keys.inspect})"
1804
- end
1805
- end
1806
- end
1807
-
1808
- # Returns a hash of cloned attributes before typecasting and deserialization.
1809
- def attributes_before_type_cast
1810
- clone_attributes :read_attribute_before_type_cast
1811
- end
1812
-
1813
- # Returns true if the specified +attribute+ has been set by the user or by a database load and is neither
1814
- # nil nor empty? (the latter only applies to objects that respond to empty?, most notably Strings).
1815
- def attribute_present?(attribute)
1816
- value = read_attribute(attribute)
1817
- !value.blank?
1818
- end
1819
-
1820
- # Returns true if the given attribute is in the attributes hash
1821
- def has_attribute?(attr_name)
1822
- @attributes.has_key?(attr_name.to_s)
1823
- end
1824
-
1825
- # Returns an array of names for the attributes available on this object sorted alphabetically.
1826
- def attribute_names
1827
- @attributes.keys.sort
1828
- end
1829
-
1830
- # Returns the column object for the named attribute.
1831
- def column_for_attribute(name)
1832
- self.class.columns_hash[name.to_s]
1833
- end
1834
-
1835
- # Returns true if the +comparison_object+ is the same object, or is of the same type and has the same id.
1836
- def ==(comparison_object)
1837
- comparison_object.equal?(self) ||
1838
- (comparison_object.instance_of?(self.class) &&
1839
- comparison_object.id == id &&
1840
- !comparison_object.new_record?)
1841
- end
1842
-
1843
- # Delegates to ==
1844
- def eql?(comparison_object)
1845
- self == (comparison_object)
1846
- end
1847
-
1848
- # Delegates to id in order to allow two records of the same type and id to work with something like:
1849
- # [ Person.find(1), Person.find(2), Person.find(3) ] & [ Person.find(1), Person.find(4) ] # => [ Person.find(1) ]
1850
- def hash
1851
- id.hash
1852
- end
1853
-
1854
- # For checking respond_to? without searching the attributes (which is faster).
1855
- alias_method :respond_to_without_attributes?, :respond_to?
1856
-
1857
- # A Person object with a name attribute can ask person.respond_to?("name"), person.respond_to?("name="), and
1858
- # person.respond_to?("name?") which will all return true.
1859
- def respond_to?(method, include_priv = false)
1860
- if @attributes.nil?
1861
- return super
1862
- elsif attr_name = self.class.column_methods_hash[method.to_sym]
1863
- return true if @attributes.include?(attr_name) || attr_name == self.class.primary_key
1864
- return false if self.class.read_methods.include?(attr_name)
1865
- elsif @attributes.include?(method_name = method.to_s)
1866
- return true
1867
- elsif md = self.class.match_attribute_method?(method.to_s)
1868
- return true if @attributes.include?(md.pre_match)
1869
- end
1870
- # super must be called at the end of the method, because the inherited respond_to?
1871
- # would return true for generated readers, even if the attribute wasn't present
1872
- super
1873
- end
1874
-
1875
- # Just freeze the attributes hash, such that associations are still accessible even on destroyed records.
1876
- def freeze
1877
- @attributes.freeze; self
1878
- end
1879
-
1880
- def frozen?
1881
- @attributes.frozen?
1882
- end
1883
-
1884
- # Records loaded through joins with piggy-back attributes will be marked as read only as they cannot be saved and return true to this query.
1885
- def readonly?
1886
- @readonly == true
1887
- end
1888
-
1889
- def readonly! #:nodoc:
1890
- @readonly = true
1891
- end
1892
-
1893
-
1894
- private
1895
- def create_or_update
1896
- raise ReadOnlyRecord if readonly?
1897
- result = new_record? ? create : update
1898
- result != false
1899
- end
1900
-
1901
- # Updates the associated record with values matching those of the instance attributes.
1902
- # Returns the number of affected rows.
1903
- def update
1904
- connection.update(
1905
- "UPDATE #{self.class.table_name} " +
1906
- "SET #{quoted_comma_pair_list(connection, attributes_with_quotes(false))} " +
1907
- "WHERE #{connection.quote_column_name(self.class.primary_key)} = #{quote_value(id)}",
1908
- "#{self.class.name} Update"
1909
- )
1910
- end
1911
-
1912
- # Creates a record with values matching those of the instance attributes
1913
- # and returns its id.
1914
- def create
1915
- if self.id.nil? && connection.prefetch_primary_key?(self.class.table_name)
1916
- self.id = connection.next_sequence_value(self.class.sequence_name)
1917
- end
1918
-
1919
- self.id = connection.insert(
1920
- "INSERT INTO #{self.class.table_name} " +
1921
- "(#{quoted_column_names.join(', ')}) " +
1922
- "VALUES(#{attributes_with_quotes.values.join(', ')})",
1923
- "#{self.class.name} Create",
1924
- self.class.primary_key, self.id, self.class.sequence_name
1925
- )
1926
-
1927
- @new_record = false
1928
- id
1929
- end
1930
-
1931
- # Sets the attribute used for single table inheritance to this class name if this is not the ActiveRecord descendent.
1932
- # Considering the hierarchy Reply < Message < ActiveRecord, this makes it possible to do Reply.new without having to
1933
- # set Reply[Reply.inheritance_column] = "Reply" yourself. No such attribute would be set for objects of the
1934
- # Message class in that example.
1935
- def ensure_proper_type
1936
- unless self.class.descends_from_active_record?
1937
- write_attribute(self.class.inheritance_column, Inflector.demodulize(self.class.name))
1938
- end
1939
- end
1940
-
1941
-
1942
- # Allows access to the object attributes, which are held in the @attributes hash, as were
1943
- # they first-class methods. So a Person class with a name attribute can use Person#name and
1944
- # Person#name= and never directly use the attributes hash -- except for multiple assigns with
1945
- # ActiveRecord#attributes=. A Milestone class can also ask Milestone#completed? to test that
1946
- # the completed attribute is not nil or 0.
1947
- #
1948
- # It's also possible to instantiate related objects, so a Client class belonging to the clients
1949
- # table with a master_id foreign key can instantiate master through Client#master.
1950
- def method_missing(method_id, *args, &block)
1951
- method_name = method_id.to_s
1952
- if @attributes.include?(method_name) or
1953
- (md = /\?$/.match(method_name) and
1954
- @attributes.include?(query_method_name = md.pre_match) and
1955
- method_name = query_method_name)
1956
- define_read_methods if self.class.read_methods.empty? && self.class.generate_read_methods
1957
- md ? query_attribute(method_name) : read_attribute(method_name)
1958
- elsif self.class.primary_key.to_s == method_name
1959
- id
1960
- elsif md = self.class.match_attribute_method?(method_name)
1961
- attribute_name, method_type = md.pre_match, md.to_s
1962
- if @attributes.include?(attribute_name)
1963
- __send__("attribute#{method_type}", attribute_name, *args, &block)
1964
- else
1965
- super
1966
- end
1967
- else
1968
- super
1969
- end
1970
- end
1971
-
1972
- # Returns the value of the attribute identified by <tt>attr_name</tt> after it has been typecast (for example,
1973
- # "2004-12-12" in a data column is cast to a date object, like Date.new(2004, 12, 12)).
1974
- def read_attribute(attr_name)
1975
- attr_name = attr_name.to_s
1976
- if !(value = @attributes[attr_name]).nil?
1977
- if column = column_for_attribute(attr_name)
1978
- if unserializable_attribute?(attr_name, column)
1979
- unserialize_attribute(attr_name)
1980
- else
1981
- column.type_cast(value)
1982
- end
1983
- else
1984
- value
1985
- end
1986
- else
1987
- nil
1988
- end
1989
- end
1990
-
1991
- def read_attribute_before_type_cast(attr_name)
1992
- @attributes[attr_name]
1993
- end
1994
-
1995
- # Called on first read access to any given column and generates reader
1996
- # methods for all columns in the columns_hash if
1997
- # ActiveRecord::Base.generate_read_methods is set to true.
1998
- def define_read_methods
1999
- self.class.columns_hash.each do |name, column|
2000
- unless respond_to_without_attributes?(name)
2001
- if self.class.serialized_attributes[name]
2002
- define_read_method_for_serialized_attribute(name)
2003
- else
2004
- define_read_method(name.to_sym, name, column)
2005
- end
2006
- end
2007
-
2008
- unless respond_to_without_attributes?("#{name}?")
2009
- define_question_method(name)
2010
- end
2011
- end
2012
- end
2013
-
2014
- # Define an attribute reader method. Cope with nil column.
2015
- def define_read_method(symbol, attr_name, column)
2016
- cast_code = column.type_cast_code('v') if column
2017
- access_code = cast_code ? "(v=@attributes['#{attr_name}']) && #{cast_code}" : "@attributes['#{attr_name}']"
2018
-
2019
- unless attr_name.to_s == self.class.primary_key.to_s
2020
- access_code = access_code.insert(0, "raise NoMethodError, 'missing attribute: #{attr_name}', caller unless @attributes.has_key?('#{attr_name}'); ")
2021
- self.class.read_methods << attr_name
2022
- end
2023
-
2024
- evaluate_read_method attr_name, "def #{symbol}; #{access_code}; end"
2025
- end
2026
-
2027
- # Define read method for serialized attribute.
2028
- def define_read_method_for_serialized_attribute(attr_name)
2029
- unless attr_name.to_s == self.class.primary_key.to_s
2030
- self.class.read_methods << attr_name
2031
- end
2032
-
2033
- evaluate_read_method attr_name, "def #{attr_name}; unserialize_attribute('#{attr_name}'); end"
2034
- end
2035
-
2036
- # Define an attribute ? method.
2037
- def define_question_method(attr_name)
2038
- unless attr_name.to_s == self.class.primary_key.to_s
2039
- self.class.read_methods << "#{attr_name}?"
2040
- end
2041
-
2042
- evaluate_read_method attr_name, "def #{attr_name}?; query_attribute('#{attr_name}'); end"
2043
- end
2044
-
2045
- # Evaluate the definition for an attribute reader or ? method
2046
- def evaluate_read_method(attr_name, method_definition)
2047
- begin
2048
- self.class.class_eval(method_definition)
2049
- rescue SyntaxError => err
2050
- self.class.read_methods.delete(attr_name)
2051
- if logger
2052
- logger.warn "Exception occurred during reader method compilation."
2053
- logger.warn "Maybe #{attr_name} is not a valid Ruby identifier?"
2054
- logger.warn "#{err.message}"
2055
- end
2056
- end
2057
- end
2058
-
2059
- # Returns true if the attribute is of a text column and marked for serialization.
2060
- def unserializable_attribute?(attr_name, column)
2061
- column.text? && self.class.serialized_attributes[attr_name]
2062
- end
2063
-
2064
- # Returns the unserialized object of the attribute.
2065
- def unserialize_attribute(attr_name)
2066
- unserialized_object = object_from_yaml(@attributes[attr_name])
2067
-
2068
- if unserialized_object.is_a?(self.class.serialized_attributes[attr_name])
2069
- @attributes[attr_name] = unserialized_object
2070
- else
2071
- raise SerializationTypeMismatch,
2072
- "#{attr_name} was supposed to be a #{self.class.serialized_attributes[attr_name]}, but was a #{unserialized_object.class.to_s}"
2073
- end
2074
- end
2075
-
2076
- # Updates the attribute identified by <tt>attr_name</tt> with the specified +value+. Empty strings for fixnum and float
2077
- # columns are turned into nil.
2078
- def write_attribute(attr_name, value)
2079
- attr_name = attr_name.to_s
2080
- if (column = column_for_attribute(attr_name)) && column.number?
2081
- @attributes[attr_name] = convert_number_column_value(value)
2082
- else
2083
- @attributes[attr_name] = value
2084
- end
2085
- end
2086
-
2087
- def convert_number_column_value(value)
2088
- case value
2089
- when FalseClass: 0
2090
- when TrueClass: 1
2091
- when '': nil
2092
- else value
2093
- end
2094
- end
2095
-
2096
- def query_attribute(attr_name)
2097
- unless value = read_attribute(attr_name)
2098
- false
2099
- else
2100
- column = self.class.columns_hash[attr_name]
2101
- if column.nil?
2102
- if Numeric === value || value !~ /[^0-9]/
2103
- !value.to_i.zero?
2104
- else
2105
- !value.blank?
2106
- end
2107
- elsif column.number?
2108
- !value.zero?
2109
- else
2110
- !value.blank?
2111
- end
2112
- end
2113
- end
2114
-
2115
- def remove_attributes_protected_from_mass_assignment(attributes)
2116
- if self.class.accessible_attributes.nil? && self.class.protected_attributes.nil?
2117
- attributes.reject { |key, value| attributes_protected_by_default.include?(key.gsub(/\(.+/, "")) }
2118
- elsif self.class.protected_attributes.nil?
2119
- attributes.reject { |key, value| !self.class.accessible_attributes.include?(key.gsub(/\(.+/, "").intern) || attributes_protected_by_default.include?(key.gsub(/\(.+/, "")) }
2120
- elsif self.class.accessible_attributes.nil?
2121
- attributes.reject { |key, value| self.class.protected_attributes.include?(key.gsub(/\(.+/,"").intern) || attributes_protected_by_default.include?(key.gsub(/\(.+/, "")) }
2122
- end
2123
- end
2124
-
2125
- # The primary key and inheritance column can never be set by mass-assignment for security reasons.
2126
- def attributes_protected_by_default
2127
- default = [ self.class.primary_key, self.class.inheritance_column ]
2128
- default << 'id' unless self.class.primary_key.eql? 'id'
2129
- default
2130
- end
2131
-
2132
- # Returns copy of the attributes hash where all the values have been safely quoted for use in
2133
- # an SQL statement.
2134
- def attributes_with_quotes(include_primary_key = true)
2135
- attributes.inject({}) do |quoted, (name, value)|
2136
- if column = column_for_attribute(name)
2137
- quoted[name] = quote_value(value, column) unless !include_primary_key && column.primary
2138
- end
2139
- quoted
2140
- end
2141
- end
2142
-
2143
- # Quote strings appropriately for SQL statements.
2144
- def quote_value(value, column = nil)
2145
- self.class.connection.quote(value, column)
2146
- end
2147
-
2148
- # Deprecated, use quote_value
2149
- def quote(value, column = nil)
2150
- self.class.connection.quote(value, column)
2151
- end
2152
- deprecate :quote => :quote_value
2153
-
2154
-
2155
- # Interpolate custom sql string in instance context.
2156
- # Optional record argument is meant for custom insert_sql.
2157
- def interpolate_sql(sql, record = nil)
2158
- instance_eval("%@#{sql.gsub('@', '\@')}@")
2159
- end
2160
-
2161
- # Initializes the attributes array with keys matching the columns from the linked table and
2162
- # the values matching the corresponding default value of that column, so
2163
- # that a new instance, or one populated from a passed-in Hash, still has all the attributes
2164
- # that instances loaded from the database would.
2165
- def attributes_from_column_definition
2166
- self.class.columns.inject({}) do |attributes, column|
2167
- attributes[column.name] = column.default unless column.name == self.class.primary_key
2168
- attributes
2169
- end
2170
- end
2171
-
2172
- # Instantiates objects for all attribute classes that needs more than one constructor parameter. This is done
2173
- # by calling new on the column type or aggregation type (through composed_of) object with these parameters.
2174
- # So having the pairs written_on(1) = "2004", written_on(2) = "6", written_on(3) = "24", will instantiate
2175
- # written_on (a date type) with Date.new("2004", "6", "24"). You can also specify a typecast character in the
2176
- # parentheses to have the parameters typecasted before they're used in the constructor. Use i for Fixnum, f for Float,
2177
- # s for String, and a for Array. If all the values for a given attribute is empty, the attribute will be set to nil.
2178
- def assign_multiparameter_attributes(pairs)
2179
- execute_callstack_for_multiparameter_attributes(
2180
- extract_callstack_for_multiparameter_attributes(pairs)
2181
- )
2182
- end
2183
-
2184
- # Includes an ugly hack for Time.local instead of Time.new because the latter is reserved by Time itself.
2185
- def execute_callstack_for_multiparameter_attributes(callstack)
2186
- errors = []
2187
- callstack.each do |name, values|
2188
- klass = (self.class.reflect_on_aggregation(name.to_sym) || column_for_attribute(name)).klass
2189
- if values.empty?
2190
- send(name + "=", nil)
2191
- else
2192
- begin
2193
- send(name + "=", Time == klass ? (@@default_timezone == :utc ? klass.utc(*values) : klass.local(*values)) : klass.new(*values))
2194
- rescue => ex
2195
- errors << AttributeAssignmentError.new("error on assignment #{values.inspect} to #{name}", ex, name)
2196
- end
2197
- end
2198
- end
2199
- unless errors.empty?
2200
- raise MultiparameterAssignmentErrors.new(errors), "#{errors.size} error(s) on assignment of multiparameter attributes"
2201
- end
2202
- end
2203
-
2204
- def extract_callstack_for_multiparameter_attributes(pairs)
2205
- attributes = { }
2206
-
2207
- for pair in pairs
2208
- multiparameter_name, value = pair
2209
- attribute_name = multiparameter_name.split("(").first
2210
- attributes[attribute_name] = [] unless attributes.include?(attribute_name)
2211
-
2212
- unless value.empty?
2213
- attributes[attribute_name] <<
2214
- [ find_parameter_position(multiparameter_name), type_cast_attribute_value(multiparameter_name, value) ]
2215
- end
2216
- end
2217
-
2218
- attributes.each { |name, values| attributes[name] = values.sort_by{ |v| v.first }.collect { |v| v.last } }
2219
- end
2220
-
2221
- def type_cast_attribute_value(multiparameter_name, value)
2222
- multiparameter_name =~ /\([0-9]*([a-z])\)/ ? value.send("to_" + $1) : value
2223
- end
2224
-
2225
- def find_parameter_position(multiparameter_name)
2226
- multiparameter_name.scan(/\(([0-9]*).*\)/).first.first
2227
- end
2228
-
2229
- # Returns a comma-separated pair list, like "key1 = val1, key2 = val2".
2230
- def comma_pair_list(hash)
2231
- hash.inject([]) { |list, pair| list << "#{pair.first} = #{pair.last}" }.join(", ")
2232
- end
2233
-
2234
- def quoted_column_names(attributes = attributes_with_quotes)
2235
- attributes.keys.collect do |column_name|
2236
- self.class.connection.quote_column_name(column_name)
2237
- end
2238
- end
2239
-
2240
- def quote_columns(quoter, hash)
2241
- hash.inject({}) do |quoted, (name, value)|
2242
- quoted[quoter.quote_column_name(name)] = value
2243
- quoted
2244
- end
2245
- end
2246
-
2247
- def quoted_comma_pair_list(quoter, hash)
2248
- comma_pair_list(quote_columns(quoter, hash))
2249
- end
2250
-
2251
- def object_from_yaml(string)
2252
- return string unless string.is_a?(String)
2253
- YAML::load(string) rescue string
2254
- end
2255
-
2256
- def clone_attributes(reader_method = :read_attribute, attributes = {})
2257
- self.attribute_names.inject(attributes) do |attributes, name|
2258
- attributes[name] = clone_attribute_value(reader_method, name)
2259
- attributes
2260
- end
2261
- end
2262
-
2263
- def clone_attribute_value(reader_method, attribute_name)
2264
- value = send(reader_method, attribute_name)
2265
-
2266
- case value
2267
- when nil, Fixnum, true, false
2268
- value
2269
- else
2270
- value.clone
2271
- end
2272
- rescue TypeError, NoMethodError
2273
- value
2274
- end
2275
- end
2276
- end