activerecord 5.2.8.1 → 6.1.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (316) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1347 -624
  3. data/MIT-LICENSE +3 -1
  4. data/README.rdoc +7 -5
  5. data/examples/performance.rb +1 -1
  6. data/lib/active_record/aggregations.rb +9 -8
  7. data/lib/active_record/association_relation.rb +30 -10
  8. data/lib/active_record/associations/alias_tracker.rb +19 -16
  9. data/lib/active_record/associations/association.rb +100 -41
  10. data/lib/active_record/associations/association_scope.rb +23 -21
  11. data/lib/active_record/associations/belongs_to_association.rb +55 -48
  12. data/lib/active_record/associations/belongs_to_polymorphic_association.rb +7 -6
  13. data/lib/active_record/associations/builder/association.rb +45 -22
  14. data/lib/active_record/associations/builder/belongs_to.rb +29 -59
  15. data/lib/active_record/associations/builder/collection_association.rb +8 -17
  16. data/lib/active_record/associations/builder/has_and_belongs_to_many.rb +17 -41
  17. data/lib/active_record/associations/builder/has_many.rb +8 -2
  18. data/lib/active_record/associations/builder/has_one.rb +33 -2
  19. data/lib/active_record/associations/builder/singular_association.rb +3 -1
  20. data/lib/active_record/associations/collection_association.rb +44 -34
  21. data/lib/active_record/associations/collection_proxy.rb +25 -21
  22. data/lib/active_record/associations/foreign_association.rb +20 -0
  23. data/lib/active_record/associations/has_many_association.rb +26 -13
  24. data/lib/active_record/associations/has_many_through_association.rb +24 -18
  25. data/lib/active_record/associations/has_one_association.rb +43 -31
  26. data/lib/active_record/associations/has_one_through_association.rb +5 -5
  27. data/lib/active_record/associations/join_dependency/join_association.rb +44 -22
  28. data/lib/active_record/associations/join_dependency/join_part.rb +5 -5
  29. data/lib/active_record/associations/join_dependency.rb +91 -60
  30. data/lib/active_record/associations/preloader/association.rb +69 -43
  31. data/lib/active_record/associations/preloader/through_association.rb +49 -40
  32. data/lib/active_record/associations/preloader.rb +47 -34
  33. data/lib/active_record/associations/singular_association.rb +3 -17
  34. data/lib/active_record/associations/through_association.rb +1 -1
  35. data/lib/active_record/associations.rb +137 -25
  36. data/lib/active_record/attribute_assignment.rb +17 -19
  37. data/lib/active_record/attribute_methods/before_type_cast.rb +13 -7
  38. data/lib/active_record/attribute_methods/dirty.rb +101 -40
  39. data/lib/active_record/attribute_methods/primary_key.rb +20 -25
  40. data/lib/active_record/attribute_methods/query.rb +4 -8
  41. data/lib/active_record/attribute_methods/read.rb +14 -56
  42. data/lib/active_record/attribute_methods/serialization.rb +12 -7
  43. data/lib/active_record/attribute_methods/time_zone_conversion.rb +12 -15
  44. data/lib/active_record/attribute_methods/write.rb +18 -34
  45. data/lib/active_record/attribute_methods.rb +81 -143
  46. data/lib/active_record/attributes.rb +46 -9
  47. data/lib/active_record/autosave_association.rb +57 -42
  48. data/lib/active_record/base.rb +4 -17
  49. data/lib/active_record/callbacks.rb +158 -43
  50. data/lib/active_record/coders/yaml_column.rb +16 -7
  51. data/lib/active_record/connection_adapters/abstract/connection_pool.rb +272 -130
  52. data/lib/active_record/connection_adapters/abstract/database_limits.rb +7 -36
  53. data/lib/active_record/connection_adapters/abstract/database_statements.rb +167 -146
  54. data/lib/active_record/connection_adapters/abstract/query_cache.rb +18 -14
  55. data/lib/active_record/connection_adapters/abstract/quoting.rb +107 -47
  56. data/lib/active_record/connection_adapters/abstract/savepoints.rb +3 -3
  57. data/lib/active_record/connection_adapters/abstract/schema_creation.rb +153 -110
  58. data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +211 -90
  59. data/lib/active_record/connection_adapters/abstract/schema_dumper.rb +2 -4
  60. data/lib/active_record/connection_adapters/abstract/schema_statements.rb +385 -144
  61. data/lib/active_record/connection_adapters/abstract/transaction.rb +167 -69
  62. data/lib/active_record/connection_adapters/abstract_adapter.rb +229 -99
  63. data/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +243 -275
  64. data/lib/active_record/connection_adapters/column.rb +30 -12
  65. data/lib/active_record/connection_adapters/deduplicable.rb +29 -0
  66. data/lib/active_record/connection_adapters/legacy_pool_manager.rb +35 -0
  67. data/lib/active_record/connection_adapters/mysql/column.rb +1 -1
  68. data/lib/active_record/connection_adapters/mysql/database_statements.rb +88 -32
  69. data/lib/active_record/connection_adapters/mysql/explain_pretty_printer.rb +1 -2
  70. data/lib/active_record/connection_adapters/mysql/quoting.rb +59 -7
  71. data/lib/active_record/connection_adapters/mysql/schema_creation.rb +34 -10
  72. data/lib/active_record/connection_adapters/mysql/schema_definitions.rb +48 -32
  73. data/lib/active_record/connection_adapters/mysql/schema_dumper.rb +18 -7
  74. data/lib/active_record/connection_adapters/mysql/schema_statements.rb +142 -19
  75. data/lib/active_record/connection_adapters/mysql/type_metadata.rb +14 -9
  76. data/lib/active_record/connection_adapters/mysql2_adapter.rb +53 -18
  77. data/lib/active_record/connection_adapters/pool_config.rb +73 -0
  78. data/lib/active_record/connection_adapters/pool_manager.rb +47 -0
  79. data/lib/active_record/connection_adapters/postgresql/column.rb +37 -28
  80. data/lib/active_record/connection_adapters/postgresql/database_statements.rb +40 -54
  81. data/lib/active_record/connection_adapters/postgresql/oid/array.rb +1 -2
  82. data/lib/active_record/connection_adapters/postgresql/oid/bit.rb +1 -4
  83. data/lib/active_record/connection_adapters/postgresql/oid/cidr.rb +3 -5
  84. data/lib/active_record/connection_adapters/postgresql/oid/date.rb +2 -2
  85. data/lib/active_record/connection_adapters/postgresql/oid/date_time.rb +10 -2
  86. data/lib/active_record/connection_adapters/postgresql/oid/enum.rb +0 -1
  87. data/lib/active_record/connection_adapters/postgresql/oid/hstore.rb +1 -2
  88. data/lib/active_record/connection_adapters/postgresql/oid/interval.rb +49 -0
  89. data/lib/active_record/connection_adapters/postgresql/oid/legacy_point.rb +3 -4
  90. data/lib/active_record/connection_adapters/postgresql/oid/macaddr.rb +25 -0
  91. data/lib/active_record/connection_adapters/postgresql/oid/oid.rb +1 -1
  92. data/lib/active_record/connection_adapters/postgresql/oid/point.rb +3 -4
  93. data/lib/active_record/connection_adapters/postgresql/oid/range.rb +25 -7
  94. data/lib/active_record/connection_adapters/postgresql/oid/specialized_string.rb +1 -1
  95. data/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb +9 -7
  96. data/lib/active_record/connection_adapters/postgresql/oid/uuid.rb +15 -3
  97. data/lib/active_record/connection_adapters/postgresql/oid.rb +2 -0
  98. data/lib/active_record/connection_adapters/postgresql/quoting.rb +73 -10
  99. data/lib/active_record/connection_adapters/postgresql/referential_integrity.rb +2 -2
  100. data/lib/active_record/connection_adapters/postgresql/schema_creation.rb +19 -4
  101. data/lib/active_record/connection_adapters/postgresql/schema_definitions.rb +107 -91
  102. data/lib/active_record/connection_adapters/postgresql/schema_dumper.rb +0 -1
  103. data/lib/active_record/connection_adapters/postgresql/schema_statements.rb +120 -100
  104. data/lib/active_record/connection_adapters/postgresql/type_metadata.rb +31 -26
  105. data/lib/active_record/connection_adapters/postgresql/utils.rb +0 -1
  106. data/lib/active_record/connection_adapters/postgresql_adapter.rb +225 -121
  107. data/lib/active_record/connection_adapters/schema_cache.rb +159 -21
  108. data/lib/active_record/connection_adapters/sql_type_metadata.rb +17 -6
  109. data/lib/active_record/connection_adapters/sqlite3/database_statements.rb +146 -0
  110. data/lib/active_record/connection_adapters/sqlite3/quoting.rb +42 -7
  111. data/lib/active_record/connection_adapters/sqlite3/schema_creation.rb +5 -1
  112. data/lib/active_record/connection_adapters/sqlite3/schema_statements.rb +77 -13
  113. data/lib/active_record/connection_adapters/sqlite3_adapter.rb +174 -186
  114. data/lib/active_record/connection_adapters/statement_pool.rb +0 -1
  115. data/lib/active_record/connection_adapters.rb +52 -0
  116. data/lib/active_record/connection_handling.rb +293 -33
  117. data/lib/active_record/core.rb +341 -99
  118. data/lib/active_record/counter_cache.rb +8 -30
  119. data/lib/active_record/database_configurations/connection_url_resolver.rb +99 -0
  120. data/lib/active_record/database_configurations/database_config.rb +80 -0
  121. data/lib/active_record/database_configurations/hash_config.rb +96 -0
  122. data/lib/active_record/database_configurations/url_config.rb +53 -0
  123. data/lib/active_record/database_configurations.rb +273 -0
  124. data/lib/active_record/delegated_type.rb +209 -0
  125. data/lib/active_record/destroy_association_async_job.rb +36 -0
  126. data/lib/active_record/dynamic_matchers.rb +3 -4
  127. data/lib/active_record/enum.rb +108 -36
  128. data/lib/active_record/errors.rb +62 -19
  129. data/lib/active_record/explain.rb +10 -6
  130. data/lib/active_record/explain_subscriber.rb +1 -1
  131. data/lib/active_record/fixture_set/file.rb +10 -17
  132. data/lib/active_record/fixture_set/model_metadata.rb +32 -0
  133. data/lib/active_record/fixture_set/render_context.rb +17 -0
  134. data/lib/active_record/fixture_set/table_row.rb +152 -0
  135. data/lib/active_record/fixture_set/table_rows.rb +46 -0
  136. data/lib/active_record/fixtures.rb +200 -481
  137. data/lib/active_record/gem_version.rb +4 -4
  138. data/lib/active_record/inheritance.rb +53 -24
  139. data/lib/active_record/insert_all.rb +212 -0
  140. data/lib/active_record/integration.rb +67 -17
  141. data/lib/active_record/internal_metadata.rb +28 -9
  142. data/lib/active_record/legacy_yaml_adapter.rb +7 -3
  143. data/lib/active_record/locking/optimistic.rb +37 -23
  144. data/lib/active_record/locking/pessimistic.rb +9 -5
  145. data/lib/active_record/log_subscriber.rb +35 -35
  146. data/lib/active_record/middleware/database_selector/resolver/session.rb +48 -0
  147. data/lib/active_record/middleware/database_selector/resolver.rb +92 -0
  148. data/lib/active_record/middleware/database_selector.rb +77 -0
  149. data/lib/active_record/migration/command_recorder.rb +96 -44
  150. data/lib/active_record/migration/compatibility.rb +145 -64
  151. data/lib/active_record/migration/join_table.rb +0 -1
  152. data/lib/active_record/migration.rb +206 -157
  153. data/lib/active_record/model_schema.rb +148 -22
  154. data/lib/active_record/nested_attributes.rb +4 -7
  155. data/lib/active_record/no_touching.rb +8 -1
  156. data/lib/active_record/null_relation.rb +0 -1
  157. data/lib/active_record/persistence.rb +267 -59
  158. data/lib/active_record/query_cache.rb +21 -4
  159. data/lib/active_record/querying.rb +40 -23
  160. data/lib/active_record/railtie.rb +113 -74
  161. data/lib/active_record/railties/console_sandbox.rb +2 -4
  162. data/lib/active_record/railties/controller_runtime.rb +30 -35
  163. data/lib/active_record/railties/databases.rake +411 -80
  164. data/lib/active_record/readonly_attributes.rb +4 -0
  165. data/lib/active_record/reflection.rb +109 -93
  166. data/lib/active_record/relation/batches/batch_enumerator.rb +25 -9
  167. data/lib/active_record/relation/batches.rb +44 -35
  168. data/lib/active_record/relation/calculations.rb +157 -90
  169. data/lib/active_record/relation/delegation.rb +35 -50
  170. data/lib/active_record/relation/finder_methods.rb +64 -39
  171. data/lib/active_record/relation/from_clause.rb +5 -1
  172. data/lib/active_record/relation/merger.rb +32 -40
  173. data/lib/active_record/relation/predicate_builder/array_handler.rb +13 -13
  174. data/lib/active_record/relation/predicate_builder/association_query_value.rb +5 -9
  175. data/lib/active_record/relation/predicate_builder/basic_object_handler.rb +1 -2
  176. data/lib/active_record/relation/predicate_builder/polymorphic_array_value.rb +11 -10
  177. data/lib/active_record/relation/predicate_builder/range_handler.rb +3 -23
  178. data/lib/active_record/relation/predicate_builder/relation_handler.rb +1 -1
  179. data/lib/active_record/relation/predicate_builder.rb +62 -45
  180. data/lib/active_record/relation/query_attribute.rb +13 -8
  181. data/lib/active_record/relation/query_methods.rb +478 -187
  182. data/lib/active_record/relation/record_fetch_warning.rb +3 -3
  183. data/lib/active_record/relation/spawn_methods.rb +9 -9
  184. data/lib/active_record/relation/where_clause.rb +115 -62
  185. data/lib/active_record/relation.rb +379 -115
  186. data/lib/active_record/result.rb +64 -38
  187. data/lib/active_record/runtime_registry.rb +2 -2
  188. data/lib/active_record/sanitization.rb +22 -41
  189. data/lib/active_record/schema.rb +2 -11
  190. data/lib/active_record/schema_dumper.rb +54 -9
  191. data/lib/active_record/schema_migration.rb +7 -9
  192. data/lib/active_record/scoping/default.rb +4 -8
  193. data/lib/active_record/scoping/named.rb +17 -24
  194. data/lib/active_record/scoping.rb +8 -9
  195. data/lib/active_record/secure_token.rb +16 -8
  196. data/lib/active_record/serialization.rb +5 -3
  197. data/lib/active_record/signed_id.rb +116 -0
  198. data/lib/active_record/statement_cache.rb +49 -6
  199. data/lib/active_record/store.rb +94 -10
  200. data/lib/active_record/suppressor.rb +2 -2
  201. data/lib/active_record/table_metadata.rb +42 -43
  202. data/lib/active_record/tasks/database_tasks.rb +277 -81
  203. data/lib/active_record/tasks/mysql_database_tasks.rb +37 -39
  204. data/lib/active_record/tasks/postgresql_database_tasks.rb +27 -32
  205. data/lib/active_record/tasks/sqlite_database_tasks.rb +14 -17
  206. data/lib/active_record/test_databases.rb +24 -0
  207. data/lib/active_record/test_fixtures.rb +291 -0
  208. data/lib/active_record/timestamp.rb +43 -32
  209. data/lib/active_record/touch_later.rb +23 -22
  210. data/lib/active_record/transactions.rb +62 -118
  211. data/lib/active_record/translation.rb +1 -1
  212. data/lib/active_record/type/adapter_specific_registry.rb +3 -13
  213. data/lib/active_record/type/hash_lookup_type_map.rb +0 -1
  214. data/lib/active_record/type/serialized.rb +6 -3
  215. data/lib/active_record/type/time.rb +10 -0
  216. data/lib/active_record/type/type_map.rb +0 -1
  217. data/lib/active_record/type/unsigned_integer.rb +0 -1
  218. data/lib/active_record/type.rb +10 -5
  219. data/lib/active_record/type_caster/connection.rb +15 -15
  220. data/lib/active_record/type_caster/map.rb +8 -8
  221. data/lib/active_record/validations/associated.rb +1 -2
  222. data/lib/active_record/validations/numericality.rb +35 -0
  223. data/lib/active_record/validations/uniqueness.rb +38 -30
  224. data/lib/active_record/validations.rb +4 -3
  225. data/lib/active_record.rb +13 -12
  226. data/lib/arel/alias_predication.rb +9 -0
  227. data/lib/arel/attributes/attribute.rb +41 -0
  228. data/lib/arel/collectors/bind.rb +29 -0
  229. data/lib/arel/collectors/composite.rb +39 -0
  230. data/lib/arel/collectors/plain_string.rb +20 -0
  231. data/lib/arel/collectors/sql_string.rb +27 -0
  232. data/lib/arel/collectors/substitute_binds.rb +35 -0
  233. data/lib/arel/crud.rb +42 -0
  234. data/lib/arel/delete_manager.rb +18 -0
  235. data/lib/arel/errors.rb +9 -0
  236. data/lib/arel/expressions.rb +29 -0
  237. data/lib/arel/factory_methods.rb +49 -0
  238. data/lib/arel/insert_manager.rb +49 -0
  239. data/lib/arel/math.rb +45 -0
  240. data/lib/arel/nodes/and.rb +32 -0
  241. data/lib/arel/nodes/ascending.rb +23 -0
  242. data/lib/arel/nodes/binary.rb +126 -0
  243. data/lib/arel/nodes/bind_param.rb +44 -0
  244. data/lib/arel/nodes/case.rb +55 -0
  245. data/lib/arel/nodes/casted.rb +62 -0
  246. data/lib/arel/nodes/comment.rb +29 -0
  247. data/lib/arel/nodes/count.rb +12 -0
  248. data/lib/arel/nodes/delete_statement.rb +45 -0
  249. data/lib/arel/nodes/descending.rb +23 -0
  250. data/lib/arel/nodes/equality.rb +15 -0
  251. data/lib/arel/nodes/extract.rb +24 -0
  252. data/lib/arel/nodes/false.rb +16 -0
  253. data/lib/arel/nodes/full_outer_join.rb +8 -0
  254. data/lib/arel/nodes/function.rb +44 -0
  255. data/lib/arel/nodes/grouping.rb +11 -0
  256. data/lib/arel/nodes/homogeneous_in.rb +76 -0
  257. data/lib/arel/nodes/in.rb +15 -0
  258. data/lib/arel/nodes/infix_operation.rb +92 -0
  259. data/lib/arel/nodes/inner_join.rb +8 -0
  260. data/lib/arel/nodes/insert_statement.rb +37 -0
  261. data/lib/arel/nodes/join_source.rb +20 -0
  262. data/lib/arel/nodes/matches.rb +18 -0
  263. data/lib/arel/nodes/named_function.rb +23 -0
  264. data/lib/arel/nodes/node.rb +51 -0
  265. data/lib/arel/nodes/node_expression.rb +13 -0
  266. data/lib/arel/nodes/ordering.rb +27 -0
  267. data/lib/arel/nodes/outer_join.rb +8 -0
  268. data/lib/arel/nodes/over.rb +15 -0
  269. data/lib/arel/nodes/regexp.rb +16 -0
  270. data/lib/arel/nodes/right_outer_join.rb +8 -0
  271. data/lib/arel/nodes/select_core.rb +67 -0
  272. data/lib/arel/nodes/select_statement.rb +41 -0
  273. data/lib/arel/nodes/sql_literal.rb +19 -0
  274. data/lib/arel/nodes/string_join.rb +11 -0
  275. data/lib/arel/nodes/table_alias.rb +31 -0
  276. data/lib/arel/nodes/terminal.rb +16 -0
  277. data/lib/arel/nodes/true.rb +16 -0
  278. data/lib/arel/nodes/unary.rb +44 -0
  279. data/lib/arel/nodes/unary_operation.rb +20 -0
  280. data/lib/arel/nodes/unqualified_column.rb +22 -0
  281. data/lib/arel/nodes/update_statement.rb +41 -0
  282. data/lib/arel/nodes/values_list.rb +9 -0
  283. data/lib/arel/nodes/window.rb +126 -0
  284. data/lib/arel/nodes/with.rb +11 -0
  285. data/lib/arel/nodes.rb +70 -0
  286. data/lib/arel/order_predications.rb +13 -0
  287. data/lib/arel/predications.rb +250 -0
  288. data/lib/arel/select_manager.rb +270 -0
  289. data/lib/arel/table.rb +118 -0
  290. data/lib/arel/tree_manager.rb +72 -0
  291. data/lib/arel/update_manager.rb +34 -0
  292. data/lib/arel/visitors/dot.rb +308 -0
  293. data/lib/arel/visitors/mysql.rb +93 -0
  294. data/lib/arel/visitors/postgresql.rb +120 -0
  295. data/lib/arel/visitors/sqlite.rb +38 -0
  296. data/lib/arel/visitors/to_sql.rb +899 -0
  297. data/lib/arel/visitors/visitor.rb +45 -0
  298. data/lib/arel/visitors.rb +13 -0
  299. data/lib/arel/window_predications.rb +9 -0
  300. data/lib/arel.rb +54 -0
  301. data/lib/rails/generators/active_record/application_record/application_record_generator.rb +0 -1
  302. data/lib/rails/generators/active_record/migration/migration_generator.rb +3 -5
  303. data/lib/rails/generators/active_record/migration/templates/create_table_migration.rb.tt +3 -1
  304. data/lib/rails/generators/active_record/migration/templates/migration.rb.tt +7 -5
  305. data/lib/rails/generators/active_record/migration.rb +19 -2
  306. data/lib/rails/generators/active_record/model/model_generator.rb +39 -2
  307. data/lib/rails/generators/active_record/model/templates/abstract_base_class.rb.tt +7 -0
  308. data/lib/rails/generators/active_record/model/templates/model.rb.tt +10 -1
  309. metadata +118 -32
  310. data/lib/active_record/attribute_decorators.rb +0 -90
  311. data/lib/active_record/collection_cache_key.rb +0 -53
  312. data/lib/active_record/connection_adapters/connection_specification.rb +0 -287
  313. data/lib/active_record/connection_adapters/determine_if_preparable_visitor.rb +0 -33
  314. data/lib/active_record/define_callbacks.rb +0 -22
  315. data/lib/active_record/relation/predicate_builder/base_handler.rb +0 -19
  316. data/lib/active_record/relation/where_clause_factory.rb +0 -34
