activerecord 3.2.6 → 6.0.0

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

Potentially problematic release.


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

Files changed (371) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +611 -6417
  3. data/MIT-LICENSE +4 -2
  4. data/README.rdoc +44 -47
  5. data/examples/performance.rb +79 -71
  6. data/examples/simple.rb +6 -5
  7. data/lib/active_record/aggregations.rb +268 -238
  8. data/lib/active_record/association_relation.rb +40 -0
  9. data/lib/active_record/associations/alias_tracker.rb +47 -42
  10. data/lib/active_record/associations/association.rb +173 -81
  11. data/lib/active_record/associations/association_scope.rb +124 -92
  12. data/lib/active_record/associations/belongs_to_association.rb +83 -38
  13. data/lib/active_record/associations/belongs_to_polymorphic_association.rb +11 -9
  14. data/lib/active_record/associations/builder/association.rb +113 -32
  15. data/lib/active_record/associations/builder/belongs_to.rb +105 -60
  16. data/lib/active_record/associations/builder/collection_association.rb +53 -56
  17. data/lib/active_record/associations/builder/has_and_belongs_to_many.rb +98 -41
  18. data/lib/active_record/associations/builder/has_many.rb +11 -63
  19. data/lib/active_record/associations/builder/has_one.rb +47 -45
  20. data/lib/active_record/associations/builder/singular_association.rb +30 -18
  21. data/lib/active_record/associations/collection_association.rb +217 -295
  22. data/lib/active_record/associations/collection_proxy.rb +1074 -77
  23. data/lib/active_record/associations/foreign_association.rb +20 -0
  24. data/lib/active_record/associations/has_many_association.rb +78 -50
  25. data/lib/active_record/associations/has_many_through_association.rb +99 -61
  26. data/lib/active_record/associations/has_one_association.rb +75 -30
  27. data/lib/active_record/associations/has_one_through_association.rb +20 -11
  28. data/lib/active_record/associations/join_dependency/join_association.rb +45 -119
  29. data/lib/active_record/associations/join_dependency/join_base.rb +11 -12
  30. data/lib/active_record/associations/join_dependency/join_part.rb +35 -42
  31. data/lib/active_record/associations/join_dependency.rb +208 -164
  32. data/lib/active_record/associations/preloader/association.rb +93 -87
  33. data/lib/active_record/associations/preloader/through_association.rb +87 -38
  34. data/lib/active_record/associations/preloader.rb +134 -110
  35. data/lib/active_record/associations/singular_association.rb +19 -24
  36. data/lib/active_record/associations/through_association.rb +61 -27
  37. data/lib/active_record/associations.rb +1766 -1505
  38. data/lib/active_record/attribute_assignment.rb +57 -193
  39. data/lib/active_record/attribute_decorators.rb +90 -0
  40. data/lib/active_record/attribute_methods/before_type_cast.rb +58 -8
  41. data/lib/active_record/attribute_methods/dirty.rb +187 -67
  42. data/lib/active_record/attribute_methods/primary_key.rb +100 -78
  43. data/lib/active_record/attribute_methods/query.rb +10 -8
  44. data/lib/active_record/attribute_methods/read.rb +29 -118
  45. data/lib/active_record/attribute_methods/serialization.rb +60 -72
  46. data/lib/active_record/attribute_methods/time_zone_conversion.rb +69 -42
  47. data/lib/active_record/attribute_methods/write.rb +36 -44
  48. data/lib/active_record/attribute_methods.rb +306 -161
  49. data/lib/active_record/attributes.rb +279 -0
  50. data/lib/active_record/autosave_association.rb +324 -238
  51. data/lib/active_record/base.rb +114 -507
  52. data/lib/active_record/callbacks.rb +147 -83
  53. data/lib/active_record/coders/json.rb +15 -0
  54. data/lib/active_record/coders/yaml_column.rb +32 -23
  55. data/lib/active_record/connection_adapters/abstract/connection_pool.rb +962 -279
  56. data/lib/active_record/connection_adapters/abstract/database_limits.rb +32 -5
  57. data/lib/active_record/connection_adapters/abstract/database_statements.rb +331 -209
  58. data/lib/active_record/connection_adapters/abstract/query_cache.rb +95 -23
  59. data/lib/active_record/connection_adapters/abstract/quoting.rb +201 -65
  60. data/lib/active_record/connection_adapters/abstract/savepoints.rb +23 -0
  61. data/lib/active_record/connection_adapters/abstract/schema_creation.rb +153 -0
  62. data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +510 -289
  63. data/lib/active_record/connection_adapters/abstract/schema_dumper.rb +93 -0
  64. data/lib/active_record/connection_adapters/abstract/schema_statements.rb +1182 -313
  65. data/lib/active_record/connection_adapters/abstract/transaction.rb +323 -0
  66. data/lib/active_record/connection_adapters/abstract_adapter.rb +585 -120
  67. data/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +610 -463
  68. data/lib/active_record/connection_adapters/column.rb +58 -233
  69. data/lib/active_record/connection_adapters/connection_specification.rb +297 -0
  70. data/lib/active_record/connection_adapters/determine_if_preparable_visitor.rb +29 -0
  71. data/lib/active_record/connection_adapters/mysql/column.rb +27 -0
  72. data/lib/active_record/connection_adapters/mysql/database_statements.rb +200 -0
  73. data/lib/active_record/connection_adapters/mysql/explain_pretty_printer.rb +72 -0
  74. data/lib/active_record/connection_adapters/mysql/quoting.rb +81 -0
  75. data/lib/active_record/connection_adapters/mysql/schema_creation.rb +72 -0
  76. data/lib/active_record/connection_adapters/mysql/schema_definitions.rb +95 -0
  77. data/lib/active_record/connection_adapters/mysql/schema_dumper.rb +88 -0
  78. data/lib/active_record/connection_adapters/mysql/schema_statements.rb +264 -0
  79. data/lib/active_record/connection_adapters/mysql/type_metadata.rb +31 -0
  80. data/lib/active_record/connection_adapters/mysql2_adapter.rb +75 -207
  81. data/lib/active_record/connection_adapters/postgresql/column.rb +30 -0
  82. data/lib/active_record/connection_adapters/postgresql/database_statements.rb +182 -0
  83. data/lib/active_record/connection_adapters/postgresql/explain_pretty_printer.rb +44 -0
  84. data/lib/active_record/connection_adapters/postgresql/oid/array.rb +92 -0
  85. data/lib/active_record/connection_adapters/postgresql/oid/bit.rb +53 -0
  86. data/lib/active_record/connection_adapters/postgresql/oid/bit_varying.rb +15 -0
  87. data/lib/active_record/connection_adapters/postgresql/oid/bytea.rb +17 -0
  88. data/lib/active_record/connection_adapters/postgresql/oid/cidr.rb +50 -0
  89. data/lib/active_record/connection_adapters/postgresql/oid/date.rb +23 -0
  90. data/lib/active_record/connection_adapters/postgresql/oid/date_time.rb +23 -0
  91. data/lib/active_record/connection_adapters/postgresql/oid/decimal.rb +15 -0
  92. data/lib/active_record/connection_adapters/postgresql/oid/enum.rb +21 -0
  93. data/lib/active_record/connection_adapters/postgresql/oid/hstore.rb +71 -0
  94. data/lib/active_record/connection_adapters/postgresql/oid/inet.rb +15 -0
  95. data/lib/active_record/connection_adapters/postgresql/oid/jsonb.rb +15 -0
  96. data/lib/active_record/connection_adapters/postgresql/oid/legacy_point.rb +45 -0
  97. data/lib/active_record/connection_adapters/postgresql/oid/money.rb +41 -0
  98. data/lib/active_record/connection_adapters/postgresql/oid/oid.rb +15 -0
  99. data/lib/active_record/connection_adapters/postgresql/oid/point.rb +65 -0
  100. data/lib/active_record/connection_adapters/postgresql/oid/range.rb +97 -0
  101. data/lib/active_record/connection_adapters/postgresql/oid/specialized_string.rb +18 -0
  102. data/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb +113 -0
  103. data/lib/active_record/connection_adapters/postgresql/oid/uuid.rb +26 -0
  104. data/lib/active_record/connection_adapters/postgresql/oid/vector.rb +28 -0
  105. data/lib/active_record/connection_adapters/postgresql/oid/xml.rb +30 -0
  106. data/lib/active_record/connection_adapters/postgresql/oid.rb +34 -0
  107. data/lib/active_record/connection_adapters/postgresql/quoting.rb +205 -0
  108. data/lib/active_record/connection_adapters/postgresql/referential_integrity.rb +43 -0
  109. data/lib/active_record/connection_adapters/postgresql/schema_creation.rb +76 -0
  110. data/lib/active_record/connection_adapters/postgresql/schema_definitions.rb +222 -0
  111. data/lib/active_record/connection_adapters/postgresql/schema_dumper.rb +50 -0
  112. data/lib/active_record/connection_adapters/postgresql/schema_statements.rb +776 -0
  113. data/lib/active_record/connection_adapters/postgresql/type_metadata.rb +36 -0
  114. data/lib/active_record/connection_adapters/postgresql/utils.rb +81 -0
  115. data/lib/active_record/connection_adapters/postgresql_adapter.rb +695 -1052
  116. data/lib/active_record/connection_adapters/schema_cache.rb +115 -24
  117. data/lib/active_record/connection_adapters/sql_type_metadata.rb +37 -0
  118. data/lib/active_record/connection_adapters/sqlite3/database_statements.rb +118 -0
  119. data/lib/active_record/connection_adapters/sqlite3/explain_pretty_printer.rb +21 -0
  120. data/lib/active_record/connection_adapters/sqlite3/quoting.rb +103 -0
  121. data/lib/active_record/connection_adapters/sqlite3/schema_creation.rb +17 -0
  122. data/lib/active_record/connection_adapters/sqlite3/schema_definitions.rb +19 -0
  123. data/lib/active_record/connection_adapters/sqlite3/schema_dumper.rb +18 -0
  124. data/lib/active_record/connection_adapters/sqlite3/schema_statements.rb +137 -0
  125. data/lib/active_record/connection_adapters/sqlite3_adapter.rb +528 -26
  126. data/lib/active_record/connection_adapters/statement_pool.rb +34 -13
  127. data/lib/active_record/connection_handling.rb +267 -0
  128. data/lib/active_record/core.rb +599 -0
  129. data/lib/active_record/counter_cache.rb +177 -103
  130. data/lib/active_record/database_configurations/database_config.rb +37 -0
  131. data/lib/active_record/database_configurations/hash_config.rb +50 -0
  132. data/lib/active_record/database_configurations/url_config.rb +79 -0
  133. data/lib/active_record/database_configurations.rb +233 -0
  134. data/lib/active_record/define_callbacks.rb +22 -0
  135. data/lib/active_record/dynamic_matchers.rb +107 -64
  136. data/lib/active_record/enum.rb +274 -0
  137. data/lib/active_record/errors.rb +254 -61
  138. data/lib/active_record/explain.rb +35 -70
  139. data/lib/active_record/explain_registry.rb +32 -0
  140. data/lib/active_record/explain_subscriber.rb +18 -8
  141. data/lib/active_record/fixture_set/file.rb +82 -0
  142. data/lib/active_record/fixture_set/model_metadata.rb +33 -0
  143. data/lib/active_record/fixture_set/render_context.rb +17 -0
  144. data/lib/active_record/fixture_set/table_row.rb +153 -0
  145. data/lib/active_record/fixture_set/table_rows.rb +47 -0
  146. data/lib/active_record/fixtures.rb +291 -475
  147. data/lib/active_record/gem_version.rb +17 -0
  148. data/lib/active_record/inheritance.rb +219 -100
  149. data/lib/active_record/insert_all.rb +179 -0
  150. data/lib/active_record/integration.rb +175 -17
  151. data/lib/active_record/internal_metadata.rb +53 -0
  152. data/lib/active_record/legacy_yaml_adapter.rb +48 -0
  153. data/lib/active_record/locale/en.yml +9 -1
  154. data/lib/active_record/locking/optimistic.rb +106 -92
  155. data/lib/active_record/locking/pessimistic.rb +23 -11
  156. data/lib/active_record/log_subscriber.rb +80 -30
  157. data/lib/active_record/middleware/database_selector/resolver/session.rb +45 -0
  158. data/lib/active_record/middleware/database_selector/resolver.rb +92 -0
  159. data/lib/active_record/middleware/database_selector.rb +75 -0
  160. data/lib/active_record/migration/command_recorder.rb +235 -56
  161. data/lib/active_record/migration/compatibility.rb +244 -0
  162. data/lib/active_record/migration/join_table.rb +17 -0
  163. data/lib/active_record/migration.rb +917 -301
  164. data/lib/active_record/model_schema.rb +351 -175
  165. data/lib/active_record/nested_attributes.rb +366 -235
  166. data/lib/active_record/no_touching.rb +65 -0
  167. data/lib/active_record/null_relation.rb +68 -0
  168. data/lib/active_record/persistence.rb +761 -166
  169. data/lib/active_record/query_cache.rb +22 -44
  170. data/lib/active_record/querying.rb +55 -31
  171. data/lib/active_record/railtie.rb +185 -47
  172. data/lib/active_record/railties/collection_cache_association_loading.rb +34 -0
  173. data/lib/active_record/railties/console_sandbox.rb +5 -4
  174. data/lib/active_record/railties/controller_runtime.rb +35 -33
  175. data/lib/active_record/railties/databases.rake +366 -463
  176. data/lib/active_record/readonly_attributes.rb +4 -6
  177. data/lib/active_record/reflection.rb +736 -228
  178. data/lib/active_record/relation/batches/batch_enumerator.rb +69 -0
  179. data/lib/active_record/relation/batches.rb +252 -52
  180. data/lib/active_record/relation/calculations.rb +340 -270
  181. data/lib/active_record/relation/delegation.rb +117 -36
  182. data/lib/active_record/relation/finder_methods.rb +439 -286
  183. data/lib/active_record/relation/from_clause.rb +26 -0
  184. data/lib/active_record/relation/merger.rb +184 -0
  185. data/lib/active_record/relation/predicate_builder/array_handler.rb +49 -0
  186. data/lib/active_record/relation/predicate_builder/association_query_value.rb +43 -0
  187. data/lib/active_record/relation/predicate_builder/base_handler.rb +18 -0
  188. data/lib/active_record/relation/predicate_builder/basic_object_handler.rb +19 -0
  189. data/lib/active_record/relation/predicate_builder/polymorphic_array_value.rb +53 -0
  190. data/lib/active_record/relation/predicate_builder/range_handler.rb +22 -0
  191. data/lib/active_record/relation/predicate_builder/relation_handler.rb +19 -0
  192. data/lib/active_record/relation/predicate_builder.rb +131 -39
  193. data/lib/active_record/relation/query_attribute.rb +50 -0
  194. data/lib/active_record/relation/query_methods.rb +1163 -221
  195. data/lib/active_record/relation/record_fetch_warning.rb +51 -0
  196. data/lib/active_record/relation/spawn_methods.rb +49 -120
  197. data/lib/active_record/relation/where_clause.rb +190 -0
  198. data/lib/active_record/relation/where_clause_factory.rb +33 -0
  199. data/lib/active_record/relation.rb +671 -349
  200. data/lib/active_record/result.rb +149 -15
  201. data/lib/active_record/runtime_registry.rb +24 -0
  202. data/lib/active_record/sanitization.rb +153 -133
  203. data/lib/active_record/schema.rb +22 -19
  204. data/lib/active_record/schema_dumper.rb +178 -112
  205. data/lib/active_record/schema_migration.rb +60 -0
  206. data/lib/active_record/scoping/default.rb +107 -98
  207. data/lib/active_record/scoping/named.rb +130 -115
  208. data/lib/active_record/scoping.rb +77 -123
  209. data/lib/active_record/secure_token.rb +40 -0
  210. data/lib/active_record/serialization.rb +10 -6
  211. data/lib/active_record/statement_cache.rb +148 -0
  212. data/lib/active_record/store.rb +256 -16
  213. data/lib/active_record/suppressor.rb +61 -0
  214. data/lib/active_record/table_metadata.rb +75 -0
  215. data/lib/active_record/tasks/database_tasks.rb +506 -0
  216. data/lib/active_record/tasks/mysql_database_tasks.rb +115 -0
  217. data/lib/active_record/tasks/postgresql_database_tasks.rb +141 -0
  218. data/lib/active_record/tasks/sqlite_database_tasks.rb +77 -0
  219. data/lib/active_record/test_databases.rb +23 -0
  220. data/lib/active_record/test_fixtures.rb +224 -0
  221. data/lib/active_record/timestamp.rb +93 -39
  222. data/lib/active_record/touch_later.rb +66 -0
  223. data/lib/active_record/transactions.rb +260 -129
  224. data/lib/active_record/translation.rb +3 -1
  225. data/lib/active_record/type/adapter_specific_registry.rb +129 -0
  226. data/lib/active_record/type/date.rb +9 -0
  227. data/lib/active_record/type/date_time.rb +9 -0
  228. data/lib/active_record/type/decimal_without_scale.rb +15 -0
  229. data/lib/active_record/type/hash_lookup_type_map.rb +25 -0
  230. data/lib/active_record/type/internal/timezone.rb +17 -0
  231. data/lib/active_record/type/json.rb +30 -0
  232. data/lib/active_record/type/serialized.rb +71 -0
  233. data/lib/active_record/type/text.rb +11 -0
  234. data/lib/active_record/type/time.rb +21 -0
  235. data/lib/active_record/type/type_map.rb +62 -0
  236. data/lib/active_record/type/unsigned_integer.rb +17 -0
  237. data/lib/active_record/type.rb +78 -0
  238. data/lib/active_record/type_caster/connection.rb +34 -0
  239. data/lib/active_record/type_caster/map.rb +20 -0
  240. data/lib/active_record/type_caster.rb +9 -0
  241. data/lib/active_record/validations/absence.rb +25 -0
  242. data/lib/active_record/validations/associated.rb +35 -18
  243. data/lib/active_record/validations/length.rb +26 -0
  244. data/lib/active_record/validations/presence.rb +68 -0
  245. data/lib/active_record/validations/uniqueness.rb +123 -77
  246. data/lib/active_record/validations.rb +54 -43
  247. data/lib/active_record/version.rb +7 -7
  248. data/lib/active_record.rb +97 -49
  249. data/lib/arel/alias_predication.rb +9 -0
  250. data/lib/arel/attributes/attribute.rb +37 -0
  251. data/lib/arel/attributes.rb +22 -0
  252. data/lib/arel/collectors/bind.rb +24 -0
  253. data/lib/arel/collectors/composite.rb +31 -0
  254. data/lib/arel/collectors/plain_string.rb +20 -0
  255. data/lib/arel/collectors/sql_string.rb +20 -0
  256. data/lib/arel/collectors/substitute_binds.rb +28 -0
  257. data/lib/arel/crud.rb +42 -0
  258. data/lib/arel/delete_manager.rb +18 -0
  259. data/lib/arel/errors.rb +9 -0
  260. data/lib/arel/expressions.rb +29 -0
  261. data/lib/arel/factory_methods.rb +49 -0
  262. data/lib/arel/insert_manager.rb +49 -0
  263. data/lib/arel/math.rb +45 -0
  264. data/lib/arel/nodes/and.rb +32 -0
  265. data/lib/arel/nodes/ascending.rb +23 -0
  266. data/lib/arel/nodes/binary.rb +52 -0
  267. data/lib/arel/nodes/bind_param.rb +36 -0
  268. data/lib/arel/nodes/case.rb +55 -0
  269. data/lib/arel/nodes/casted.rb +50 -0
  270. data/lib/arel/nodes/comment.rb +29 -0
  271. data/lib/arel/nodes/count.rb +12 -0
  272. data/lib/arel/nodes/delete_statement.rb +45 -0
  273. data/lib/arel/nodes/descending.rb +23 -0
  274. data/lib/arel/nodes/equality.rb +18 -0
  275. data/lib/arel/nodes/extract.rb +24 -0
  276. data/lib/arel/nodes/false.rb +16 -0
  277. data/lib/arel/nodes/full_outer_join.rb +8 -0
  278. data/lib/arel/nodes/function.rb +44 -0
  279. data/lib/arel/nodes/grouping.rb +8 -0
  280. data/lib/arel/nodes/in.rb +8 -0
  281. data/lib/arel/nodes/infix_operation.rb +80 -0
  282. data/lib/arel/nodes/inner_join.rb +8 -0
  283. data/lib/arel/nodes/insert_statement.rb +37 -0
  284. data/lib/arel/nodes/join_source.rb +20 -0
  285. data/lib/arel/nodes/matches.rb +18 -0
  286. data/lib/arel/nodes/named_function.rb +23 -0
  287. data/lib/arel/nodes/node.rb +50 -0
  288. data/lib/arel/nodes/node_expression.rb +13 -0
  289. data/lib/arel/nodes/outer_join.rb +8 -0
  290. data/lib/arel/nodes/over.rb +15 -0
  291. data/lib/arel/nodes/regexp.rb +16 -0
  292. data/lib/arel/nodes/right_outer_join.rb +8 -0
  293. data/lib/arel/nodes/select_core.rb +67 -0
  294. data/lib/arel/nodes/select_statement.rb +41 -0
  295. data/lib/arel/nodes/sql_literal.rb +16 -0
  296. data/lib/arel/nodes/string_join.rb +11 -0
  297. data/lib/arel/nodes/table_alias.rb +27 -0
  298. data/lib/arel/nodes/terminal.rb +16 -0
  299. data/lib/arel/nodes/true.rb +16 -0
  300. data/lib/arel/nodes/unary.rb +45 -0
  301. data/lib/arel/nodes/unary_operation.rb +20 -0
  302. data/lib/arel/nodes/unqualified_column.rb +22 -0
  303. data/lib/arel/nodes/update_statement.rb +41 -0
  304. data/lib/arel/nodes/values_list.rb +9 -0
  305. data/lib/arel/nodes/window.rb +126 -0
  306. data/lib/arel/nodes/with.rb +11 -0
  307. data/lib/arel/nodes.rb +68 -0
  308. data/lib/arel/order_predications.rb +13 -0
  309. data/lib/arel/predications.rb +257 -0
  310. data/lib/arel/select_manager.rb +271 -0
  311. data/lib/arel/table.rb +110 -0
  312. data/lib/arel/tree_manager.rb +72 -0
  313. data/lib/arel/update_manager.rb +34 -0
  314. data/lib/arel/visitors/depth_first.rb +204 -0
  315. data/lib/arel/visitors/dot.rb +297 -0
  316. data/lib/arel/visitors/ibm_db.rb +34 -0
  317. data/lib/arel/visitors/informix.rb +62 -0
  318. data/lib/arel/visitors/mssql.rb +157 -0
  319. data/lib/arel/visitors/mysql.rb +83 -0
  320. data/lib/arel/visitors/oracle.rb +159 -0
  321. data/lib/arel/visitors/oracle12.rb +66 -0
  322. data/lib/arel/visitors/postgresql.rb +110 -0
  323. data/lib/arel/visitors/sqlite.rb +39 -0
  324. data/lib/arel/visitors/to_sql.rb +889 -0
  325. data/lib/arel/visitors/visitor.rb +46 -0
  326. data/lib/arel/visitors/where_sql.rb +23 -0
  327. data/lib/arel/visitors.rb +20 -0
  328. data/lib/arel/window_predications.rb +9 -0
  329. data/lib/arel.rb +51 -0
  330. data/lib/rails/generators/active_record/application_record/application_record_generator.rb +27 -0
  331. data/lib/rails/generators/active_record/application_record/templates/application_record.rb.tt +5 -0
  332. data/lib/rails/generators/active_record/migration/migration_generator.rb +59 -9
  333. data/lib/rails/generators/active_record/migration/templates/create_table_migration.rb.tt +24 -0
  334. data/lib/rails/generators/active_record/migration/templates/migration.rb.tt +48 -0
  335. data/lib/rails/generators/active_record/migration.rb +41 -8
  336. data/lib/rails/generators/active_record/model/model_generator.rb +24 -22
  337. data/lib/rails/generators/active_record/model/templates/model.rb.tt +22 -0
  338. data/lib/rails/generators/active_record/model/templates/{module.rb → module.rb.tt} +1 -1
  339. data/lib/rails/generators/active_record.rb +10 -16
  340. metadata +285 -149
  341. data/examples/associations.png +0 -0
  342. data/lib/active_record/associations/has_and_belongs_to_many_association.rb +0 -63
  343. data/lib/active_record/associations/join_helper.rb +0 -55
  344. data/lib/active_record/associations/preloader/belongs_to.rb +0 -17
  345. data/lib/active_record/associations/preloader/collection_association.rb +0 -24
  346. data/lib/active_record/associations/preloader/has_and_belongs_to_many.rb +0 -60
  347. data/lib/active_record/associations/preloader/has_many.rb +0 -17
  348. data/lib/active_record/associations/preloader/has_many_through.rb +0 -15
  349. data/lib/active_record/associations/preloader/has_one.rb +0 -23
  350. data/lib/active_record/associations/preloader/has_one_through.rb +0 -9
  351. data/lib/active_record/associations/preloader/singular_association.rb +0 -21
  352. data/lib/active_record/attribute_methods/deprecated_underscore_read.rb +0 -32
  353. data/lib/active_record/connection_adapters/abstract/connection_specification.rb +0 -188
  354. data/lib/active_record/connection_adapters/mysql_adapter.rb +0 -426
  355. data/lib/active_record/connection_adapters/sqlite_adapter.rb +0 -579
  356. data/lib/active_record/dynamic_finder_match.rb +0 -68
  357. data/lib/active_record/dynamic_scope_match.rb +0 -23
  358. data/lib/active_record/fixtures/file.rb +0 -65
  359. data/lib/active_record/identity_map.rb +0 -162
  360. data/lib/active_record/observer.rb +0 -121
  361. data/lib/active_record/railties/jdbcmysql_error.rb +0 -16
  362. data/lib/active_record/serializers/xml_serializer.rb +0 -203
  363. data/lib/active_record/session_store.rb +0 -358
  364. data/lib/active_record/test_case.rb +0 -73
  365. data/lib/rails/generators/active_record/migration/templates/migration.rb +0 -34
  366. data/lib/rails/generators/active_record/model/templates/migration.rb +0 -15
  367. data/lib/rails/generators/active_record/model/templates/model.rb +0 -12
  368. data/lib/rails/generators/active_record/observer/observer_generator.rb +0 -15
  369. data/lib/rails/generators/active_record/observer/templates/observer.rb +0 -4
  370. data/lib/rails/generators/active_record/session_migration/session_migration_generator.rb +0 -25
  371. data/lib/rails/generators/active_record/session_migration/templates/migration.rb +0 -12
