activerecord 6.0.1

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 (340) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +1086 -0
  3. data/MIT-LICENSE +22 -0
  4. data/README.rdoc +219 -0
  5. data/examples/performance.rb +185 -0
  6. data/examples/simple.rb +15 -0
  7. data/lib/active_record.rb +195 -0
  8. data/lib/active_record/aggregations.rb +285 -0
  9. data/lib/active_record/association_relation.rb +49 -0
  10. data/lib/active_record/associations.rb +1865 -0
  11. data/lib/active_record/associations/alias_tracker.rb +81 -0
  12. data/lib/active_record/associations/association.rb +340 -0
  13. data/lib/active_record/associations/association_scope.rb +166 -0
  14. data/lib/active_record/associations/belongs_to_association.rb +124 -0
  15. data/lib/active_record/associations/belongs_to_polymorphic_association.rb +36 -0
  16. data/lib/active_record/associations/builder/association.rb +136 -0
  17. data/lib/active_record/associations/builder/belongs_to.rb +130 -0
  18. data/lib/active_record/associations/builder/collection_association.rb +72 -0
  19. data/lib/active_record/associations/builder/has_and_belongs_to_many.rb +114 -0
  20. data/lib/active_record/associations/builder/has_many.rb +19 -0
  21. data/lib/active_record/associations/builder/has_one.rb +64 -0
  22. data/lib/active_record/associations/builder/singular_association.rb +44 -0
  23. data/lib/active_record/associations/collection_association.rb +498 -0
  24. data/lib/active_record/associations/collection_proxy.rb +1128 -0
  25. data/lib/active_record/associations/foreign_association.rb +20 -0
  26. data/lib/active_record/associations/has_many_association.rb +136 -0
  27. data/lib/active_record/associations/has_many_through_association.rb +220 -0
  28. data/lib/active_record/associations/has_one_association.rb +118 -0
  29. data/lib/active_record/associations/has_one_through_association.rb +45 -0
  30. data/lib/active_record/associations/join_dependency.rb +262 -0
  31. data/lib/active_record/associations/join_dependency/join_association.rb +80 -0
  32. data/lib/active_record/associations/join_dependency/join_base.rb +23 -0
  33. data/lib/active_record/associations/join_dependency/join_part.rb +71 -0
  34. data/lib/active_record/associations/preloader.rb +201 -0
  35. data/lib/active_record/associations/preloader/association.rb +133 -0
  36. data/lib/active_record/associations/preloader/through_association.rb +116 -0
  37. data/lib/active_record/associations/singular_association.rb +59 -0
  38. data/lib/active_record/associations/through_association.rb +121 -0
  39. data/lib/active_record/attribute_assignment.rb +85 -0
  40. data/lib/active_record/attribute_decorators.rb +90 -0
  41. data/lib/active_record/attribute_methods.rb +420 -0
  42. data/lib/active_record/attribute_methods/before_type_cast.rb +81 -0
  43. data/lib/active_record/attribute_methods/dirty.rb +221 -0
  44. data/lib/active_record/attribute_methods/primary_key.rb +136 -0
  45. data/lib/active_record/attribute_methods/query.rb +41 -0
  46. data/lib/active_record/attribute_methods/read.rb +47 -0
  47. data/lib/active_record/attribute_methods/serialization.rb +90 -0
  48. data/lib/active_record/attribute_methods/time_zone_conversion.rb +91 -0
  49. data/lib/active_record/attribute_methods/write.rb +61 -0
  50. data/lib/active_record/attributes.rb +279 -0
  51. data/lib/active_record/autosave_association.rb +512 -0
  52. data/lib/active_record/base.rb +328 -0
  53. data/lib/active_record/callbacks.rb +339 -0
  54. data/lib/active_record/coders/json.rb +15 -0
  55. data/lib/active_record/coders/yaml_column.rb +50 -0
  56. data/lib/active_record/connection_adapters/abstract/connection_pool.rb +1175 -0
  57. data/lib/active_record/connection_adapters/abstract/database_limits.rb +85 -0
  58. data/lib/active_record/connection_adapters/abstract/database_statements.rb +516 -0
  59. data/lib/active_record/connection_adapters/abstract/query_cache.rb +155 -0
  60. data/lib/active_record/connection_adapters/abstract/quoting.rb +251 -0
  61. data/lib/active_record/connection_adapters/abstract/savepoints.rb +23 -0
  62. data/lib/active_record/connection_adapters/abstract/schema_creation.rb +153 -0
  63. data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +713 -0
  64. data/lib/active_record/connection_adapters/abstract/schema_dumper.rb +93 -0
  65. data/lib/active_record/connection_adapters/abstract/schema_statements.rb +1475 -0
  66. data/lib/active_record/connection_adapters/abstract/transaction.rb +323 -0
  67. data/lib/active_record/connection_adapters/abstract_adapter.rb +772 -0
  68. data/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +830 -0
  69. data/lib/active_record/connection_adapters/column.rb +95 -0
  70. data/lib/active_record/connection_adapters/connection_specification.rb +297 -0
  71. data/lib/active_record/connection_adapters/determine_if_preparable_visitor.rb +29 -0
  72. data/lib/active_record/connection_adapters/mysql/column.rb +27 -0
  73. data/lib/active_record/connection_adapters/mysql/database_statements.rb +202 -0
  74. data/lib/active_record/connection_adapters/mysql/explain_pretty_printer.rb +72 -0
  75. data/lib/active_record/connection_adapters/mysql/quoting.rb +81 -0
  76. data/lib/active_record/connection_adapters/mysql/schema_creation.rb +72 -0
  77. data/lib/active_record/connection_adapters/mysql/schema_definitions.rb +95 -0
  78. data/lib/active_record/connection_adapters/mysql/schema_dumper.rb +88 -0
  79. data/lib/active_record/connection_adapters/mysql/schema_statements.rb +264 -0
  80. data/lib/active_record/connection_adapters/mysql/type_metadata.rb +31 -0
  81. data/lib/active_record/connection_adapters/mysql2_adapter.rb +146 -0
  82. data/lib/active_record/connection_adapters/postgresql/column.rb +30 -0
  83. data/lib/active_record/connection_adapters/postgresql/database_statements.rb +184 -0
  84. data/lib/active_record/connection_adapters/postgresql/explain_pretty_printer.rb +44 -0
  85. data/lib/active_record/connection_adapters/postgresql/oid.rb +34 -0
  86. data/lib/active_record/connection_adapters/postgresql/oid/array.rb +92 -0
  87. data/lib/active_record/connection_adapters/postgresql/oid/bit.rb +53 -0
  88. data/lib/active_record/connection_adapters/postgresql/oid/bit_varying.rb +15 -0
  89. data/lib/active_record/connection_adapters/postgresql/oid/bytea.rb +17 -0
  90. data/lib/active_record/connection_adapters/postgresql/oid/cidr.rb +50 -0
  91. data/lib/active_record/connection_adapters/postgresql/oid/date.rb +23 -0
  92. data/lib/active_record/connection_adapters/postgresql/oid/date_time.rb +23 -0
  93. data/lib/active_record/connection_adapters/postgresql/oid/decimal.rb +15 -0
  94. data/lib/active_record/connection_adapters/postgresql/oid/enum.rb +21 -0
  95. data/lib/active_record/connection_adapters/postgresql/oid/hstore.rb +71 -0
  96. data/lib/active_record/connection_adapters/postgresql/oid/inet.rb +15 -0
  97. data/lib/active_record/connection_adapters/postgresql/oid/jsonb.rb +15 -0
  98. data/lib/active_record/connection_adapters/postgresql/oid/legacy_point.rb +45 -0
  99. data/lib/active_record/connection_adapters/postgresql/oid/money.rb +41 -0
  100. data/lib/active_record/connection_adapters/postgresql/oid/oid.rb +15 -0
  101. data/lib/active_record/connection_adapters/postgresql/oid/point.rb +65 -0
  102. data/lib/active_record/connection_adapters/postgresql/oid/range.rb +97 -0
  103. data/lib/active_record/connection_adapters/postgresql/oid/specialized_string.rb +18 -0
  104. data/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb +113 -0
  105. data/lib/active_record/connection_adapters/postgresql/oid/uuid.rb +26 -0
  106. data/lib/active_record/connection_adapters/postgresql/oid/vector.rb +28 -0
  107. data/lib/active_record/connection_adapters/postgresql/oid/xml.rb +30 -0
  108. data/lib/active_record/connection_adapters/postgresql/quoting.rb +205 -0
  109. data/lib/active_record/connection_adapters/postgresql/referential_integrity.rb +43 -0
  110. data/lib/active_record/connection_adapters/postgresql/schema_creation.rb +76 -0
  111. data/lib/active_record/connection_adapters/postgresql/schema_definitions.rb +222 -0
  112. data/lib/active_record/connection_adapters/postgresql/schema_dumper.rb +50 -0
  113. data/lib/active_record/connection_adapters/postgresql/schema_statements.rb +776 -0
  114. data/lib/active_record/connection_adapters/postgresql/type_metadata.rb +36 -0
  115. data/lib/active_record/connection_adapters/postgresql/utils.rb +81 -0
  116. data/lib/active_record/connection_adapters/postgresql_adapter.rb +953 -0
  117. data/lib/active_record/connection_adapters/schema_cache.rb +141 -0
  118. data/lib/active_record/connection_adapters/sql_type_metadata.rb +37 -0
  119. data/lib/active_record/connection_adapters/sqlite3/database_statements.rb +120 -0
  120. data/lib/active_record/connection_adapters/sqlite3/explain_pretty_printer.rb +21 -0
  121. data/lib/active_record/connection_adapters/sqlite3/quoting.rb +103 -0
  122. data/lib/active_record/connection_adapters/sqlite3/schema_creation.rb +17 -0
  123. data/lib/active_record/connection_adapters/sqlite3/schema_definitions.rb +19 -0
  124. data/lib/active_record/connection_adapters/sqlite3/schema_dumper.rb +18 -0
  125. data/lib/active_record/connection_adapters/sqlite3/schema_statements.rb +137 -0
  126. data/lib/active_record/connection_adapters/sqlite3_adapter.rb +561 -0
  127. data/lib/active_record/connection_adapters/statement_pool.rb +61 -0
  128. data/lib/active_record/connection_handling.rb +274 -0
  129. data/lib/active_record/core.rb +603 -0
  130. data/lib/active_record/counter_cache.rb +193 -0
  131. data/lib/active_record/database_configurations.rb +233 -0
  132. data/lib/active_record/database_configurations/database_config.rb +37 -0
  133. data/lib/active_record/database_configurations/hash_config.rb +50 -0
  134. data/lib/active_record/database_configurations/url_config.rb +79 -0
  135. data/lib/active_record/define_callbacks.rb +22 -0
  136. data/lib/active_record/dynamic_matchers.rb +122 -0
  137. data/lib/active_record/enum.rb +274 -0
  138. data/lib/active_record/errors.rb +388 -0
  139. data/lib/active_record/explain.rb +50 -0
  140. data/lib/active_record/explain_registry.rb +32 -0
  141. data/lib/active_record/explain_subscriber.rb +34 -0
  142. data/lib/active_record/fixture_set/file.rb +82 -0
  143. data/lib/active_record/fixture_set/model_metadata.rb +33 -0
  144. data/lib/active_record/fixture_set/render_context.rb +17 -0
  145. data/lib/active_record/fixture_set/table_row.rb +153 -0
  146. data/lib/active_record/fixture_set/table_rows.rb +47 -0
  147. data/lib/active_record/fixtures.rb +738 -0
  148. data/lib/active_record/gem_version.rb +17 -0
  149. data/lib/active_record/inheritance.rb +293 -0
  150. data/lib/active_record/insert_all.rb +179 -0
  151. data/lib/active_record/integration.rb +207 -0
  152. data/lib/active_record/internal_metadata.rb +53 -0
  153. data/lib/active_record/legacy_yaml_adapter.rb +48 -0
  154. data/lib/active_record/locale/en.yml +48 -0
  155. data/lib/active_record/locking/optimistic.rb +197 -0
  156. data/lib/active_record/locking/pessimistic.rb +89 -0
  157. data/lib/active_record/log_subscriber.rb +118 -0
  158. data/lib/active_record/middleware/database_selector.rb +75 -0
  159. data/lib/active_record/middleware/database_selector/resolver.rb +88 -0
  160. data/lib/active_record/middleware/database_selector/resolver/session.rb +45 -0
  161. data/lib/active_record/migration.rb +1397 -0
  162. data/lib/active_record/migration/command_recorder.rb +284 -0
  163. data/lib/active_record/migration/compatibility.rb +244 -0
  164. data/lib/active_record/migration/join_table.rb +17 -0
  165. data/lib/active_record/model_schema.rb +545 -0
  166. data/lib/active_record/nested_attributes.rb +600 -0
  167. data/lib/active_record/no_touching.rb +65 -0
  168. data/lib/active_record/null_relation.rb +68 -0
  169. data/lib/active_record/persistence.rb +967 -0
  170. data/lib/active_record/query_cache.rb +52 -0
  171. data/lib/active_record/querying.rb +82 -0
  172. data/lib/active_record/railtie.rb +263 -0
  173. data/lib/active_record/railties/collection_cache_association_loading.rb +34 -0
  174. data/lib/active_record/railties/console_sandbox.rb +7 -0
  175. data/lib/active_record/railties/controller_runtime.rb +51 -0
  176. data/lib/active_record/railties/databases.rake +527 -0
  177. data/lib/active_record/readonly_attributes.rb +24 -0
  178. data/lib/active_record/reflection.rb +1042 -0
  179. data/lib/active_record/relation.rb +860 -0
  180. data/lib/active_record/relation/batches.rb +290 -0
  181. data/lib/active_record/relation/batches/batch_enumerator.rb +69 -0
  182. data/lib/active_record/relation/calculations.rb +424 -0
  183. data/lib/active_record/relation/delegation.rb +130 -0
  184. data/lib/active_record/relation/finder_methods.rb +561 -0
  185. data/lib/active_record/relation/from_clause.rb +26 -0
  186. data/lib/active_record/relation/merger.rb +184 -0
  187. data/lib/active_record/relation/predicate_builder.rb +150 -0
  188. data/lib/active_record/relation/predicate_builder/array_handler.rb +49 -0
  189. data/lib/active_record/relation/predicate_builder/association_query_value.rb +43 -0
  190. data/lib/active_record/relation/predicate_builder/base_handler.rb +18 -0
  191. data/lib/active_record/relation/predicate_builder/basic_object_handler.rb +19 -0
  192. data/lib/active_record/relation/predicate_builder/polymorphic_array_value.rb +53 -0
  193. data/lib/active_record/relation/predicate_builder/range_handler.rb +22 -0
  194. data/lib/active_record/relation/predicate_builder/relation_handler.rb +19 -0
  195. data/lib/active_record/relation/query_attribute.rb +50 -0
  196. data/lib/active_record/relation/query_methods.rb +1371 -0
  197. data/lib/active_record/relation/record_fetch_warning.rb +51 -0
  198. data/lib/active_record/relation/spawn_methods.rb +77 -0
  199. data/lib/active_record/relation/where_clause.rb +190 -0
  200. data/lib/active_record/relation/where_clause_factory.rb +33 -0
  201. data/lib/active_record/result.rb +168 -0
  202. data/lib/active_record/runtime_registry.rb +24 -0
  203. data/lib/active_record/sanitization.rb +214 -0
  204. data/lib/active_record/schema.rb +61 -0
  205. data/lib/active_record/schema_dumper.rb +270 -0
  206. data/lib/active_record/schema_migration.rb +60 -0
  207. data/lib/active_record/scoping.rb +106 -0
  208. data/lib/active_record/scoping/default.rb +151 -0
  209. data/lib/active_record/scoping/named.rb +217 -0
  210. data/lib/active_record/secure_token.rb +40 -0
  211. data/lib/active_record/serialization.rb +22 -0
  212. data/lib/active_record/statement_cache.rb +148 -0
  213. data/lib/active_record/store.rb +290 -0
  214. data/lib/active_record/suppressor.rb +61 -0
  215. data/lib/active_record/table_metadata.rb +75 -0
  216. data/lib/active_record/tasks/database_tasks.rb +506 -0
  217. data/lib/active_record/tasks/mysql_database_tasks.rb +115 -0
  218. data/lib/active_record/tasks/postgresql_database_tasks.rb +141 -0
  219. data/lib/active_record/tasks/sqlite_database_tasks.rb +77 -0
  220. data/lib/active_record/test_databases.rb +23 -0
  221. data/lib/active_record/test_fixtures.rb +224 -0
  222. data/lib/active_record/timestamp.rb +167 -0
  223. data/lib/active_record/touch_later.rb +66 -0
  224. data/lib/active_record/transactions.rb +493 -0
  225. data/lib/active_record/translation.rb +24 -0
  226. data/lib/active_record/type.rb +78 -0
  227. data/lib/active_record/type/adapter_specific_registry.rb +129 -0
  228. data/lib/active_record/type/date.rb +9 -0
  229. data/lib/active_record/type/date_time.rb +9 -0
  230. data/lib/active_record/type/decimal_without_scale.rb +15 -0
  231. data/lib/active_record/type/hash_lookup_type_map.rb +25 -0
  232. data/lib/active_record/type/internal/timezone.rb +17 -0
  233. data/lib/active_record/type/json.rb +30 -0
  234. data/lib/active_record/type/serialized.rb +71 -0
  235. data/lib/active_record/type/text.rb +11 -0
  236. data/lib/active_record/type/time.rb +21 -0
  237. data/lib/active_record/type/type_map.rb +62 -0
  238. data/lib/active_record/type/unsigned_integer.rb +17 -0
  239. data/lib/active_record/type_caster.rb +9 -0
  240. data/lib/active_record/type_caster/connection.rb +34 -0
  241. data/lib/active_record/type_caster/map.rb +20 -0
  242. data/lib/active_record/validations.rb +94 -0
  243. data/lib/active_record/validations/absence.rb +25 -0
  244. data/lib/active_record/validations/associated.rb +60 -0
  245. data/lib/active_record/validations/length.rb +26 -0
  246. data/lib/active_record/validations/presence.rb +68 -0
  247. data/lib/active_record/validations/uniqueness.rb +226 -0
  248. data/lib/active_record/version.rb +10 -0
  249. data/lib/arel.rb +58 -0
  250. data/lib/arel/alias_predication.rb +9 -0
  251. data/lib/arel/attributes.rb +22 -0
  252. data/lib/arel/attributes/attribute.rb +37 -0
  253. data/lib/arel/collectors/bind.rb +24 -0
  254. data/lib/arel/collectors/composite.rb +31 -0
  255. data/lib/arel/collectors/plain_string.rb +20 -0
  256. data/lib/arel/collectors/sql_string.rb +20 -0
  257. data/lib/arel/collectors/substitute_binds.rb +28 -0
  258. data/lib/arel/crud.rb +42 -0
  259. data/lib/arel/delete_manager.rb +18 -0
  260. data/lib/arel/errors.rb +9 -0
  261. data/lib/arel/expressions.rb +29 -0
  262. data/lib/arel/factory_methods.rb +49 -0
  263. data/lib/arel/insert_manager.rb +49 -0
  264. data/lib/arel/math.rb +45 -0
  265. data/lib/arel/nodes.rb +68 -0
  266. data/lib/arel/nodes/and.rb +32 -0
  267. data/lib/arel/nodes/ascending.rb +23 -0
  268. data/lib/arel/nodes/binary.rb +52 -0
  269. data/lib/arel/nodes/bind_param.rb +36 -0
  270. data/lib/arel/nodes/case.rb +55 -0
  271. data/lib/arel/nodes/casted.rb +50 -0
  272. data/lib/arel/nodes/comment.rb +29 -0
  273. data/lib/arel/nodes/count.rb +12 -0
  274. data/lib/arel/nodes/delete_statement.rb +45 -0
  275. data/lib/arel/nodes/descending.rb +23 -0
  276. data/lib/arel/nodes/equality.rb +18 -0
  277. data/lib/arel/nodes/extract.rb +24 -0
  278. data/lib/arel/nodes/false.rb +16 -0
  279. data/lib/arel/nodes/full_outer_join.rb +8 -0
  280. data/lib/arel/nodes/function.rb +44 -0
  281. data/lib/arel/nodes/grouping.rb +8 -0
  282. data/lib/arel/nodes/in.rb +8 -0
  283. data/lib/arel/nodes/infix_operation.rb +80 -0
  284. data/lib/arel/nodes/inner_join.rb +8 -0
  285. data/lib/arel/nodes/insert_statement.rb +37 -0
  286. data/lib/arel/nodes/join_source.rb +20 -0
  287. data/lib/arel/nodes/matches.rb +18 -0
  288. data/lib/arel/nodes/named_function.rb +23 -0
  289. data/lib/arel/nodes/node.rb +50 -0
  290. data/lib/arel/nodes/node_expression.rb +13 -0
  291. data/lib/arel/nodes/outer_join.rb +8 -0
  292. data/lib/arel/nodes/over.rb +15 -0
  293. data/lib/arel/nodes/regexp.rb +16 -0
  294. data/lib/arel/nodes/right_outer_join.rb +8 -0
  295. data/lib/arel/nodes/select_core.rb +67 -0
  296. data/lib/arel/nodes/select_statement.rb +41 -0
  297. data/lib/arel/nodes/sql_literal.rb +16 -0
  298. data/lib/arel/nodes/string_join.rb +11 -0
  299. data/lib/arel/nodes/table_alias.rb +27 -0
  300. data/lib/arel/nodes/terminal.rb +16 -0
  301. data/lib/arel/nodes/true.rb +16 -0
  302. data/lib/arel/nodes/unary.rb +45 -0
  303. data/lib/arel/nodes/unary_operation.rb +20 -0
  304. data/lib/arel/nodes/unqualified_column.rb +22 -0
  305. data/lib/arel/nodes/update_statement.rb +41 -0
  306. data/lib/arel/nodes/values_list.rb +9 -0
  307. data/lib/arel/nodes/window.rb +126 -0
  308. data/lib/arel/nodes/with.rb +11 -0
  309. data/lib/arel/order_predications.rb +13 -0
  310. data/lib/arel/predications.rb +257 -0
  311. data/lib/arel/select_manager.rb +271 -0
  312. data/lib/arel/table.rb +110 -0
  313. data/lib/arel/tree_manager.rb +72 -0
  314. data/lib/arel/update_manager.rb +34 -0
  315. data/lib/arel/visitors.rb +20 -0
  316. data/lib/arel/visitors/depth_first.rb +204 -0
  317. data/lib/arel/visitors/dot.rb +297 -0
  318. data/lib/arel/visitors/ibm_db.rb +34 -0
  319. data/lib/arel/visitors/informix.rb +62 -0
  320. data/lib/arel/visitors/mssql.rb +157 -0
  321. data/lib/arel/visitors/mysql.rb +83 -0
  322. data/lib/arel/visitors/oracle.rb +159 -0
  323. data/lib/arel/visitors/oracle12.rb +66 -0
  324. data/lib/arel/visitors/postgresql.rb +110 -0
  325. data/lib/arel/visitors/sqlite.rb +39 -0
  326. data/lib/arel/visitors/to_sql.rb +889 -0
  327. data/lib/arel/visitors/visitor.rb +46 -0
  328. data/lib/arel/visitors/where_sql.rb +23 -0
  329. data/lib/arel/window_predications.rb +9 -0
  330. data/lib/rails/generators/active_record.rb +19 -0
  331. data/lib/rails/generators/active_record/application_record/application_record_generator.rb +27 -0
  332. data/lib/rails/generators/active_record/application_record/templates/application_record.rb.tt +5 -0
  333. data/lib/rails/generators/active_record/migration.rb +48 -0
  334. data/lib/rails/generators/active_record/migration/migration_generator.rb +75 -0
  335. data/lib/rails/generators/active_record/migration/templates/create_table_migration.rb.tt +24 -0
  336. data/lib/rails/generators/active_record/migration/templates/migration.rb.tt +48 -0
  337. data/lib/rails/generators/active_record/model/model_generator.rb +49 -0
  338. data/lib/rails/generators/active_record/model/templates/model.rb.tt +22 -0
  339. data/lib/rails/generators/active_record/model/templates/module.rb.tt +7 -0
  340. metadata +418 -0
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Arel # :nodoc: all
4
+ module Visitors
5
+ class Visitor
6
+ def initialize
7
+ @dispatch = get_dispatch_cache
8
+ end
9
+
10
+ def accept(object, collector = nil)
11
+ visit object, collector
12
+ end
13
+
14
+ private
15
+
16
+ attr_reader :dispatch
17
+
18
+ def self.dispatch_cache
19
+ @dispatch_cache ||= Hash.new do |hash, klass|
20
+ hash[klass] = "visit_#{(klass.name || '').gsub('::', '_')}"
21
+ end
22
+ end
23
+
24
+ def get_dispatch_cache
25
+ self.class.dispatch_cache
26
+ end
27
+
28
+ def visit(object, collector = nil)
29
+ dispatch_method = dispatch[object.class]
30
+ if collector
31
+ send dispatch_method, object, collector
32
+ else
33
+ send dispatch_method, object
34
+ end
35
+ rescue NoMethodError => e
36
+ raise e if respond_to?(dispatch_method, true)
37
+ superklass = object.class.ancestors.find { |klass|
38
+ respond_to?(dispatch[klass], true)
39
+ }
40
+ raise(TypeError, "Cannot visit #{object.class}") unless superklass
41
+ dispatch[object.class] = dispatch[superklass]
42
+ retry
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Arel # :nodoc: all
4
+ module Visitors
5
+ class WhereSql < Arel::Visitors::ToSql
6
+ def initialize(inner_visitor, *args, &block)
7
+ @inner_visitor = inner_visitor
8
+ super(*args, &block)
9
+ end
10
+
11
+ private
12
+
13
+ def visit_Arel_Nodes_SelectCore(o, collector)
14
+ collector << "WHERE "
15
+ wheres = o.wheres.map do |where|
16
+ Nodes::SqlLiteral.new(@inner_visitor.accept(where, collector.class.new).value)
17
+ end
18
+
19
+ inject_join wheres, collector, " AND "
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Arel # :nodoc: all
4
+ module WindowPredications
5
+ def over(expr = nil)
6
+ Nodes::Over.new(self, expr)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails/generators/named_base"
4
+ require "rails/generators/active_model"
5
+ require "rails/generators/active_record/migration"
6
+ require "active_record"
7
+
8
+ module ActiveRecord
9
+ module Generators # :nodoc:
10
+ class Base < Rails::Generators::NamedBase # :nodoc:
11
+ include ActiveRecord::Generators::Migration
12
+
13
+ # Set the current directory as base for the inherited generators.
14
+ def self.base_root
15
+ __dir__
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails/generators/active_record"
4
+
5
+ module ActiveRecord
6
+ module Generators # :nodoc:
7
+ class ApplicationRecordGenerator < ::Rails::Generators::Base # :nodoc:
8
+ source_root File.expand_path("templates", __dir__)
9
+
10
+ # FIXME: Change this file to a symlink once RubyGems 2.5.0 is required.
11
+ def create_application_record
12
+ template "application_record.rb", application_record_file_name
13
+ end
14
+
15
+ private
16
+
17
+ def application_record_file_name
18
+ @application_record_file_name ||=
19
+ if namespaced?
20
+ "app/models/#{namespaced_path}/application_record.rb"
21
+ else
22
+ "app/models/application_record.rb"
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,5 @@
1
+ <% module_namespacing do -%>
2
+ class ApplicationRecord < ActiveRecord::Base
3
+ self.abstract_class = true
4
+ end
5
+ <% end -%>
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails/generators/migration"
4
+
5
+ module ActiveRecord
6
+ module Generators # :nodoc:
7
+ module Migration
8
+ extend ActiveSupport::Concern
9
+ include Rails::Generators::Migration
10
+
11
+ module ClassMethods
12
+ # Implement the required interface for Rails::Generators::Migration.
13
+ def next_migration_number(dirname)
14
+ next_migration_number = current_migration_number(dirname) + 1
15
+ ActiveRecord::Migration.next_migration_number(next_migration_number)
16
+ end
17
+ end
18
+
19
+ private
20
+
21
+ def primary_key_type
22
+ key_type = options[:primary_key_type]
23
+ ", id: :#{key_type}" if key_type
24
+ end
25
+
26
+ def db_migrate_path
27
+ if defined?(Rails.application) && Rails.application
28
+ configured_migrate_path || default_migrate_path
29
+ else
30
+ "db/migrate"
31
+ end
32
+ end
33
+
34
+ def default_migrate_path
35
+ Rails.application.config.paths["db/migrate"].to_ary.first
36
+ end
37
+
38
+ def configured_migrate_path
39
+ return unless database = options[:database]
40
+ config = ActiveRecord::Base.configurations.configs_for(
41
+ env_name: Rails.env,
42
+ spec_name: database,
43
+ )
44
+ config&.migrations_paths
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails/generators/active_record"
4
+
5
+ module ActiveRecord
6
+ module Generators # :nodoc:
7
+ class MigrationGenerator < Base # :nodoc:
8
+ argument :attributes, type: :array, default: [], banner: "field[:type][:index] field[:type][:index]"
9
+
10
+ class_option :primary_key_type, type: :string, desc: "The type for primary key"
11
+ class_option :database, type: :string, aliases: %i(--db), desc: "The database for your migration. By default, the current environment's primary database is used."
12
+
13
+ def create_migration_file
14
+ set_local_assigns!
15
+ validate_file_name!
16
+ migration_template @migration_template, File.join(db_migrate_path, "#{file_name}.rb")
17
+ end
18
+
19
+ private
20
+ attr_reader :migration_action, :join_tables
21
+
22
+ # Sets the default migration template that is being used for the generation of the migration.
23
+ # Depending on command line arguments, the migration template and the table name instance
24
+ # variables are set up.
25
+ def set_local_assigns!
26
+ @migration_template = "migration.rb"
27
+ case file_name
28
+ when /^(add)_.*_to_(.*)/, /^(remove)_.*?_from_(.*)/
29
+ @migration_action = $1
30
+ @table_name = normalize_table_name($2)
31
+ when /join_table/
32
+ if attributes.length == 2
33
+ @migration_action = "join"
34
+ @join_tables = pluralize_table_names? ? attributes.map(&:plural_name) : attributes.map(&:singular_name)
35
+
36
+ set_index_names
37
+ end
38
+ when /^create_(.+)/
39
+ @table_name = normalize_table_name($1)
40
+ @migration_template = "create_table_migration.rb"
41
+ end
42
+ end
43
+
44
+ def set_index_names
45
+ attributes.each_with_index do |attr, i|
46
+ attr.index_name = [attr, attributes[i - 1]].map { |a| index_name_for(a) }
47
+ end
48
+ end
49
+
50
+ def index_name_for(attribute)
51
+ if attribute.foreign_key?
52
+ attribute.name
53
+ else
54
+ attribute.name.singularize.foreign_key
55
+ end.to_sym
56
+ end
57
+
58
+ def attributes_with_index
59
+ attributes.select { |a| !a.reference? && a.has_index? }
60
+ end
61
+
62
+ # A migration file name can only contain underscores (_), lowercase characters,
63
+ # and numbers 0-9. Any other file name will raise an IllegalMigrationNameError.
64
+ def validate_file_name!
65
+ unless /^[_a-z0-9]+$/.match?(file_name)
66
+ raise IllegalMigrationNameError.new(file_name)
67
+ end
68
+ end
69
+
70
+ def normalize_table_name(_table_name)
71
+ pluralize_table_names? ? _table_name.pluralize : _table_name.singularize
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,24 @@
1
+ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
2
+ def change
3
+ create_table :<%= table_name %><%= primary_key_type %> do |t|
4
+ <% attributes.each do |attribute| -%>
5
+ <% if attribute.password_digest? -%>
6
+ t.string :password_digest<%= attribute.inject_options %>
7
+ <% elsif attribute.token? -%>
8
+ t.string :<%= attribute.name %><%= attribute.inject_options %>
9
+ <% elsif !attribute.virtual? -%>
10
+ t.<%= attribute.type %> :<%= attribute.name %><%= attribute.inject_options %>
11
+ <% end -%>
12
+ <% end -%>
13
+ <% if options[:timestamps] %>
14
+ t.timestamps
15
+ <% end -%>
16
+ end
17
+ <% attributes.select(&:token?).each do |attribute| -%>
18
+ add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>, unique: true
19
+ <% end -%>
20
+ <% attributes_with_index.each do |attribute| -%>
21
+ add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
22
+ <% end -%>
23
+ end
24
+ end
@@ -0,0 +1,48 @@
1
+ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
2
+ <%- if migration_action == 'add' -%>
3
+ def change
4
+ <% attributes.each do |attribute| -%>
5
+ <%- if attribute.reference? -%>
6
+ add_reference :<%= table_name %>, :<%= attribute.name %><%= attribute.inject_options %>
7
+ <%- elsif attribute.token? -%>
8
+ add_column :<%= table_name %>, :<%= attribute.name %>, :string<%= attribute.inject_options %>
9
+ add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>, unique: true
10
+ <%- elsif !attribute.virtual? -%>
11
+ add_column :<%= table_name %>, :<%= attribute.name %>, :<%= attribute.type %><%= attribute.inject_options %>
12
+ <%- if attribute.has_index? -%>
13
+ add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
14
+ <%- end -%>
15
+ <%- end -%>
16
+ <%- end -%>
17
+ end
18
+ <%- elsif migration_action == 'join' -%>
19
+ def change
20
+ create_join_table :<%= join_tables.first %>, :<%= join_tables.second %> do |t|
21
+ <%- attributes.each do |attribute| -%>
22
+ <%- if attribute.reference? -%>
23
+ t.references :<%= attribute.name %><%= attribute.inject_options %>
24
+ <%- elsif !attribute.virtual? -%>
25
+ <%= '# ' unless attribute.has_index? -%>t.index <%= attribute.index_name %><%= attribute.inject_index_options %>
26
+ <%- end -%>
27
+ <%- end -%>
28
+ end
29
+ end
30
+ <%- else -%>
31
+ def change
32
+ <% attributes.each do |attribute| -%>
33
+ <%- if migration_action -%>
34
+ <%- if attribute.reference? -%>
35
+ remove_reference :<%= table_name %>, :<%= attribute.name %><%= attribute.inject_options %>
36
+ <%- else -%>
37
+ <%- if attribute.has_index? -%>
38
+ remove_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
39
+ <%- end -%>
40
+ <%- if !attribute.virtual? %>
41
+ remove_column :<%= table_name %>, :<%= attribute.name %>, :<%= attribute.type %><%= attribute.inject_options %>
42
+ <%- end -%>
43
+ <%- end -%>
44
+ <%- end -%>
45
+ <%- end -%>
46
+ end
47
+ <%- end -%>
48
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails/generators/active_record"
4
+
5
+ module ActiveRecord
6
+ module Generators # :nodoc:
7
+ class ModelGenerator < Base # :nodoc:
8
+ argument :attributes, type: :array, default: [], banner: "field[:type][:index] field[:type][:index]"
9
+
10
+ check_class_collision
11
+
12
+ class_option :migration, type: :boolean
13
+ class_option :timestamps, type: :boolean
14
+ class_option :parent, type: :string, desc: "The parent class for the generated model"
15
+ class_option :indexes, type: :boolean, default: true, desc: "Add indexes for references and belongs_to columns"
16
+ class_option :primary_key_type, type: :string, desc: "The type for primary key"
17
+ class_option :database, type: :string, aliases: %i(--db), desc: "The database for your model's migration. By default, the current environment's primary database is used."
18
+
19
+ # creates the migration file for the model.
20
+ def create_migration_file
21
+ return unless options[:migration] && options[:parent].nil?
22
+ attributes.each { |a| a.attr_options.delete(:index) if a.reference? && !a.has_index? } if options[:indexes] == false
23
+ migration_template "../../migration/templates/create_table_migration.rb", File.join(db_migrate_path, "create_#{table_name}.rb")
24
+ end
25
+
26
+ def create_model_file
27
+ template "model.rb", File.join("app/models", class_path, "#{file_name}.rb")
28
+ end
29
+
30
+ def create_module_file
31
+ return if regular_class_path.empty?
32
+ template "module.rb", File.join("app/models", "#{class_path.join('/')}.rb") if behavior == :invoke
33
+ end
34
+
35
+ hook_for :test_framework
36
+
37
+ private
38
+
39
+ def attributes_with_index
40
+ attributes.select { |a| !a.reference? && a.has_index? }
41
+ end
42
+
43
+ # Used by the migration template to determine the parent name of the model
44
+ def parent_class_name
45
+ options[:parent] || "ApplicationRecord"
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,22 @@
1
+ <% module_namespacing do -%>
2
+ class <%= class_name %> < <%= parent_class_name.classify %>
3
+ <% attributes.select(&:reference?).each do |attribute| -%>
4
+ belongs_to :<%= attribute.name %><%= ', polymorphic: true' if attribute.polymorphic? %>
5
+ <% end -%>
6
+ <% attributes.select(&:rich_text?).each do |attribute| -%>
7
+ has_rich_text :<%= attribute.name %>
8
+ <% end -%>
9
+ <% attributes.select(&:attachment?).each do |attribute| -%>
10
+ has_one_attached :<%= attribute.name %>
11
+ <% end -%>
12
+ <% attributes.select(&:attachments?).each do |attribute| -%>
13
+ has_many_attached :<%= attribute.name %>
14
+ <% end -%>
15
+ <% attributes.select(&:token?).each do |attribute| -%>
16
+ has_secure_token<% if attribute.name != "token" %> :<%= attribute.name %><% end %>
17
+ <% end -%>
18
+ <% if attributes.any?(&:password_digest?) -%>
19
+ has_secure_password
20
+ <% end -%>
21
+ end
22
+ <% end -%>
@@ -0,0 +1,7 @@
1
+ <% module_namespacing do -%>
2
+ module <%= class_path.map(&:camelize).join('::') %>
3
+ def self.table_name_prefix
4
+ '<%= namespaced? ? namespaced_class_path.join('_') : class_path.join('_') %>_'
5
+ end
6
+ end
7
+ <% end -%>
metadata ADDED
@@ -0,0 +1,418 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activerecord
3
+ version: !ruby/object:Gem::Version
4
+ version: 6.0.1
5
+ platform: ruby
6
+ authors:
7
+ - David Heinemeier Hansson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-11-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 6.0.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 6.0.1
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.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 6.0.1
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.
44
+ email: david@loudthinking.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files:
48
+ - README.rdoc
49
+ files:
50
+ - CHANGELOG.md
51
+ - MIT-LICENSE
52
+ - README.rdoc
53
+ - examples/performance.rb
54
+ - examples/simple.rb
55
+ - lib/active_record.rb
56
+ - lib/active_record/aggregations.rb
57
+ - lib/active_record/association_relation.rb
58
+ - lib/active_record/associations.rb
59
+ - lib/active_record/associations/alias_tracker.rb
60
+ - lib/active_record/associations/association.rb
61
+ - lib/active_record/associations/association_scope.rb
62
+ - lib/active_record/associations/belongs_to_association.rb
63
+ - lib/active_record/associations/belongs_to_polymorphic_association.rb
64
+ - lib/active_record/associations/builder/association.rb
65
+ - lib/active_record/associations/builder/belongs_to.rb
66
+ - lib/active_record/associations/builder/collection_association.rb
67
+ - lib/active_record/associations/builder/has_and_belongs_to_many.rb
68
+ - lib/active_record/associations/builder/has_many.rb
69
+ - lib/active_record/associations/builder/has_one.rb
70
+ - lib/active_record/associations/builder/singular_association.rb
71
+ - lib/active_record/associations/collection_association.rb
72
+ - lib/active_record/associations/collection_proxy.rb
73
+ - lib/active_record/associations/foreign_association.rb
74
+ - lib/active_record/associations/has_many_association.rb
75
+ - lib/active_record/associations/has_many_through_association.rb
76
+ - lib/active_record/associations/has_one_association.rb
77
+ - lib/active_record/associations/has_one_through_association.rb
78
+ - lib/active_record/associations/join_dependency.rb
79
+ - lib/active_record/associations/join_dependency/join_association.rb
80
+ - lib/active_record/associations/join_dependency/join_base.rb
81
+ - lib/active_record/associations/join_dependency/join_part.rb
82
+ - lib/active_record/associations/preloader.rb
83
+ - lib/active_record/associations/preloader/association.rb
84
+ - lib/active_record/associations/preloader/through_association.rb
85
+ - lib/active_record/associations/singular_association.rb
86
+ - lib/active_record/associations/through_association.rb
87
+ - lib/active_record/attribute_assignment.rb
88
+ - lib/active_record/attribute_decorators.rb
89
+ - lib/active_record/attribute_methods.rb
90
+ - lib/active_record/attribute_methods/before_type_cast.rb
91
+ - lib/active_record/attribute_methods/dirty.rb
92
+ - lib/active_record/attribute_methods/primary_key.rb
93
+ - lib/active_record/attribute_methods/query.rb
94
+ - lib/active_record/attribute_methods/read.rb
95
+ - lib/active_record/attribute_methods/serialization.rb
96
+ - lib/active_record/attribute_methods/time_zone_conversion.rb
97
+ - lib/active_record/attribute_methods/write.rb
98
+ - lib/active_record/attributes.rb
99
+ - lib/active_record/autosave_association.rb
100
+ - lib/active_record/base.rb
101
+ - lib/active_record/callbacks.rb
102
+ - lib/active_record/coders/json.rb
103
+ - lib/active_record/coders/yaml_column.rb
104
+ - lib/active_record/connection_adapters/abstract/connection_pool.rb
105
+ - lib/active_record/connection_adapters/abstract/database_limits.rb
106
+ - lib/active_record/connection_adapters/abstract/database_statements.rb
107
+ - lib/active_record/connection_adapters/abstract/query_cache.rb
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
111
+ - lib/active_record/connection_adapters/abstract/schema_definitions.rb
112
+ - lib/active_record/connection_adapters/abstract/schema_dumper.rb
113
+ - lib/active_record/connection_adapters/abstract/schema_statements.rb
114
+ - lib/active_record/connection_adapters/abstract/transaction.rb
115
+ - lib/active_record/connection_adapters/abstract_adapter.rb
116
+ - lib/active_record/connection_adapters/abstract_mysql_adapter.rb
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
129
+ - lib/active_record/connection_adapters/mysql2_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
164
+ - lib/active_record/connection_adapters/postgresql_adapter.rb
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
174
+ - lib/active_record/connection_adapters/sqlite3_adapter.rb
175
+ - lib/active_record/connection_adapters/statement_pool.rb
176
+ - lib/active_record/connection_handling.rb
177
+ - lib/active_record/core.rb
178
+ - lib/active_record/counter_cache.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
184
+ - lib/active_record/dynamic_matchers.rb
185
+ - lib/active_record/enum.rb
186
+ - lib/active_record/errors.rb
187
+ - lib/active_record/explain.rb
188
+ - lib/active_record/explain_registry.rb
189
+ - lib/active_record/explain_subscriber.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
195
+ - lib/active_record/fixtures.rb
196
+ - lib/active_record/gem_version.rb
197
+ - lib/active_record/inheritance.rb
198
+ - lib/active_record/insert_all.rb
199
+ - lib/active_record/integration.rb
200
+ - lib/active_record/internal_metadata.rb
201
+ - lib/active_record/legacy_yaml_adapter.rb
202
+ - lib/active_record/locale/en.yml
203
+ - lib/active_record/locking/optimistic.rb
204
+ - lib/active_record/locking/pessimistic.rb
205
+ - lib/active_record/log_subscriber.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
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
213
+ - lib/active_record/model_schema.rb
214
+ - lib/active_record/nested_attributes.rb
215
+ - lib/active_record/no_touching.rb
216
+ - lib/active_record/null_relation.rb
217
+ - lib/active_record/persistence.rb
218
+ - lib/active_record/query_cache.rb
219
+ - lib/active_record/querying.rb
220
+ - lib/active_record/railtie.rb
221
+ - lib/active_record/railties/collection_cache_association_loading.rb
222
+ - lib/active_record/railties/console_sandbox.rb
223
+ - lib/active_record/railties/controller_runtime.rb
224
+ - lib/active_record/railties/databases.rake
225
+ - lib/active_record/readonly_attributes.rb
226
+ - lib/active_record/reflection.rb
227
+ - lib/active_record/relation.rb
228
+ - lib/active_record/relation/batches.rb
229
+ - lib/active_record/relation/batches/batch_enumerator.rb
230
+ - lib/active_record/relation/calculations.rb
231
+ - lib/active_record/relation/delegation.rb
232
+ - lib/active_record/relation/finder_methods.rb
233
+ - lib/active_record/relation/from_clause.rb
234
+ - lib/active_record/relation/merger.rb
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
244
+ - lib/active_record/relation/query_methods.rb
245
+ - lib/active_record/relation/record_fetch_warning.rb
246
+ - lib/active_record/relation/spawn_methods.rb
247
+ - lib/active_record/relation/where_clause.rb
248
+ - lib/active_record/relation/where_clause_factory.rb
249
+ - lib/active_record/result.rb
250
+ - lib/active_record/runtime_registry.rb
251
+ - lib/active_record/sanitization.rb
252
+ - lib/active_record/schema.rb
253
+ - lib/active_record/schema_dumper.rb
254
+ - lib/active_record/schema_migration.rb
255
+ - lib/active_record/scoping.rb
256
+ - lib/active_record/scoping/default.rb
257
+ - lib/active_record/scoping/named.rb
258
+ - lib/active_record/secure_token.rb
259
+ - lib/active_record/serialization.rb
260
+ - lib/active_record/statement_cache.rb
261
+ - lib/active_record/store.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
270
+ - lib/active_record/timestamp.rb
271
+ - lib/active_record/touch_later.rb
272
+ - lib/active_record/transactions.rb
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
292
+ - lib/active_record/validations/associated.rb
293
+ - lib/active_record/validations/length.rb
294
+ - lib/active_record/validations/presence.rb
295
+ - lib/active_record/validations/uniqueness.rb
296
+ - lib/active_record/version.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
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
385
+ - lib/rails/generators/active_record/model/model_generator.rb
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
+ bug_tracker_uri: https://github.com/rails/rails/issues
393
+ changelog_uri: https://github.com/rails/rails/blob/v6.0.1/activerecord/CHANGELOG.md
394
+ documentation_uri: https://api.rubyonrails.org/v6.0.1/
395
+ mailing_list_uri: https://groups.google.com/forum/#!forum/rubyonrails-talk
396
+ source_code_uri: https://github.com/rails/rails/tree/v6.0.1/activerecord
397
+ post_install_message:
398
+ rdoc_options:
399
+ - "--main"
400
+ - README.rdoc
401
+ require_paths:
402
+ - lib
403
+ required_ruby_version: !ruby/object:Gem::Requirement
404
+ requirements:
405
+ - - ">="
406
+ - !ruby/object:Gem::Version
407
+ version: 2.5.0
408
+ required_rubygems_version: !ruby/object:Gem::Requirement
409
+ requirements:
410
+ - - ">="
411
+ - !ruby/object:Gem::Version
412
+ version: '0'
413
+ requirements: []
414
+ rubygems_version: 3.0.3
415
+ signing_key:
416
+ specification_version: 4
417
+ summary: Object-relational mapper framework (part of Rails).
418
+ test_files: []