@@ -0,0 +1,45 @@
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
+ attr_reader :dispatch
16
+
17
+ def self.dispatch_cache
18
+ @dispatch_cache ||= Hash.new do |hash, klass|
19
+ hash[klass] = "visit_#{(klass.name || '').gsub('::', '_')}"
20
+ end
21
+ end
22
+
23
+ def get_dispatch_cache
24
+ self.class.dispatch_cache
25
+ end
26
+
27
+ def visit(object, collector = nil)
28
+ dispatch_method = dispatch[object.class]
29
+ if collector
30
+ send dispatch_method, object, collector
31
+ else
32
+ send dispatch_method, object
33
+ end
34
+ rescue NoMethodError => e
35
+ raise e if respond_to?(dispatch_method, true)
36
+ superklass = object.class.ancestors.find { |klass|
37
+ respond_to?(dispatch[klass], true)
38
+ }
39
+ raise(TypeError, "Cannot visit #{object.class}") unless superklass
40
+ dispatch[object.class] = dispatch[superklass]
41
+ retry
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "arel/visitors/visitor"
4
+ require "arel/visitors/to_sql"
5
+ require "arel/visitors/sqlite"
6
+ require "arel/visitors/postgresql"
7
+ require "arel/visitors/mysql"
8
+ require "arel/visitors/dot"
9
+
10
+ module Arel # :nodoc: all
11
+ module Visitors
12
+ end
13
+ 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
data/lib/arel.rb ADDED
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "arel/errors"
4
+
5
+ require "arel/crud"
6
+ require "arel/factory_methods"
7
+
8
+ require "arel/expressions"
9
+ require "arel/predications"
10
+ require "arel/window_predications"
11
+ require "arel/math"
12
+ require "arel/alias_predication"
13
+ require "arel/order_predications"
14
+ require "arel/table"
15
+ require "arel/attributes/attribute"
16
+
17
+ require "arel/visitors"
18
+ require "arel/collectors/sql_string"
19
+
20
+ require "arel/tree_manager"
21
+ require "arel/insert_manager"
22
+ require "arel/select_manager"
23
+ require "arel/update_manager"
24
+ require "arel/delete_manager"
25
+ require "arel/nodes"
26
+
27
+ module Arel
28
+ VERSION = "10.0.0"
29
+
30
+ # Wrap a known-safe SQL string for passing to query methods, e.g.
31
+ #
32
+ # Post.order(Arel.sql("length(title)")).last
33
+ #
34
+ # Great caution should be taken to avoid SQL injection vulnerabilities.
35
+ # This method should not be used with unsafe values such as request
36
+ # parameters or model attributes.
37
+ def self.sql(raw_sql)
38
+ Arel::Nodes::SqlLiteral.new raw_sql
39
+ end
40
+
41
+ def self.star # :nodoc:
42
+ sql "*"
43
+ end
44
+
45
+ def self.arel_node?(value) # :nodoc:
46
+ value.is_a?(Arel::Nodes::Node) || value.is_a?(Arel::Attribute) || value.is_a?(Arel::Nodes::SqlLiteral)
47
+ end
48
+
49
+ def self.fetch_attribute(value, &block) # :nodoc:
50
+ unless String === value
51
+ value.fetch_attribute(&block)
52
+ end
53
+ end
54
+ end
@@ -13,7 +13,6 @@ module ActiveRecord
13
13
  end