metadata CHANGED
@@ -1,102 +1,61 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: activerecord
3
- version: !ruby/object:Gem::Version
4
- hash: 3
5
- prerelease:
6
- segments:
7
- - 3
8
- - 2
9
- - 6
10
- version: 3.2.6
3
+ version: !ruby/object:Gem::Version
4
+ version: 6.0.0
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - David Heinemeier Hansson
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2012-06-12 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2019-08-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
21
14
  name: activesupport
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - "="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 3
31
- - 2
32
- - 6
33
- version: 3.2.6
34
- type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: activemodel
38
- prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - "="
43
- - !ruby/object:Gem::Version
44
- hash: 3
45
- segments:
46
- - 3
47
- - 2
48
- - 6
49
- version: 3.2.6
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 6.0.0
50
20
  type: :runtime
51
- version_requirements: *id002
52
- - !ruby/object:Gem::Dependency
53
- name: arel
54
21
  prerelease: false
55
- requirement: &id003 !ruby/object:Gem::Requirement
56
- none: false
57
- requirements:
58
- - - ~>
59
- - !ruby/object:Gem::Version
60
- hash: 3
61
- segments:
62
- - 3
63
- - 0
64
- - 2
65
- version: 3.0.2
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 6.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: activemodel
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 6.0.0
66
34
  type: :runtime
67
- version_requirements: *id003
68
- - !ruby/object:Gem::Dependency
69
- name: tzinfo
70
35
  prerelease: false
71
- requirement: &id004 !ruby/object:Gem::Requirement
72
- none: false
73
- requirements:
74
- - - ~>
75
- - !ruby/object:Gem::Version
76
- hash: 41
77
- segments:
78
- - 0
79
- - 3
80
- - 29
81
- version: 0.3.29
82
- type: :runtime
83
- version_requirements: *id004
84
- description: Databases on Rails. Build a persistent domain model by mapping database tables to Ruby classes. Strong conventions for associations, validations, aggregations, migrations, and testing come baked-in.
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 6.0.0
41
+ description: Databases on Rails. Build a persistent domain model by mapping database
42
+ tables to Ruby classes. Strong conventions for associations, validations, aggregations,
43
+ migrations, and testing come baked-in.
85
44
  email: david@loudthinking.com
86
45
  executables: []
87
-
88
46
  extensions: []
89
-
90
- extra_rdoc_files:
47
+ extra_rdoc_files:
91
48
  - README.rdoc
92
- files:
49
+ files:
93
50
  - CHANGELOG.md
94
51
  - MIT-LICENSE
95
52
  - README.rdoc
96
- - examples/associations.png
97
53
  - examples/performance.rb