14
14
 
15
15
  private
16
-
17
16
  def application_record_file_name
18
17
  @application_record_file_name ||=
19
18
  if namespaced?
@@ -7,7 +7,9 @@ module ActiveRecord
7
7
  class MigrationGenerator < Base # :nodoc:
8
8
  argument :attributes, type: :array, default: [], banner: "field[:type][:index] field[:type][:index]"
9
9
 
10
+ class_option :timestamps, type: :boolean
10
11
  class_option :primary_key_type, type: :string, desc: "The type for primary key"
12
+ class_option :database, type: :string, aliases: %i(--db), desc: "The database for your migration. By default, the current environment's primary database is used."
11
13
 
12
14
  def create_migration_file
13
15
  set_local_assigns!
@@ -15,12 +17,8 @@ module ActiveRecord
15
17
  migration_template @migration_template, File.join(db_migrate_path, "#{file_name}.rb")
16
18
  end
17
19
 
18
- # TODO Change this to private once we've dropped Ruby 2.2 support.
19
- # Workaround for Ruby 2.2 "private attribute?" warning.
20
- protected
21
- attr_reader :migration_action, :join_tables
22
-
23
20
  private
21
+ attr_reader :migration_action, :join_tables
24
22
 
25
23
  # Sets the default migration template that is being used for the generation of the migration.