98
54
  - examples/simple.rb
55
+ - lib/active_record.rb
99
56
  - lib/active_record/aggregations.rb
57
+ - lib/active_record/association_relation.rb
58
+ - lib/active_record/associations.rb
100
59
  - lib/active_record/associations/alias_tracker.rb
101
60
  - lib/active_record/associations/association.rb
102
61
  - lib/active_record/associations/association_scope.rb
@@ -111,33 +70,24 @@ files:
111
70
  - lib/active_record/associations/builder/singular_association.rb
112
71
  - lib/active_record/associations/collection_association.rb
113
72
  - lib/active_record/associations/collection_proxy.rb
114
- - lib/active_record/associations/has_and_belongs_to_many_association.rb
73
+ - lib/active_record/associations/foreign_association.rb
115
74
  - lib/active_record/associations/has_many_association.rb
116
75
  - lib/active_record/associations/has_many_through_association.rb
117
76
  - lib/active_record/associations/has_one_association.rb
118
77
  - lib/active_record/associations/has_one_through_association.rb
78
+ - lib/active_record/associations/join_dependency.rb
119
79
  - lib/active_record/associations/join_dependency/join_association.rb
120
80
  - lib/active_record/associations/join_dependency/join_base.rb
121
81
  - lib/active_record/associations/join_dependency/join_part.rb