26
24
  # Depending on command line arguments, the migration template and the table name instance
@@ -6,7 +6,9 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi
6
6
  t.string :password_digest<%= attribute.inject_options %>
7
7
  <% elsif attribute.token? -%>
8
8
  t.string :<%= attribute.name %><%= attribute.inject_options %>
9
- <% else -%>
9
+ <% elsif attribute.reference? -%>
10
+ t.<%= attribute.type %> :<%= attribute.name %><%= attribute.inject_options %><%= foreign_key_type %>
11
+ <% elsif !attribute.virtual? -%>
10
12
  t.<%= attribute.type %> :<%= attribute.name %><%= attribute.inject_options %>
11
13
  <% end -%>
12
14
  <% end -%>
@@ -3,11 +3,11 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi
3
3
  def change
4
4
  <% attributes.each do |attribute| -%>
5
5
  <%- if attribute.reference? -%>
6
- add_reference :<%= table_name %>, :<%= attribute.name %><%= attribute.inject_options %>
6
+ add_reference :<%= table_name %>, :<%= attribute.name %><%= attribute.inject_options %><%= foreign_key_type %>
7
7
  <%- elsif attribute.token? -%>
8
8
  add_column :<%= table_name %>, :<%= attribute.name %>, :string<%= attribute.inject_options %>