122
- - lib/active_record/associations/join_dependency.rb
123
- - lib/active_record/associations/join_helper.rb
82
+ - lib/active_record/associations/preloader.rb
124
83
  - lib/active_record/associations/preloader/association.rb
125
- - lib/active_record/associations/preloader/belongs_to.rb
126
- - lib/active_record/associations/preloader/collection_association.rb
127
- - lib/active_record/associations/preloader/has_and_belongs_to_many.rb
128
- - lib/active_record/associations/preloader/has_many.rb
129
- - lib/active_record/associations/preloader/has_many_through.rb
130
- - lib/active_record/associations/preloader/has_one.rb
131
- - lib/active_record/associations/preloader/has_one_through.rb
132
- - lib/active_record/associations/preloader/singular_association.rb
133
84
  - lib/active_record/associations/preloader/through_association.rb
134
- - lib/active_record/associations/preloader.rb
135
85
  - lib/active_record/associations/singular_association.rb
136
86
  - lib/active_record/associations/through_association.rb
137
- - lib/active_record/associations.rb
138
87
  - lib/active_record/attribute_assignment.rb
88
+ - lib/active_record/attribute_decorators.rb
89
+ - lib/active_record/attribute_methods.rb
139
90
  - lib/active_record/attribute_methods/before_type_cast.rb
140
- - lib/active_record/attribute_methods/deprecated_underscore_read.rb
141
91
  - lib/active_record/attribute_methods/dirty.rb
142
92
  - lib/active_record/attribute_methods/primary_key.rb
143
93
  - lib/active_record/attribute_methods/query.rb
@@ -145,135 +95,321 @@ files:
145
95
  - lib/active_record/attribute_methods/serialization.rb
146
96
  - lib/active_record/attribute_methods/time_zone_conversion.rb
147
97
  - lib/active_record/attribute_methods/write.rb
148
- - lib/active_record/attribute_methods.rb
98
+ - lib/active_record/attributes.rb
149
99
  - lib/active_record/autosave_association.rb
150
100
  - lib/active_record/base.rb
151
101
  - lib/active_record/callbacks.rb
102
+ - lib/active_record/coders/json.rb
152
103
  - lib/active_record/coders/yaml_column.rb
153
104
  - lib/active_record/connection_adapters/abstract/connection_pool.rb
154
- - lib/active_record/connection_adapters/abstract/connection_specification.rb
155
105
  - lib/active_record/connection_adapters/abstract/database_limits.rb
156
106
  - lib/active_record/connection_adapters/abstract/database_statements.rb
157
107
  - lib/active_record/connection_adapters/abstract/query_cache.rb
158
108
  - lib/active_record/connection_adapters/abstract/quoting.rb
109
+ - lib/active_record/connection_adapters/abstract/savepoints.rb
110
+ - lib/active_record/connection_adapters/abstract/schema_creation.rb
159
111
  - lib/active_record/connection_adapters/abstract/schema_definitions.rb
112
+ - lib/active_record/connection_adapters/abstract/schema_dumper.rb
160
113
  - lib/active_record/connection_adapters/abstract/schema_statements.rb
114
+ - lib/active_record/connection_adapters/abstract/transaction.rb
161
115
  - lib/active_record/connection_adapters/abstract_adapter.rb
162
116
  - lib/active_record/connection_adapters/abstract_mysql_adapter.rb
163
117
  - lib/active_record/connection_adapters/column.rb
118
+ - lib/active_record/connection_adapters/connection_specification.rb
119
+ - lib/active_record/connection_adapters/determine_if_preparable_visitor.rb
120
+ - lib/active_record/connection_adapters/mysql/column.rb
121
+ - lib/active_record/connection_adapters/mysql/database_statements.rb
122
+ - lib/active_record/connection_adapters/mysql/explain_pretty_printer.rb
123
+ - lib/active_record/connection_adapters/mysql/quoting.rb
124
+ - lib/active_record/connection_adapters/mysql/schema_creation.rb
125
+ - lib/active_record/connection_adapters/mysql/schema_definitions.rb
126
+ - lib/active_record/connection_adapters/mysql/schema_dumper.rb
127
+ - lib/active_record/connection_adapters/mysql/schema_statements.rb
128
+ - lib/active_record/connection_adapters/mysql/type_metadata.rb
164
129
  - lib/active_record/connection_adapters/mysql2_adapter.rb