9
9
  add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>, unique: true
10
- <%- else -%>
10
+ <%- elsif !attribute.virtual? -%>
11
11
  add_column :<%= table_name %>, :<%= attribute.name %>, :<%= attribute.type %><%= attribute.inject_options %>
12
12
  <%- if attribute.has_index? -%>
13
13
  add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
@@ -20,8 +20,8 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi
20
20
  create_join_table :<%= join_tables.first %>, :<%= join_tables.second %> do |t|
21
21
  <%- attributes.each do |attribute| -%>
22
22
  <%- if attribute.reference? -%>
23
- t.references :<%= attribute.name %><%= attribute.inject_options %>
24
- <%- else -%>
23
+ t.references :<%= attribute.name %><%= attribute.inject_options %><%= foreign_key_type %>
24
+ <%- elsif !attribute.virtual? -%>
25
25
  <%= '# ' unless attribute.has_index? -%>t.index <%= attribute.index_name %><%= attribute.inject_index_options %>
26
26
  <%- end -%>
27
27
  <%- end -%>
@@ -32,12 +32,14 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi
32
32
  <% attributes.each do |attribute| -%>
33
33
  <%- if migration_action -%>
34
34
  <%- if attribute.reference? -%>
35
- remove_reference :<%= table_name %>, :<%= attribute.name %><%= attribute.inject_options %>
35
+ remove_reference :<%= table_name %>, :<%= attribute.name %><%= attribute.inject_options %><%= foreign_key_type %>
36
36
  <%- else -%>
37
37
  <%- if attribute.has_index? -%>
38
38
  remove_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
39
39
  <%- end -%>
40
+ <%- if !attribute.virtual? -%>
40
41
  remove_column :<%= table_name %>, :<%= attribute.name %>, :<%= attribute.type %><%= attribute.inject_options %>
42
+ <%- end -%>
41
43
  <%- end -%>
42
44
  <%- end -%>
43
45
  <%- end -%>
@@ -17,19 +17,36 @@ module ActiveRecord
17
17
  end
18
18
 
19
19
  private
20
-
21
20
  def primary_key_type
22
21
  key_type = options[:primary_key_type]
23
22
  ", id: :#{key_type}" if key_type
24
23
  end
25
24
 
25
+ def foreign_key_type
26
+ key_type = options[:primary_key_type]
27
+ ", type: :#{key_type}" if key_type
28
+ end
29
+
26
30
  def db_migrate_path
27
31
  if defined?(Rails.application) && Rails.application
28
- Rails.application.config.paths["db/migrate"].to_ary.first
32
+ configured_migrate_path || default_migrate_path
29
33
  else
30
34
  "db/migrate"
31
35
  end
32
36
  end