165
- - lib/active_record/connection_adapters/mysql_adapter.rb
130
+ - lib/active_record/connection_adapters/postgresql/column.rb
131
+ - lib/active_record/connection_adapters/postgresql/database_statements.rb
132
+ - lib/active_record/connection_adapters/postgresql/explain_pretty_printer.rb
133
+ - lib/active_record/connection_adapters/postgresql/oid.rb
134
+ - lib/active_record/connection_adapters/postgresql/oid/array.rb
135
+ - lib/active_record/connection_adapters/postgresql/oid/bit.rb
136
+ - lib/active_record/connection_adapters/postgresql/oid/bit_varying.rb
137
+ - lib/active_record/connection_adapters/postgresql/oid/bytea.rb
138
+ - lib/active_record/connection_adapters/postgresql/oid/cidr.rb
139
+ - lib/active_record/connection_adapters/postgresql/oid/date.rb
140
+ - lib/active_record/connection_adapters/postgresql/oid/date_time.rb
141
+ - lib/active_record/connection_adapters/postgresql/oid/decimal.rb
142
+ - lib/active_record/connection_adapters/postgresql/oid/enum.rb
143
+ - lib/active_record/connection_adapters/postgresql/oid/hstore.rb
144
+ - lib/active_record/connection_adapters/postgresql/oid/inet.rb
145
+ - lib/active_record/connection_adapters/postgresql/oid/jsonb.rb
146
+ - lib/active_record/connection_adapters/postgresql/oid/legacy_point.rb
147
+ - lib/active_record/connection_adapters/postgresql/oid/money.rb
148
+ - lib/active_record/connection_adapters/postgresql/oid/oid.rb
149
+ - lib/active_record/connection_adapters/postgresql/oid/point.rb
150
+ - lib/active_record/connection_adapters/postgresql/oid/range.rb
151
+ - lib/active_record/connection_adapters/postgresql/oid/specialized_string.rb
152
+ - lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb
153
+ - lib/active_record/connection_adapters/postgresql/oid/uuid.rb
154
+ - lib/active_record/connection_adapters/postgresql/oid/vector.rb
155
+ - lib/active_record/connection_adapters/postgresql/oid/xml.rb
156
+ - lib/active_record/connection_adapters/postgresql/quoting.rb
157
+ - lib/active_record/connection_adapters/postgresql/referential_integrity.rb
158
+ - lib/active_record/connection_adapters/postgresql/schema_creation.rb
159
+ - lib/active_record/connection_adapters/postgresql/schema_definitions.rb
160
+ - lib/active_record/connection_adapters/postgresql/schema_dumper.rb
161
+ - lib/active_record/connection_adapters/postgresql/schema_statements.rb
162
+ - lib/active_record/connection_adapters/postgresql/type_metadata.rb
163
+ - lib/active_record/connection_adapters/postgresql/utils.rb
166
164
  - lib/active_record/connection_adapters/postgresql_adapter.rb
167
165
  - lib/active_record/connection_adapters/schema_cache.rb
166
+ - lib/active_record/connection_adapters/sql_type_metadata.rb
167
+ - lib/active_record/connection_adapters/sqlite3/database_statements.rb
168
+ - lib/active_record/connection_adapters/sqlite3/explain_pretty_printer.rb
169
+ - lib/active_record/connection_adapters/sqlite3/quoting.rb
170
+ - lib/active_record/connection_adapters/sqlite3/schema_creation.rb
171
+ - lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
172
+ - lib/active_record/connection_adapters/sqlite3/schema_dumper.rb
173
+ - lib/active_record/connection_adapters/sqlite3/schema_statements.rb
168
174
  - lib/active_record/connection_adapters/sqlite3_adapter.rb
169
- - lib/active_record/connection_adapters/sqlite_adapter.rb
170
175
  - lib/active_record/connection_adapters/statement_pool.rb
176
+ - lib/active_record/connection_handling.rb
177
+ - lib/active_record/core.rb
171
178
  - lib/active_record/counter_cache.rb
172
- - lib/active_record/dynamic_finder_match.rb
179
+ - lib/active_record/database_configurations.rb
180
+ - lib/active_record/database_configurations/database_config.rb
181
+ - lib/active_record/database_configurations/hash_config.rb
182
+ - lib/active_record/database_configurations/url_config.rb
183
+ - lib/active_record/define_callbacks.rb
173
184
  - lib/active_record/dynamic_matchers.rb
174
- - lib/active_record/dynamic_scope_match.rb
185
+ - lib/active_record/enum.rb
175
186
  - lib/active_record/errors.rb
176
187
  - lib/active_record/explain.rb
188
+ - lib/active_record/explain_registry.rb
177
189
  - lib/active_record/explain_subscriber.rb
178
- - lib/active_record/fixtures/file.rb
190
+ - lib/active_record/fixture_set/file.rb
191
+ - lib/active_record/fixture_set/model_metadata.rb
192
+ - lib/active_record/fixture_set/render_context.rb
193
+ - lib/active_record/fixture_set/table_row.rb
194
+ - lib/active_record/fixture_set/table_rows.rb
179
195
  - lib/active_record/fixtures.rb
180
- - lib/active_record/identity_map.rb
196
+ - lib/active_record/gem_version.rb
181
197
  - lib/active_record/inheritance.rb
198
+ - lib/active_record/insert_all.rb
182
199
  - lib/active_record/integration.rb
200
+ - lib/active_record/internal_metadata.rb
201
+ - lib/active_record/legacy_yaml_adapter.rb
183
202
  - lib/active_record/locale/en.yml
184
203
  - lib/active_record/locking/optimistic.rb
185
204
  - lib/active_record/locking/pessimistic.rb
186
205
  - lib/active_record/log_subscriber.rb
187
- - lib/active_record/migration/command_recorder.rb
206
+ - lib/active_record/middleware/database_selector.rb
207
+ - lib/active_record/middleware/database_selector/resolver.rb
208
+ - lib/active_record/middleware/database_selector/resolver/session.rb
188
209
  - lib/active_record/migration.rb
210
+ - lib/active_record/migration/command_recorder.rb
211
+ - lib/active_record/migration/compatibility.rb
212
+ - lib/active_record/migration/join_table.rb
189
213
  - lib/active_record/model_schema.rb
190
214
  - lib/active_record/nested_attributes.rb
191
- - lib/active_record/observer.rb
215
+ - lib/active_record/no_touching.rb
216
+ - lib/active_record/null_relation.rb
192
217
  - lib/active_record/persistence.rb
193
218
  - lib/active_record/query_cache.rb
194
219
  - lib/active_record/querying.rb
195
220
  - lib/active_record/railtie.rb
221
+ - lib/active_record/railties/collection_cache_association_loading.rb
196
222
  - lib/active_record/railties/console_sandbox.rb
197
223
  - lib/active_record/railties/controller_runtime.rb