37
+
38
+ def default_migrate_path
39
+ Rails.application.config.paths["db/migrate"].to_ary.first
40
+ end
41
+
42
+ def configured_migrate_path
43
+ return unless database = options[:database]
44
+ config = ActiveRecord::Base.configurations.configs_for(
45
+ env_name: Rails.env,
46
+ name: database
47
+ )
48
+ config&.migrations_paths
49
+ end
33
50
  end
34
51
  end
35
52
  end
@@ -14,15 +14,17 @@ module ActiveRecord
14
14
  class_option :parent, type: :string, desc: "The parent class for the generated model"
15
15
  class_option :indexes, type: :boolean, default: true, desc: "Add indexes for references and belongs_to columns"
16
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."
17
18
 
18
19
  # creates the migration file for the model.
19
20
  def create_migration_file
20
- return unless options[:migration] && options[:parent].nil?
21
+ return if skip_migration_creation?
21
22
  attributes.each { |a| a.attr_options.delete(:index) if a.reference? && !a.has_index? } if options[:indexes] == false
22
23
  migration_template "../../migration/templates/create_table_migration.rb", File.join(db_migrate_path, "create_#{table_name}.rb")
23
24
  end
24
25
 
25
26
  def create_model_file
27
+ generate_abstract_class if database && !parent
26
28
  template "model.rb", File.join("app/models", class_path, "#{file_name}.rb")
27
29
  end
28
30
 
@@ -34,6 +36,12 @@ module ActiveRecord
34
36
  hook_for :test_framework
35
37
 
36
38
  private
39
+ # Skip creating migration file if:
40
+ # - options parent is present and database option is not present
41
+ # - migrations option is nil or false
42
+ def skip_migration_creation?
43
+ parent && !database || !migration
44
+ end
37
45
 
38
46
  def attributes_with_index
39
47
  attributes.select { |a| !a.reference? && a.has_index? }
@@ -41,7 +49,36 @@ module ActiveRecord
41
49
 
42
50
  # Used by the migration template to determine the parent name of the model
43
51
  def parent_class_name
44
- options[:parent] || "ApplicationRecord"
52
+ if parent
53
+ parent
54
+ elsif database
55
+ abstract_class_name
56
+ else
57
+ "ApplicationRecord"
58
+ end
59
+ end
60
+
61
+ def generate_abstract_class
62
+ path = File.join("app/models", "#{database.underscore}_record.rb")
63
+ return if File.exist?(path)
64
+
65
+ template "abstract_base_class.rb", path
66
+ end
67
+
68
+ def abstract_class_name
69
+ "#{database.camelize}Record"
70
+ end
71
+
72
+ def database
73
+ options[:database]
74
+ end
75
+
76
+ def parent
77
+ options[:parent]
78
+ end
79
+
80
+ def migration
81
+ options[:migration]
45
82
  end
46
83
  end
47
84
  end
@@ -0,0 +1,7 @@
1
+ <% module_namespacing do -%>
2
+ class <%= abstract_class_name %> < ApplicationRecord
3
+ self.abstract_class = true
4
+
5
+ connects_to database: { <%= ActiveRecord::Base.writing_role %>: :<%= database -%> }
6
+ end
7
+ <% end -%>
@@ -1,7 +1,16 @@
1
1
  <% module_namespacing do -%>
2
2
  class <%= class_name %> < <%= parent_class_name.classify %>
3
3
  <% attributes.select(&:reference?).each do |attribute| -%>
4
- belongs_to :<%= attribute.name %><%= ', polymorphic: true' if attribute.polymorphic? %><%= ', required: true' if attribute.required? %>
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 %>
5
14
  <% end -%>
6
15
  <% attributes.select(&:token?).each do |attribute| -%>
7
16
  has_secure_token<% if attribute.name != "token" %> :<%= attribute.name %><% end %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.8.1
4
+ version: 6.1.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-12 00:00:00.000000000 Z
11
+ date: 2023-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,42 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 5.2.8.1
19
+ version: 6.1.7.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 5.2.8.1
26
+ version: 6.1.7.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activemodel
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 5.2.8.1
33
+ version: 6.1.7.3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 5.2.8.1
41
- - !ruby/object:Gem::Dependency
42
- name: arel
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '9.0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '9.0'
40
+ version: 6.1.7.3
55
41
  description: Databases on Rails. Build a persistent domain model by mapping database
56
42
  tables to Ruby classes. Strong conventions for associations, validations, aggregations,
57
43
  migrations, and testing come baked-in.
@@ -99,7 +85,6 @@ files:
99
85
  - lib/active_record/associations/singular_association.rb
100
86
  - lib/active_record/associations/through_association.rb
101
87
  - lib/active_record/attribute_assignment.rb
102
- - lib/active_record/attribute_decorators.rb
103
88
  - lib/active_record/attribute_methods.rb
104
89
  - lib/active_record/attribute_methods/before_type_cast.rb
105
90
  - lib/active_record/attribute_methods/dirty.rb
@@ -115,7 +100,7 @@ files:
115
100
  - lib/active_record/callbacks.rb
116
101
  - lib/active_record/coders/json.rb
117
102
  - lib/active_record/coders/yaml_column.rb
118
- - lib/active_record/collection_cache_key.rb
103
+ - lib/active_record/connection_adapters.rb
119
104
  - lib/active_record/connection_adapters/abstract/connection_pool.rb
120
105
  - lib/active_record/connection_adapters/abstract/database_limits.rb
121
106
  - lib/active_record/connection_adapters/abstract/database_statements.rb
@@ -130,8 +115,8 @@ files:
130
115
  - lib/active_record/connection_adapters/abstract_adapter.rb
131
116
  - lib/active_record/connection_adapters/abstract_mysql_adapter.rb
132
117
  - lib/active_record/connection_adapters/column.rb
133
- - lib/active_record/connection_adapters/connection_specification.rb
134
- - lib/active_record/connection_adapters/determine_if_preparable_visitor.rb
118
+ - lib/active_record/connection_adapters/deduplicable.rb
119
+ - lib/active_record/connection_adapters/legacy_pool_manager.rb
135
120
  - lib/active_record/connection_adapters/mysql/column.rb
136
121
  - lib/active_record/connection_adapters/mysql/database_statements.rb
137
122
  - lib/active_record/connection_adapters/mysql/explain_pretty_printer.rb
@@ -142,6 +127,8 @@ files:
142
127
  - lib/active_record/connection_adapters/mysql/schema_statements.rb
143
128
  - lib/active_record/connection_adapters/mysql/type_metadata.rb
144
129
  - lib/active_record/connection_adapters/mysql2_adapter.rb
130
+ - lib/active_record/connection_adapters/pool_config.rb
131
+ - lib/active_record/connection_adapters/pool_manager.rb
145
132
  - lib/active_record/connection_adapters/postgresql/column.rb
146
133
  - lib/active_record/connection_adapters/postgresql/database_statements.rb
147
134
  - lib/active_record/connection_adapters/postgresql/explain_pretty_printer.rb
@@ -157,8 +144,10 @@ files:
157
144
  - lib/active_record/connection_adapters/postgresql/oid/enum.rb
158
145
  - lib/active_record/connection_adapters/postgresql/oid/hstore.rb
159
146
  - lib/active_record/connection_adapters/postgresql/oid/inet.rb
147
+ - lib/active_record/connection_adapters/postgresql/oid/interval.rb
160
148
  - lib/active_record/connection_adapters/postgresql/oid/jsonb.rb
161
149
  - lib/active_record/connection_adapters/postgresql/oid/legacy_point.rb
150
+ - lib/active_record/connection_adapters/postgresql/oid/macaddr.rb
162
151
  - lib/active_record/connection_adapters/postgresql/oid/money.rb
163
152
  - lib/active_record/connection_adapters/postgresql/oid/oid.rb
164
153
  - lib/active_record/connection_adapters/postgresql/oid/point.rb
@@ -179,6 +168,7 @@ files:
179
168
  - lib/active_record/connection_adapters/postgresql_adapter.rb
180
169
  - lib/active_record/connection_adapters/schema_cache.rb
181
170
  - lib/active_record/connection_adapters/sql_type_metadata.rb
171
+ - lib/active_record/connection_adapters/sqlite3/database_statements.rb
182
172
  - lib/active_record/connection_adapters/sqlite3/explain_pretty_printer.rb
183
173
  - lib/active_record/connection_adapters/sqlite3/quoting.rb
184
174
  - lib/active_record/connection_adapters/sqlite3/schema_creation.rb
@@ -190,7 +180,13 @@ files:
190
180
  - lib/active_record/connection_handling.rb
191
181
  - lib/active_record/core.rb
192
182
  - lib/active_record/counter_cache.rb
193
- - lib/active_record/define_callbacks.rb
183
+ - lib/active_record/database_configurations.rb
184
+ - lib/active_record/database_configurations/connection_url_resolver.rb
185
+ - lib/active_record/database_configurations/database_config.rb
186
+ - lib/active_record/database_configurations/hash_config.rb
187
+ - lib/active_record/database_configurations/url_config.rb
188
+ - lib/active_record/delegated_type.rb
189
+ - lib/active_record/destroy_association_async_job.rb
194
190
  - lib/active_record/dynamic_matchers.rb
195
191
  - lib/active_record/enum.rb
196
192
  - lib/active_record/errors.rb
@@ -198,9 +194,14 @@ files:
198
194
  - lib/active_record/explain_registry.rb
199
195
  - lib/active_record/explain_subscriber.rb
200
196
  - lib/active_record/fixture_set/file.rb
197
+ - lib/active_record/fixture_set/model_metadata.rb
198
+ - lib/active_record/fixture_set/render_context.rb
199
+ - lib/active_record/fixture_set/table_row.rb
200
+ - lib/active_record/fixture_set/table_rows.rb
201
201
  - lib/active_record/fixtures.rb
202
202
  - lib/active_record/gem_version.rb
203
203
  - lib/active_record/inheritance.rb
204
+ - lib/active_record/insert_all.rb
204
205
  - lib/active_record/integration.rb
205
206
  - lib/active_record/internal_metadata.rb
206
207
  - lib/active_record/legacy_yaml_adapter.rb
@@ -208,6 +209,9 @@ files:
208
209
  - lib/active_record/locking/optimistic.rb
209
210
  - lib/active_record/locking/pessimistic.rb
210
211
  - lib/active_record/log_subscriber.rb
212
+ - lib/active_record/middleware/database_selector.rb
213
+ - lib/active_record/middleware/database_selector/resolver.rb
214
+ - lib/active_record/middleware/database_selector/resolver/session.rb
211
215
  - lib/active_record/migration.rb
212
216
  - lib/active_record/migration/command_recorder.rb
213
217
  - lib/active_record/migration/compatibility.rb
@@ -236,7 +240,6 @@ files:
236
240
  - lib/active_record/relation/predicate_builder.rb
237
241
  - lib/active_record/relation/predicate_builder/array_handler.rb
238
242
  - lib/active_record/relation/predicate_builder/association_query_value.rb
239
- - lib/active_record/relation/predicate_builder/base_handler.rb
240
243
  - lib/active_record/relation/predicate_builder/basic_object_handler.rb
241
244
  - lib/active_record/relation/predicate_builder/polymorphic_array_value.rb
242
245
  - lib/active_record/relation/predicate_builder/range_handler.rb
@@ -246,7 +249,6 @@ files:
246
249
  - lib/active_record/relation/record_fetch_warning.rb
247
250
  - lib/active_record/relation/spawn_methods.rb
248
251
  - lib/active_record/relation/where_clause.rb
249
- - lib/active_record/relation/where_clause_factory.rb
250
252
  - lib/active_record/result.rb
251
253
  - lib/active_record/runtime_registry.rb
252
254
  - lib/active_record/sanitization.rb
@@ -258,6 +260,7 @@ files:
258
260
  - lib/active_record/scoping/named.rb
259
261
  - lib/active_record/secure_token.rb
260
262
  - lib/active_record/serialization.rb
263
+ - lib/active_record/signed_id.rb
261
264
  - lib/active_record/statement_cache.rb
262
265
  - lib/active_record/store.rb
263
266
  - lib/active_record/suppressor.rb
@@ -266,6 +269,8 @@ files:
266
269
  - lib/active_record/tasks/mysql_database_tasks.rb
267
270
  - lib/active_record/tasks/postgresql_database_tasks.rb
268
271
  - lib/active_record/tasks/sqlite_database_tasks.rb
272
+ - lib/active_record/test_databases.rb
273
+ - lib/active_record/test_fixtures.rb
269
274
  - lib/active_record/timestamp.rb
270
275
  - lib/active_record/touch_later.rb
271
276
  - lib/active_record/transactions.rb
@@ -290,9 +295,85 @@ files:
290
295
  - lib/active_record/validations/absence.rb