198
224
  - lib/active_record/railties/databases.rake
199
- - lib/active_record/railties/jdbcmysql_error.rb
200
225
  - lib/active_record/readonly_attributes.rb
201
226
  - lib/active_record/reflection.rb
227
+ - lib/active_record/relation.rb
202
228
  - lib/active_record/relation/batches.rb
229
+ - lib/active_record/relation/batches/batch_enumerator.rb
203
230
  - lib/active_record/relation/calculations.rb
204
231
  - lib/active_record/relation/delegation.rb
205
232
  - lib/active_record/relation/finder_methods.rb
233
+ - lib/active_record/relation/from_clause.rb
234
+ - lib/active_record/relation/merger.rb
206
235
  - lib/active_record/relation/predicate_builder.rb
236
+ - lib/active_record/relation/predicate_builder/array_handler.rb
237
+ - lib/active_record/relation/predicate_builder/association_query_value.rb
238
+ - lib/active_record/relation/predicate_builder/base_handler.rb
239
+ - lib/active_record/relation/predicate_builder/basic_object_handler.rb
240
+ - lib/active_record/relation/predicate_builder/polymorphic_array_value.rb
241
+ - lib/active_record/relation/predicate_builder/range_handler.rb
242
+ - lib/active_record/relation/predicate_builder/relation_handler.rb
243
+ - lib/active_record/relation/query_attribute.rb
207
244
  - lib/active_record/relation/query_methods.rb
245
+ - lib/active_record/relation/record_fetch_warning.rb
208
246
  - lib/active_record/relation/spawn_methods.rb
209
- - lib/active_record/relation.rb
247
+ - lib/active_record/relation/where_clause.rb
248
+ - lib/active_record/relation/where_clause_factory.rb
210
249
  - lib/active_record/result.rb
250
+ - lib/active_record/runtime_registry.rb
211
251
  - lib/active_record/sanitization.rb
212
252
  - lib/active_record/schema.rb
213
253
  - lib/active_record/schema_dumper.rb
254
+ - lib/active_record/schema_migration.rb
255
+ - lib/active_record/scoping.rb
214
256
  - lib/active_record/scoping/default.rb
215
257
  - lib/active_record/scoping/named.rb
216
- - lib/active_record/scoping.rb
258
+ - lib/active_record/secure_token.rb
217
259
  - lib/active_record/serialization.rb
218
- - lib/active_record/serializers/xml_serializer.rb
219
- - lib/active_record/session_store.rb
260
+ - lib/active_record/statement_cache.rb
220
261
  - lib/active_record/store.rb
221
- - lib/active_record/test_case.rb
262
+ - lib/active_record/suppressor.rb
263
+ - lib/active_record/table_metadata.rb
264
+ - lib/active_record/tasks/database_tasks.rb
265
+ - lib/active_record/tasks/mysql_database_tasks.rb
266
+ - lib/active_record/tasks/postgresql_database_tasks.rb
267
+ - lib/active_record/tasks/sqlite_database_tasks.rb
268
+ - lib/active_record/test_databases.rb
269
+ - lib/active_record/test_fixtures.rb
222
270
  - lib/active_record/timestamp.rb
271
+ - lib/active_record/touch_later.rb
223
272
  - lib/active_record/transactions.rb
224
273
  - lib/active_record/translation.rb
274
+ - lib/active_record/type.rb
275
+ - lib/active_record/type/adapter_specific_registry.rb
276
+ - lib/active_record/type/date.rb
277
+ - lib/active_record/type/date_time.rb
278
+ - lib/active_record/type/decimal_without_scale.rb
279
+ - lib/active_record/type/hash_lookup_type_map.rb
280
+ - lib/active_record/type/internal/timezone.rb
281
+ - lib/active_record/type/json.rb
282
+ - lib/active_record/type/serialized.rb
283
+ - lib/active_record/type/text.rb
284
+ - lib/active_record/type/time.rb
285
+ - lib/active_record/type/type_map.rb
286
+ - lib/active_record/type/unsigned_integer.rb
287
+ - lib/active_record/type_caster.rb
288
+ - lib/active_record/type_caster/connection.rb
289
+ - lib/active_record/type_caster/map.rb
290
+ - lib/active_record/validations.rb
291
+ - lib/active_record/validations/absence.rb
225
292
  - lib/active_record/validations/associated.rb
293
+ - lib/active_record/validations/length.rb
294
+ - lib/active_record/validations/presence.rb
226
295
  - lib/active_record/validations/uniqueness.rb
227
- - lib/active_record/validations.rb
228
296
  - lib/active_record/version.rb
229
- - lib/active_record.rb
230
- - lib/rails/generators/active_record/migration/migration_generator.rb
231
- - lib/rails/generators/active_record/migration/templates/migration.rb
297
+ - lib/arel.rb
298
+ - lib/arel/alias_predication.rb
299
+ - lib/arel/attributes.rb
300
+ - lib/arel/attributes/attribute.rb
301
+ - lib/arel/collectors/bind.rb
302
+ - lib/arel/collectors/composite.rb
303
+ - lib/arel/collectors/plain_string.rb
304
+ - lib/arel/collectors/sql_string.rb
305
+ - lib/arel/collectors/substitute_binds.rb
306
+ - lib/arel/crud.rb
307
+ - lib/arel/delete_manager.rb
308
+ - lib/arel/errors.rb
309
+ - lib/arel/expressions.rb
310
+ - lib/arel/factory_methods.rb
311
+ - lib/arel/insert_manager.rb
312
+ - lib/arel/math.rb
313
+ - lib/arel/nodes.rb
314
+ - lib/arel/nodes/and.rb
315
+ - lib/arel/nodes/ascending.rb
316
+ - lib/arel/nodes/binary.rb
317
+ - lib/arel/nodes/bind_param.rb
318
+ - lib/arel/nodes/case.rb
319
+ - lib/arel/nodes/casted.rb
320
+ - lib/arel/nodes/comment.rb
321
+ - lib/arel/nodes/count.rb
322
+ - lib/arel/nodes/delete_statement.rb
323
+ - lib/arel/nodes/descending.rb
324
+ - lib/arel/nodes/equality.rb
325
+ - lib/arel/nodes/extract.rb
326
+ - lib/arel/nodes/false.rb
327
+ - lib/arel/nodes/full_outer_join.rb
328
+ - lib/arel/nodes/function.rb
329
+ - lib/arel/nodes/grouping.rb
330
+ - lib/arel/nodes/in.rb
331
+ - lib/arel/nodes/infix_operation.rb
332
+ - lib/arel/nodes/inner_join.rb
333
+ - lib/arel/nodes/insert_statement.rb
334
+ - lib/arel/nodes/join_source.rb
335
+ - lib/arel/nodes/matches.rb
336
+ - lib/arel/nodes/named_function.rb
337
+ - lib/arel/nodes/node.rb
338
+ - lib/arel/nodes/node_expression.rb
339
+ - lib/arel/nodes/outer_join.rb
340
+ - lib/arel/nodes/over.rb
341
+ - lib/arel/nodes/regexp.rb
342
+ - lib/arel/nodes/right_outer_join.rb
343
+ - lib/arel/nodes/select_core.rb
344
+ - lib/arel/nodes/select_statement.rb
345
+ - lib/arel/nodes/sql_literal.rb
346
+ - lib/arel/nodes/string_join.rb
347
+ - lib/arel/nodes/table_alias.rb
348
+ - lib/arel/nodes/terminal.rb
349
+ - lib/arel/nodes/true.rb
350
+ - lib/arel/nodes/unary.rb
351
+ - lib/arel/nodes/unary_operation.rb
352
+ - lib/arel/nodes/unqualified_column.rb
353
+ - lib/arel/nodes/update_statement.rb
354
+ - lib/arel/nodes/values_list.rb
355
+ - lib/arel/nodes/window.rb
356
+ - lib/arel/nodes/with.rb
357
+ - lib/arel/order_predications.rb
358
+ - lib/arel/predications.rb
359
+ - lib/arel/select_manager.rb
360
+ - lib/arel/table.rb
361
+ - lib/arel/tree_manager.rb
362
+ - lib/arel/update_manager.rb
363
+ - lib/arel/visitors.rb
364
+ - lib/arel/visitors/depth_first.rb
365
+ - lib/arel/visitors/dot.rb
366
+ - lib/arel/visitors/ibm_db.rb
367
+ - lib/arel/visitors/informix.rb
368
+ - lib/arel/visitors/mssql.rb
369
+ - lib/arel/visitors/mysql.rb
370
+ - lib/arel/visitors/oracle.rb
371
+ - lib/arel/visitors/oracle12.rb
372
+ - lib/arel/visitors/postgresql.rb
373
+ - lib/arel/visitors/sqlite.rb
374
+ - lib/arel/visitors/to_sql.rb
375
+ - lib/arel/visitors/visitor.rb
376
+ - lib/arel/visitors/where_sql.rb
377
+ - lib/arel/window_predications.rb
378
+ - lib/rails/generators/active_record.rb
379
+ - lib/rails/generators/active_record/application_record/application_record_generator.rb
380
+ - lib/rails/generators/active_record/application_record/templates/application_record.rb.tt
232
381
  - lib/rails/generators/active_record/migration.rb
382
+ - lib/rails/generators/active_record/migration/migration_generator.rb
383
+ - lib/rails/generators/active_record/migration/templates/create_table_migration.rb.tt
384
+ - lib/rails/generators/active_record/migration/templates/migration.rb.tt
233
385
  - lib/rails/generators/active_record/model/model_generator.rb
234
- - lib/rails/generators/active_record/model/templates/migration.rb
235
- - lib/rails/generators/active_record/model/templates/model.rb
236
- - lib/rails/generators/active_record/model/templates/module.rb
237
- - lib/rails/generators/active_record/observer/observer_generator.rb
238
- - lib/rails/generators/active_record/observer/templates/observer.rb
239
- - lib/rails/generators/active_record/session_migration/session_migration_generator.rb
240
- - lib/rails/generators/active_record/session_migration/templates/migration.rb
241
- - lib/rails/generators/active_record.rb
242
- homepage: http://www.rubyonrails.org
243
- licenses: []
244
-
386
+ - lib/rails/generators/active_record/model/templates/model.rb.tt
387
+ - lib/rails/generators/active_record/model/templates/module.rb.tt
388
+ homepage: https://rubyonrails.org
389
+ licenses:
390
+ - MIT
391
+ metadata:
392
+ source_code_uri: https://github.com/rails/rails/tree/v6.0.0/activerecord
393
+ changelog_uri: https://github.com/rails/rails/blob/v6.0.0/activerecord/CHANGELOG.md
245
394
  post_install_message:
246
- rdoc_options:
247
- - --main
395
+ rdoc_options:
396
+ - "--main"
248
397
  - README.rdoc
249
- require_paths:
398
+ require_paths:
250
399
  - lib
251
- required_ruby_version: !ruby/object:Gem::Requirement
252
- none: false
253
- requirements:
400
+ required_ruby_version: !ruby/object:Gem::Requirement
401
+ requirements:
254
402
  - - ">="
255
- - !ruby/object:Gem::Version
256
- hash: 57
257
- segments:
258
- - 1
259
- - 8
260
- - 7
261
- version: 1.8.7
262
- required_rubygems_version: !ruby/object:Gem::Requirement
263
- none: false
264
- requirements:
403
+ - !ruby/object:Gem::Version
404
+ version: 2.5.0
405
+ required_rubygems_version: !ruby/object:Gem::Requirement
406
+ requirements:
265
407
  - - ">="
266
- - !ruby/object:Gem::Version
267
- hash: 3
268
- segments:
269
- - 0
270
- version: "0"
408
+ - !ruby/object:Gem::Version
409
+ version: '0'
271
410
  requirements: []
272
-
273
- rubyforge_project:
274
- rubygems_version: 1.8.22
411
+ rubygems_version: 3.0.1
275
412
  signing_key:
276
- specification_version: 3
413
+ specification_version: 4
277
414
  summary: Object-relational mapper framework (part of Rails).
278
415
  test_files: []
279
-
Binary file
@@ -1,63 +0,0 @@
1
- module ActiveRecord
2
- # = Active Record Has And Belongs To Many Association
3
- module Associations
4
- class HasAndBelongsToManyAssociation < CollectionAssociation #:nodoc:
5
- attr_reader :join_table
6
-
7
- def initialize(owner, reflection)
8
- @join_table = Arel::Table.new(reflection.options[:join_table])
9
- super
10
- end
11
-
12
- def insert_record(record, validate = true, raise = false)
13
- if record.new_record?
14
- if raise
15
- record.save!(:validate => validate)
16
- else
17
- return unless record.save(:validate => validate)
18
- end
19
- end
20
-
21
- if options[:insert_sql]
22
- owner.connection.insert(interpolate(options[:insert_sql], record))
23
- else
24
- stmt = join_table.compile_insert(
25
- join_table[reflection.foreign_key] => owner.id,
26
- join_table[reflection.association_foreign_key] => record.id
27
- )
28
-
29
- owner.connection.insert stmt
30
- end
31
-
32
- record
33
- end
34
-
35
- # ActiveRecord::Relation#delete_all needs to support joins before we can use a
36
- # SQL-only implementation.
37
- alias delete_all_on_destroy delete_all
38
-
39
- private
40
-
41
- def count_records
42
- load_target.size
43
- end
44
-
45
- def delete_records(records, method)
46
- if sql = options[:delete_sql]
47
- records = load_target if records == :all
48
- records.each { |record| owner.connection.delete(interpolate(sql, record)) }
49
- else
50
- relation = join_table
51
- stmt = relation.where(relation[reflection.foreign_key].eq(owner.id).
52
- and(relation[reflection.association_foreign_key].in(records.map { |x| x.id }.compact))
53
- ).compile_delete
54
- owner.connection.delete stmt
55
- end
56
- end
57
-
58
- def invertible_for?(record)
59
- false
60
- end
61
- end
62
- end
63
- end