291
296
  - lib/active_record/validations/associated.rb
292
297
  - lib/active_record/validations/length.rb
298
+ - lib/active_record/validations/numericality.rb
293
299
  - lib/active_record/validations/presence.rb
294
300
  - lib/active_record/validations/uniqueness.rb
295
301
  - lib/active_record/version.rb
302
+ - lib/arel.rb
303
+ - lib/arel/alias_predication.rb
304
+ - lib/arel/attributes/attribute.rb
305
+ - lib/arel/collectors/bind.rb
306
+ - lib/arel/collectors/composite.rb
307
+ - lib/arel/collectors/plain_string.rb
308
+ - lib/arel/collectors/sql_string.rb
309
+ - lib/arel/collectors/substitute_binds.rb
310
+ - lib/arel/crud.rb
311
+ - lib/arel/delete_manager.rb
312
+ - lib/arel/errors.rb
313
+ - lib/arel/expressions.rb
314
+ - lib/arel/factory_methods.rb
315
+ - lib/arel/insert_manager.rb
316
+ - lib/arel/math.rb
317
+ - lib/arel/nodes.rb
318
+ - lib/arel/nodes/and.rb
319
+ - lib/arel/nodes/ascending.rb
320
+ - lib/arel/nodes/binary.rb
321
+ - lib/arel/nodes/bind_param.rb
322
+ - lib/arel/nodes/case.rb
323
+ - lib/arel/nodes/casted.rb
324
+ - lib/arel/nodes/comment.rb
325
+ - lib/arel/nodes/count.rb
326
+ - lib/arel/nodes/delete_statement.rb
327
+ - lib/arel/nodes/descending.rb
328
+ - lib/arel/nodes/equality.rb
329
+ - lib/arel/nodes/extract.rb
330
+ - lib/arel/nodes/false.rb
331
+ - lib/arel/nodes/full_outer_join.rb
332
+ - lib/arel/nodes/function.rb
333
+ - lib/arel/nodes/grouping.rb
334
+ - lib/arel/nodes/homogeneous_in.rb
335
+ - lib/arel/nodes/in.rb
336
+ - lib/arel/nodes/infix_operation.rb
337
+ - lib/arel/nodes/inner_join.rb
338
+ - lib/arel/nodes/insert_statement.rb
339
+ - lib/arel/nodes/join_source.rb
340
+ - lib/arel/nodes/matches.rb
341
+ - lib/arel/nodes/named_function.rb
342
+ - lib/arel/nodes/node.rb
343
+ - lib/arel/nodes/node_expression.rb
344
+ - lib/arel/nodes/ordering.rb
345
+ - lib/arel/nodes/outer_join.rb
346
+ - lib/arel/nodes/over.rb
347
+ - lib/arel/nodes/regexp.rb
348
+ - lib/arel/nodes/right_outer_join.rb
349
+ - lib/arel/nodes/select_core.rb
350
+ - lib/arel/nodes/select_statement.rb
351
+ - lib/arel/nodes/sql_literal.rb
352
+ - lib/arel/nodes/string_join.rb
353
+ - lib/arel/nodes/table_alias.rb
354
+ - lib/arel/nodes/terminal.rb
355
+ - lib/arel/nodes/true.rb
356
+ - lib/arel/nodes/unary.rb
357
+ - lib/arel/nodes/unary_operation.rb
358
+ - lib/arel/nodes/unqualified_column.rb
359
+ - lib/arel/nodes/update_statement.rb
360
+ - lib/arel/nodes/values_list.rb
361
+ - lib/arel/nodes/window.rb
362
+ - lib/arel/nodes/with.rb
363
+ - lib/arel/order_predications.rb
364
+ - lib/arel/predications.rb
365
+ - lib/arel/select_manager.rb
366
+ - lib/arel/table.rb
367
+ - lib/arel/tree_manager.rb
368
+ - lib/arel/update_manager.rb
369
+ - lib/arel/visitors.rb
370
+ - lib/arel/visitors/dot.rb
371
+ - lib/arel/visitors/mysql.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/window_predications.rb
296
377
  - lib/rails/generators/active_record.rb
297
378
  - lib/rails/generators/active_record/application_record/application_record_generator.rb
298
379
  - lib/rails/generators/active_record/application_record/templates/application_record.rb.tt
@@ -301,14 +382,19 @@ files:
301
382
  - lib/rails/generators/active_record/migration/templates/create_table_migration.rb.tt
302
383
  - lib/rails/generators/active_record/migration/templates/migration.rb.tt
303
384
  - lib/rails/generators/active_record/model/model_generator.rb
385
+ - lib/rails/generators/active_record/model/templates/abstract_base_class.rb.tt
304
386
  - lib/rails/generators/active_record/model/templates/model.rb.tt
305
387
  - lib/rails/generators/active_record/model/templates/module.rb.tt
306
- homepage: http://rubyonrails.org
388
+ homepage: https://rubyonrails.org
307
389
  licenses:
308
390
  - MIT
309
391
  metadata:
310
- source_code_uri: https://github.com/rails/rails/tree/v5.2.8.1/activerecord
311
- changelog_uri: https://github.com/rails/rails/blob/v5.2.8.1/activerecord/CHANGELOG.md
392
+ bug_tracker_uri: https://github.com/rails/rails/issues
393
+ changelog_uri: https://github.com/rails/rails/blob/v6.1.7.3/activerecord/CHANGELOG.md
394
+ documentation_uri: https://api.rubyonrails.org/v6.1.7.3/
395
+ mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
396
+ source_code_uri: https://github.com/rails/rails/tree/v6.1.7.3/activerecord
397
+ rubygems_mfa_required: 'true'
312
398
  post_install_message:
313
399
  rdoc_options:
314
400
  - "--main"
@@ -319,14 +405,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
319
405
  requirements:
320
406
  - - ">="
321
407
  - !ruby/object:Gem::Version
322
- version: 2.2.2
408
+ version: 2.5.0
323
409
  required_rubygems_version: !ruby/object:Gem::Requirement
324
410
  requirements:
325
411
  - - ">="
326
412
  - !ruby/object:Gem::Version
327
413
  version: '0'
328
414
  requirements: []
329
- rubygems_version: 3.3.3
415
+ rubygems_version: 3.4.3
330
416
  signing_key:
331
417
  specification_version: 4
332
418
  summary: Object-relational mapper framework (part of Rails).