activerecord 6.1.4 → 7.0.0.rc1

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 (234) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1049 -977
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +1 -1
  5. data/lib/active_record/aggregations.rb +1 -1
  6. data/lib/active_record/association_relation.rb +0 -10
  7. data/lib/active_record/associations/association.rb +33 -17
  8. data/lib/active_record/associations/association_scope.rb +1 -3
  9. data/lib/active_record/associations/belongs_to_association.rb +15 -4
  10. data/lib/active_record/associations/belongs_to_polymorphic_association.rb +10 -2
  11. data/lib/active_record/associations/builder/association.rb +8 -2
  12. data/lib/active_record/associations/builder/belongs_to.rb +19 -6
  13. data/lib/active_record/associations/builder/collection_association.rb +10 -3
  14. data/lib/active_record/associations/builder/has_many.rb +3 -2
  15. data/lib/active_record/associations/builder/has_one.rb +2 -1
  16. data/lib/active_record/associations/builder/singular_association.rb +2 -2
  17. data/lib/active_record/associations/collection_association.rb +34 -27
  18. data/lib/active_record/associations/collection_proxy.rb +8 -3
  19. data/lib/active_record/associations/disable_joins_association_scope.rb +59 -0
  20. data/lib/active_record/associations/has_many_association.rb +1 -1
  21. data/lib/active_record/associations/has_many_through_association.rb +2 -1
  22. data/lib/active_record/associations/has_one_association.rb +10 -7
  23. data/lib/active_record/associations/has_one_through_association.rb +1 -1
  24. data/lib/active_record/associations/preloader/association.rb +187 -55
  25. data/lib/active_record/associations/preloader/batch.rb +48 -0
  26. data/lib/active_record/associations/preloader/branch.rb +147 -0
  27. data/lib/active_record/associations/preloader/through_association.rb +49 -13
  28. data/lib/active_record/associations/preloader.rb +39 -113
  29. data/lib/active_record/associations/singular_association.rb +8 -2
  30. data/lib/active_record/associations/through_association.rb +3 -3
  31. data/lib/active_record/associations.rb +90 -82
  32. data/lib/active_record/asynchronous_queries_tracker.rb +60 -0
  33. data/lib/active_record/attribute_assignment.rb +1 -1
  34. data/lib/active_record/attribute_methods/before_type_cast.rb +7 -2
  35. data/lib/active_record/attribute_methods/dirty.rb +49 -16
  36. data/lib/active_record/attribute_methods/primary_key.rb +2 -2
  37. data/lib/active_record/attribute_methods/query.rb +2 -2
  38. data/lib/active_record/attribute_methods/read.rb +7 -5
  39. data/lib/active_record/attribute_methods/serialization.rb +66 -12
  40. data/lib/active_record/attribute_methods/time_zone_conversion.rb +4 -3
  41. data/lib/active_record/attribute_methods/write.rb +7 -10
  42. data/lib/active_record/attribute_methods.rb +13 -14
  43. data/lib/active_record/attributes.rb +24 -35
  44. data/lib/active_record/autosave_association.rb +6 -21
  45. data/lib/active_record/base.rb +19 -1
  46. data/lib/active_record/callbacks.rb +2 -2
  47. data/lib/active_record/connection_adapters/abstract/connection_handler.rb +292 -0
  48. data/lib/active_record/connection_adapters/abstract/connection_pool/queue.rb +209 -0
  49. data/lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb +76 -0
  50. data/lib/active_record/connection_adapters/abstract/connection_pool.rb +47 -561
  51. data/lib/active_record/connection_adapters/abstract/database_limits.rb +0 -17
  52. data/lib/active_record/connection_adapters/abstract/database_statements.rb +46 -22
  53. data/lib/active_record/connection_adapters/abstract/query_cache.rb +24 -12
  54. data/lib/active_record/connection_adapters/abstract/quoting.rb +42 -72
  55. data/lib/active_record/connection_adapters/abstract/schema_creation.rb +4 -17
  56. data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +34 -9
  57. data/lib/active_record/connection_adapters/abstract/schema_statements.rb +69 -18
  58. data/lib/active_record/connection_adapters/abstract/transaction.rb +15 -22
  59. data/lib/active_record/connection_adapters/abstract_adapter.rb +149 -74
  60. data/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +97 -81
  61. data/lib/active_record/connection_adapters/column.rb +4 -0
  62. data/lib/active_record/connection_adapters/mysql/database_statements.rb +35 -23
  63. data/lib/active_record/connection_adapters/mysql/quoting.rb +35 -21
  64. data/lib/active_record/connection_adapters/mysql/schema_statements.rb +4 -1
  65. data/lib/active_record/connection_adapters/mysql2_adapter.rb +12 -6
  66. data/lib/active_record/connection_adapters/pool_config.rb +7 -7
  67. data/lib/active_record/connection_adapters/postgresql/column.rb +17 -1
  68. data/lib/active_record/connection_adapters/postgresql/database_statements.rb +19 -12
  69. data/lib/active_record/connection_adapters/postgresql/oid/date.rb +8 -0
  70. data/lib/active_record/connection_adapters/postgresql/oid/date_time.rb +5 -0
  71. data/lib/active_record/connection_adapters/postgresql/oid/hstore.rb +53 -14
  72. data/lib/active_record/connection_adapters/postgresql/oid/range.rb +1 -1
  73. data/lib/active_record/connection_adapters/postgresql/oid/timestamp.rb +15 -0
  74. data/lib/active_record/connection_adapters/postgresql/oid/timestamp_with_time_zone.rb +28 -0
  75. data/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb +18 -6
  76. data/lib/active_record/connection_adapters/postgresql/oid.rb +2 -0
  77. data/lib/active_record/connection_adapters/postgresql/quoting.rb +50 -50
  78. data/lib/active_record/connection_adapters/postgresql/referential_integrity.rb +32 -0
  79. data/lib/active_record/connection_adapters/postgresql/schema_creation.rb +21 -1
  80. data/lib/active_record/connection_adapters/postgresql/schema_definitions.rb +22 -1
  81. data/lib/active_record/connection_adapters/postgresql/schema_dumper.rb +25 -0
  82. data/lib/active_record/connection_adapters/postgresql/schema_statements.rb +27 -16
  83. data/lib/active_record/connection_adapters/postgresql_adapter.rb +205 -105
  84. data/lib/active_record/connection_adapters/schema_cache.rb +29 -4
  85. data/lib/active_record/connection_adapters/sqlite3/database_statements.rb +25 -19
  86. data/lib/active_record/connection_adapters/sqlite3/quoting.rb +15 -16
  87. data/lib/active_record/connection_adapters/sqlite3/schema_statements.rb +4 -2
  88. data/lib/active_record/connection_adapters/sqlite3_adapter.rb +61 -30
  89. data/lib/active_record/connection_adapters.rb +6 -5
  90. data/lib/active_record/connection_handling.rb +47 -53
  91. data/lib/active_record/core.rb +122 -132
  92. data/lib/active_record/database_configurations/connection_url_resolver.rb +2 -1
  93. data/lib/active_record/database_configurations/database_config.rb +12 -9
  94. data/lib/active_record/database_configurations/hash_config.rb +63 -5
  95. data/lib/active_record/database_configurations/url_config.rb +2 -2
  96. data/lib/active_record/database_configurations.rb +16 -32
  97. data/lib/active_record/delegated_type.rb +52 -11
  98. data/lib/active_record/destroy_association_async_job.rb +1 -1
  99. data/lib/active_record/disable_joins_association_relation.rb +39 -0
  100. data/lib/active_record/dynamic_matchers.rb +1 -1
  101. data/lib/active_record/encryption/cipher/aes256_gcm.rb +98 -0
  102. data/lib/active_record/encryption/cipher.rb +53 -0
  103. data/lib/active_record/encryption/config.rb +44 -0
  104. data/lib/active_record/encryption/configurable.rb +61 -0
  105. data/lib/active_record/encryption/context.rb +35 -0
  106. data/lib/active_record/encryption/contexts.rb +72 -0
  107. data/lib/active_record/encryption/derived_secret_key_provider.rb +12 -0
  108. data/lib/active_record/encryption/deterministic_key_provider.rb +14 -0
  109. data/lib/active_record/encryption/encryptable_record.rb +208 -0
  110. data/lib/active_record/encryption/encrypted_attribute_type.rb +140 -0
  111. data/lib/active_record/encryption/encrypted_fixtures.rb +38 -0
  112. data/lib/active_record/encryption/encrypting_only_encryptor.rb +12 -0
  113. data/lib/active_record/encryption/encryptor.rb +155 -0
  114. data/lib/active_record/encryption/envelope_encryption_key_provider.rb +55 -0
  115. data/lib/active_record/encryption/errors.rb +15 -0
  116. data/lib/active_record/encryption/extended_deterministic_queries.rb +160 -0
  117. data/lib/active_record/encryption/extended_deterministic_uniqueness_validator.rb +28 -0
  118. data/lib/active_record/encryption/key.rb +28 -0
  119. data/lib/active_record/encryption/key_generator.rb +42 -0
  120. data/lib/active_record/encryption/key_provider.rb +46 -0
  121. data/lib/active_record/encryption/message.rb +33 -0
  122. data/lib/active_record/encryption/message_serializer.rb +90 -0
  123. data/lib/active_record/encryption/null_encryptor.rb +21 -0
  124. data/lib/active_record/encryption/properties.rb +76 -0
  125. data/lib/active_record/encryption/read_only_null_encryptor.rb +24 -0
  126. data/lib/active_record/encryption/scheme.rb +99 -0
  127. data/lib/active_record/encryption.rb +55 -0
  128. data/lib/active_record/enum.rb +49 -42
  129. data/lib/active_record/errors.rb +67 -4
  130. data/lib/active_record/explain_registry.rb +11 -6
  131. data/lib/active_record/fixture_set/file.rb +15 -1
  132. data/lib/active_record/fixture_set/table_row.rb +41 -6
  133. data/lib/active_record/fixture_set/table_rows.rb +4 -4
  134. data/lib/active_record/fixtures.rb +17 -20
  135. data/lib/active_record/future_result.rb +139 -0
  136. data/lib/active_record/gem_version.rb +4 -4
  137. data/lib/active_record/inheritance.rb +55 -17
  138. data/lib/active_record/insert_all.rb +80 -14
  139. data/lib/active_record/integration.rb +4 -3
  140. data/lib/active_record/internal_metadata.rb +3 -5
  141. data/lib/active_record/legacy_yaml_adapter.rb +2 -39
  142. data/lib/active_record/locking/optimistic.rb +10 -9
  143. data/lib/active_record/locking/pessimistic.rb +9 -3
  144. data/lib/active_record/log_subscriber.rb +14 -3
  145. data/lib/active_record/middleware/database_selector/resolver.rb +6 -10
  146. data/lib/active_record/middleware/database_selector.rb +8 -3
  147. data/lib/active_record/middleware/shard_selector.rb +60 -0
  148. data/lib/active_record/migration/command_recorder.rb +4 -4
  149. data/lib/active_record/migration/compatibility.rb +83 -1
  150. data/lib/active_record/migration/join_table.rb +1 -1
  151. data/lib/active_record/migration.rb +109 -79
  152. data/lib/active_record/model_schema.rb +45 -58
  153. data/lib/active_record/nested_attributes.rb +13 -12
  154. data/lib/active_record/no_touching.rb +3 -3
  155. data/lib/active_record/null_relation.rb +2 -6
  156. data/lib/active_record/persistence.rb +219 -52
  157. data/lib/active_record/query_cache.rb +2 -2
  158. data/lib/active_record/query_logs.rb +138 -0
  159. data/lib/active_record/querying.rb +15 -5
  160. data/lib/active_record/railtie.rb +127 -17
  161. data/lib/active_record/railties/controller_runtime.rb +1 -1
  162. data/lib/active_record/railties/databases.rake +66 -129
  163. data/lib/active_record/readonly_attributes.rb +11 -0
  164. data/lib/active_record/reflection.rb +67 -50
  165. data/lib/active_record/relation/batches/batch_enumerator.rb +19 -5
  166. data/lib/active_record/relation/batches.rb +3 -3
  167. data/lib/active_record/relation/calculations.rb +40 -36
  168. data/lib/active_record/relation/delegation.rb +6 -6
  169. data/lib/active_record/relation/finder_methods.rb +31 -35
  170. data/lib/active_record/relation/merger.rb +20 -13
  171. data/lib/active_record/relation/predicate_builder.rb +1 -6
  172. data/lib/active_record/relation/query_attribute.rb +5 -11
  173. data/lib/active_record/relation/query_methods.rb +235 -61
  174. data/lib/active_record/relation/record_fetch_warning.rb +7 -9
  175. data/lib/active_record/relation/spawn_methods.rb +2 -2
  176. data/lib/active_record/relation/where_clause.rb +10 -19
  177. data/lib/active_record/relation.rb +171 -84
  178. data/lib/active_record/result.rb +17 -7
  179. data/lib/active_record/runtime_registry.rb +9 -13
  180. data/lib/active_record/sanitization.rb +11 -7
  181. data/lib/active_record/schema_dumper.rb +10 -3
  182. data/lib/active_record/schema_migration.rb +0 -4
  183. data/lib/active_record/scoping/default.rb +61 -12
  184. data/lib/active_record/scoping/named.rb +3 -11
  185. data/lib/active_record/scoping.rb +64 -34
  186. data/lib/active_record/serialization.rb +1 -1
  187. data/lib/active_record/signed_id.rb +1 -1
  188. data/lib/active_record/suppressor.rb +11 -15
  189. data/lib/active_record/tasks/database_tasks.rb +116 -58
  190. data/lib/active_record/tasks/mysql_database_tasks.rb +1 -1
  191. data/lib/active_record/tasks/postgresql_database_tasks.rb +19 -12
  192. data/lib/active_record/test_databases.rb +1 -1
  193. data/lib/active_record/test_fixtures.rb +4 -4
  194. data/lib/active_record/timestamp.rb +3 -4
  195. data/lib/active_record/transactions.rb +9 -14
  196. data/lib/active_record/translation.rb +2 -2
  197. data/lib/active_record/type/adapter_specific_registry.rb +32 -7
  198. data/lib/active_record/type/hash_lookup_type_map.rb +34 -1
  199. data/lib/active_record/type/internal/timezone.rb +2 -2
  200. data/lib/active_record/type/serialized.rb +1 -1
  201. data/lib/active_record/type/type_map.rb +17 -20
  202. data/lib/active_record/type.rb +1 -2
  203. data/lib/active_record/validations/associated.rb +1 -1
  204. data/lib/active_record/validations/uniqueness.rb +1 -1
  205. data/lib/active_record.rb +204 -28
  206. data/lib/arel/attributes/attribute.rb +0 -8
  207. data/lib/arel/crud.rb +28 -22
  208. data/lib/arel/delete_manager.rb +18 -4
  209. data/lib/arel/filter_predications.rb +9 -0
  210. data/lib/arel/insert_manager.rb +2 -3
  211. data/lib/arel/nodes/casted.rb +1 -1
  212. data/lib/arel/nodes/delete_statement.rb +12 -13
  213. data/lib/arel/nodes/filter.rb +10 -0
  214. data/lib/arel/nodes/function.rb +1 -0
  215. data/lib/arel/nodes/insert_statement.rb +2 -2
  216. data/lib/arel/nodes/select_core.rb +2 -2
  217. data/lib/arel/nodes/select_statement.rb +2 -2
  218. data/lib/arel/nodes/update_statement.rb +8 -3
  219. data/lib/arel/nodes.rb +1 -0
  220. data/lib/arel/predications.rb +11 -3
  221. data/lib/arel/select_manager.rb +10 -4
  222. data/lib/arel/table.rb +0 -1
  223. data/lib/arel/tree_manager.rb +0 -12
  224. data/lib/arel/update_manager.rb +18 -4
  225. data/lib/arel/visitors/dot.rb +80 -90
  226. data/lib/arel/visitors/mysql.rb +8 -2
  227. data/lib/arel/visitors/postgresql.rb +0 -10
  228. data/lib/arel/visitors/to_sql.rb +58 -2
  229. data/lib/arel.rb +2 -1
  230. data/lib/rails/generators/active_record/application_record/templates/application_record.rb.tt +1 -1
  231. data/lib/rails/generators/active_record/model/templates/abstract_base_class.rb.tt +1 -1
  232. data/lib/rails/generators/active_record/model/templates/model.rb.tt +1 -1
  233. data/lib/rails/generators/active_record/model/templates/module.rb.tt +2 -2
  234. metadata +56 -13
@@ -103,7 +103,7 @@ module Arel # :nodoc: all
103
103
  row.each_with_index do |value, k|
104
104
  collector << ", " unless k == 0
105
105
  case value
106
- when Nodes::SqlLiteral, Nodes::BindParam
106
+ when Nodes::SqlLiteral, Nodes::BindParam, ActiveModel::Attribute
107
107
  collector = visit(value, collector)
108
108
  else
109
109
  collector << quote(value).to_s
@@ -135,6 +135,8 @@ module Arel # :nodoc: all
135
135
  visit_Arel_Nodes_SelectOptions(o, collector)
136
136
  end
137
137
 
138
+ # The Oracle enhanced adapter uses this private method,
139
+ # see https://github.com/rsim/oracle-enhanced/issues/2186
138
140
  def visit_Arel_Nodes_SelectOptions(o, collector)
139
141
  collector = maybe_visit o.limit, collector
140
142
  collector = maybe_visit o.offset, collector
@@ -243,6 +245,13 @@ module Arel # :nodoc: all
243
245
  collector << ")"
244
246
  end
245
247
 
248
+ def visit_Arel_Nodes_Filter(o, collector)
249
+ visit o.left, collector
250
+ collector << " FILTER (WHERE "
251
+ visit o.right, collector
252
+ collector << ")"
253
+ end
254
+
246
255
  def visit_Arel_Nodes_Rows(o, collector)
247
256
  if o.expr
248
257
  collector << "ROWS "
@@ -357,6 +366,17 @@ module Arel # :nodoc: all
357
366
  visit(o.expr, collector) << " DESC"
358
367
  end
359
368
 
369
+ # NullsFirst is available on all but MySQL, where it is redefined.
370
+ def visit_Arel_Nodes_NullsFirst(o, collector)
371
+ visit o.expr, collector
372
+ collector << " NULLS FIRST"
373
+ end
374
+
375
+ def visit_Arel_Nodes_NullsLast(o, collector)
376
+ visit o.expr, collector
377
+ collector << " NULLS LAST"
378
+ end
379
+
360
380
  def visit_Arel_Nodes_Group(o, collector)
361
381
  visit o.expr, collector
362
382
  end
@@ -412,24 +432,48 @@ module Arel # :nodoc: all
412
432
  end
413
433
 
414
434
  def visit_Arel_Nodes_GreaterThanOrEqual(o, collector)
435
+ case unboundable?(o.right)
436
+ when 1
437
+ return collector << "1=0"
438
+ when -1
439
+ return collector << "1=1"
440
+ end
415
441
  collector = visit o.left, collector
416
442
  collector << " >= "
417
443
  visit o.right, collector
418
444
  end
419
445
 
420
446
  def visit_Arel_Nodes_GreaterThan(o, collector)
447
+ case unboundable?(o.right)
448
+ when 1
449
+ return collector << "1=0"
450
+ when -1
451
+ return collector << "1=1"
452
+ end
421
453
  collector = visit o.left, collector
422
454
  collector << " > "
423
455
  visit o.right, collector
424
456
  end
425
457
 
426
458
  def visit_Arel_Nodes_LessThanOrEqual(o, collector)
459
+ case unboundable?(o.right)
460
+ when 1
461
+ return collector << "1=1"
462
+ when -1
463
+ return collector << "1=0"
464
+ end
427
465
  collector = visit o.left, collector
428
466
  collector << " <= "
429
467
  visit o.right, collector
430
468
  end
431
469
 
432
470
  def visit_Arel_Nodes_LessThan(o, collector)
471
+ case unboundable?(o.right)
472
+ when 1
473
+ return collector << "1=1"
474
+ when -1
475
+ return collector << "1=0"
476
+ end
433
477
  collector = visit o.left, collector
434
478
  collector << " < "
435
479
  visit o.right, collector
@@ -585,7 +629,7 @@ module Arel # :nodoc: all
585
629
 
586
630
  def visit_Arel_Nodes_Assignment(o, collector)
587
631
  case o.right
588
- when Arel::Nodes::Node, Arel::Attributes::Attribute
632
+ when Arel::Nodes::Node, Arel::Attributes::Attribute, ActiveModel::Attribute
589
633
  collector = visit o.left, collector
590
634
  collector << " = "
591
635
  visit o.right, collector
@@ -695,6 +739,10 @@ module Arel # :nodoc: all
695
739
 
696
740
  def bind_block; BIND_BLOCK; end
697
741
 
742
+ def visit_ActiveModel_Attribute(o, collector)
743
+ collector.add_bind(o, &bind_block)
744
+ end
745
+
698
746
  def visit_Arel_Nodes_BindParam(o, collector)
699
747
  collector.add_bind(o.value, &bind_block)
700
748
  end
@@ -793,6 +841,10 @@ module Arel # :nodoc: all
793
841
  o.limit || o.offset || !o.orders.empty?
794
842
  end
795
843
 
844
+ def has_group_by_and_having?(o)
845
+ !o.groups.empty? && !o.havings.empty?
846
+ end
847
+
796
848
  # The default strategy for an UPDATE with joins is to use a subquery. This doesn't work
797
849
  # on MySQL (even when aliasing the tables), but MySQL allows using JOIN directly in
798
850
  # an UPDATE statement, so in the MySQL visitor we redefine this to do that.
@@ -804,6 +856,8 @@ module Arel # :nodoc: all
804
856
  stmt.orders = []
805
857
  stmt.wheres = [Nodes::In.new(o.key, [build_subselect(o.key, o)])]
806
858
  stmt.relation = o.relation.left if has_join_sources?(o)
859
+ stmt.groups = o.groups unless o.groups.empty?
860
+ stmt.havings = o.havings unless o.havings.empty?
807
861
  stmt
808
862
  else
809
863
  o
@@ -818,6 +872,8 @@ module Arel # :nodoc: all
818
872
  core.froms = o.relation
819
873
  core.wheres = o.wheres
820
874
  core.projections = [key]
875
+ core.groups = o.groups unless o.groups.empty?
876
+ core.havings = o.havings unless o.havings.empty?
821
877
  stmt.limit = o.limit
822
878
  stmt.offset = o.offset
823
879
  stmt.orders = o.orders
data/lib/arel.rb CHANGED
@@ -7,6 +7,7 @@ require "arel/factory_methods"
7
7
 
8
8
  require "arel/expressions"
9
9
  require "arel/predications"
10
+ require "arel/filter_predications"
10
11
  require "arel/window_predications"
11
12
  require "arel/math"
12
13
  require "arel/alias_predication"
@@ -29,7 +30,7 @@ module Arel
29
30
 
30
31
  # Wrap a known-safe SQL string for passing to query methods, e.g.
31
32
  #
32
- # Post.order(Arel.sql("length(title)")).last
33
+ # Post.order(Arel.sql("REPLACE(title, 'misc', 'zzzz') asc")).pluck(:id)
33
34
  #
34
35
  # Great caution should be taken to avoid SQL injection vulnerabilities.
35
36
  # This method should not be used with unsafe values such as request
@@ -1,5 +1,5 @@
1
1
  <% module_namespacing do -%>
2
2
  class ApplicationRecord < ActiveRecord::Base
3
- self.abstract_class = true
3
+ primary_abstract_class
4
4
  end
5
5
  <% end -%>
@@ -2,6 +2,6 @@
2
2
  class <%= abstract_class_name %> < ApplicationRecord
3
3
  self.abstract_class = true
4
4
 
5
- connects_to database: { <%= ActiveRecord::Base.writing_role %>: :<%= database -%> }
5
+ connects_to database: { <%= ActiveRecord.writing_role %>: :<%= database -%> }
6
6
  end
7
7
  <% end -%>
@@ -1,7 +1,7 @@
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? %>
4
+ belongs_to :<%= attribute.name %><%= ", polymorphic: true" if attribute.polymorphic? %>
5
5
  <% end -%>
6
6
  <% attributes.select(&:rich_text?).each do |attribute| -%>
7
7
  has_rich_text :<%= attribute.name %>
@@ -1,7 +1,7 @@
1
1
  <% module_namespacing do -%>
2
- module <%= class_path.map(&:camelize).join('::') %>
2
+ module <%= class_path.map(&:camelize).join("::") %>
3
3
  def self.table_name_prefix
4
- '<%= namespaced? ? namespaced_class_path.join('_') : class_path.join('_') %>_'
4
+ "<%= namespaced? ? namespaced_class_path.join("_") : class_path.join("_") %>_"
5
5
  end
6
6
  end
7
7
  <% 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: 6.1.4
4
+ version: 7.0.0.rc1
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: 2021-06-24 00:00:00.000000000 Z
11
+ date: 2021-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 6.1.4
19
+ version: 7.0.0.rc1
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: 6.1.4
26
+ version: 7.0.0.rc1
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: 6.1.4
33
+ version: 7.0.0.rc1
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: 6.1.4
40
+ version: 7.0.0.rc1
41
41
  description: Databases on Rails. Build a persistent domain model by mapping database
42
42
  tables to Ruby classes. Strong conventions for associations, validations, aggregations,
43
43
  migrations, and testing come baked-in.
@@ -70,6 +70,7 @@ files:
70
70
  - lib/active_record/associations/builder/singular_association.rb
71
71
  - lib/active_record/associations/collection_association.rb
72
72
  - lib/active_record/associations/collection_proxy.rb
73
+ - lib/active_record/associations/disable_joins_association_scope.rb
73
74
  - lib/active_record/associations/foreign_association.rb
74
75
  - lib/active_record/associations/has_many_association.rb
75
76
  - lib/active_record/associations/has_many_through_association.rb
@@ -81,9 +82,12 @@ files:
81
82
  - lib/active_record/associations/join_dependency/join_part.rb
82
83
  - lib/active_record/associations/preloader.rb
83
84
  - lib/active_record/associations/preloader/association.rb
85
+ - lib/active_record/associations/preloader/batch.rb
86
+ - lib/active_record/associations/preloader/branch.rb
84
87
  - lib/active_record/associations/preloader/through_association.rb
85
88
  - lib/active_record/associations/singular_association.rb
86
89
  - lib/active_record/associations/through_association.rb
90
+ - lib/active_record/asynchronous_queries_tracker.rb
87
91
  - lib/active_record/attribute_assignment.rb
88
92
  - lib/active_record/attribute_methods.rb
89
93
  - lib/active_record/attribute_methods/before_type_cast.rb
@@ -101,7 +105,10 @@ files:
101
105
  - lib/active_record/coders/json.rb
102
106
  - lib/active_record/coders/yaml_column.rb
103
107
  - lib/active_record/connection_adapters.rb
108
+ - lib/active_record/connection_adapters/abstract/connection_handler.rb
104
109
  - lib/active_record/connection_adapters/abstract/connection_pool.rb
110
+ - lib/active_record/connection_adapters/abstract/connection_pool/queue.rb
111
+ - lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb
105
112
  - lib/active_record/connection_adapters/abstract/database_limits.rb
106
113
  - lib/active_record/connection_adapters/abstract/database_statements.rb
107
114
  - lib/active_record/connection_adapters/abstract/query_cache.rb
@@ -153,6 +160,8 @@ files:
153
160
  - lib/active_record/connection_adapters/postgresql/oid/point.rb
154
161
  - lib/active_record/connection_adapters/postgresql/oid/range.rb
155
162
  - lib/active_record/connection_adapters/postgresql/oid/specialized_string.rb
163
+ - lib/active_record/connection_adapters/postgresql/oid/timestamp.rb
164
+ - lib/active_record/connection_adapters/postgresql/oid/timestamp_with_time_zone.rb
156
165
  - lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb
157
166
  - lib/active_record/connection_adapters/postgresql/oid/uuid.rb
158
167
  - lib/active_record/connection_adapters/postgresql/oid/vector.rb
@@ -187,7 +196,35 @@ files:
187
196
  - lib/active_record/database_configurations/url_config.rb
188
197
  - lib/active_record/delegated_type.rb
189
198
  - lib/active_record/destroy_association_async_job.rb
199
+ - lib/active_record/disable_joins_association_relation.rb
190
200
  - lib/active_record/dynamic_matchers.rb
201
+ - lib/active_record/encryption.rb
202
+ - lib/active_record/encryption/cipher.rb
203
+ - lib/active_record/encryption/cipher/aes256_gcm.rb
204
+ - lib/active_record/encryption/config.rb
205
+ - lib/active_record/encryption/configurable.rb
206
+ - lib/active_record/encryption/context.rb
207
+ - lib/active_record/encryption/contexts.rb
208
+ - lib/active_record/encryption/derived_secret_key_provider.rb
209
+ - lib/active_record/encryption/deterministic_key_provider.rb
210
+ - lib/active_record/encryption/encryptable_record.rb
211
+ - lib/active_record/encryption/encrypted_attribute_type.rb
212
+ - lib/active_record/encryption/encrypted_fixtures.rb
213
+ - lib/active_record/encryption/encrypting_only_encryptor.rb
214
+ - lib/active_record/encryption/encryptor.rb
215
+ - lib/active_record/encryption/envelope_encryption_key_provider.rb
216
+ - lib/active_record/encryption/errors.rb
217
+ - lib/active_record/encryption/extended_deterministic_queries.rb
218
+ - lib/active_record/encryption/extended_deterministic_uniqueness_validator.rb
219
+ - lib/active_record/encryption/key.rb
220
+ - lib/active_record/encryption/key_generator.rb
221
+ - lib/active_record/encryption/key_provider.rb
222
+ - lib/active_record/encryption/message.rb
223
+ - lib/active_record/encryption/message_serializer.rb
224
+ - lib/active_record/encryption/null_encryptor.rb
225
+ - lib/active_record/encryption/properties.rb
226
+ - lib/active_record/encryption/read_only_null_encryptor.rb
227
+ - lib/active_record/encryption/scheme.rb
191
228
  - lib/active_record/enum.rb
192
229
  - lib/active_record/errors.rb
193
230
  - lib/active_record/explain.rb
@@ -199,6 +236,7 @@ files:
199
236
  - lib/active_record/fixture_set/table_row.rb
200
237
  - lib/active_record/fixture_set/table_rows.rb
201
238
  - lib/active_record/fixtures.rb
239
+ - lib/active_record/future_result.rb
202
240
  - lib/active_record/gem_version.rb
203
241
  - lib/active_record/inheritance.rb
204
242
  - lib/active_record/insert_all.rb
@@ -212,6 +250,7 @@ files:
212
250
  - lib/active_record/middleware/database_selector.rb
213
251
  - lib/active_record/middleware/database_selector/resolver.rb
214
252
  - lib/active_record/middleware/database_selector/resolver/session.rb
253
+ - lib/active_record/middleware/shard_selector.rb
215
254
  - lib/active_record/migration.rb
216
255
  - lib/active_record/migration/command_recorder.rb
217
256
  - lib/active_record/migration/compatibility.rb
@@ -222,6 +261,7 @@ files:
222
261
  - lib/active_record/null_relation.rb
223
262
  - lib/active_record/persistence.rb
224
263
  - lib/active_record/query_cache.rb
264
+ - lib/active_record/query_logs.rb
225
265
  - lib/active_record/querying.rb
226
266
  - lib/active_record/railtie.rb
227
267
  - lib/active_record/railties/console_sandbox.rb
@@ -312,6 +352,7 @@ files:
312
352
  - lib/arel/errors.rb
313
353
  - lib/arel/expressions.rb
314
354
  - lib/arel/factory_methods.rb
355
+ - lib/arel/filter_predications.rb
315
356
  - lib/arel/insert_manager.rb
316
357
  - lib/arel/math.rb
317
358
  - lib/arel/nodes.rb
@@ -328,6 +369,7 @@ files:
328
369
  - lib/arel/nodes/equality.rb
329
370
  - lib/arel/nodes/extract.rb
330
371
  - lib/arel/nodes/false.rb
372
+ - lib/arel/nodes/filter.rb
331
373
  - lib/arel/nodes/full_outer_join.rb
332
374
  - lib/arel/nodes/function.rb
333
375
  - lib/arel/nodes/grouping.rb
@@ -390,10 +432,11 @@ licenses:
390
432
  - MIT
391
433
  metadata:
392
434
  bug_tracker_uri: https://github.com/rails/rails/issues
393
- changelog_uri: https://github.com/rails/rails/blob/v6.1.4/activerecord/CHANGELOG.md
394
- documentation_uri: https://api.rubyonrails.org/v6.1.4/
435
+ changelog_uri: https://github.com/rails/rails/blob/v7.0.0.rc1/activerecord/CHANGELOG.md
436
+ documentation_uri: https://api.rubyonrails.org/v7.0.0.rc1/
395
437
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
396
- source_code_uri: https://github.com/rails/rails/tree/v6.1.4/activerecord
438
+ source_code_uri: https://github.com/rails/rails/tree/v7.0.0.rc1/activerecord
439
+ rubygems_mfa_required: 'true'
397
440
  post_install_message:
398
441
  rdoc_options:
399
442
  - "--main"
@@ -404,14 +447,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
404
447
  requirements:
405
448
  - - ">="
406
449
  - !ruby/object:Gem::Version
407
- version: 2.5.0
450
+ version: 2.7.0
408
451
  required_rubygems_version: !ruby/object:Gem::Requirement
409
452
  requirements:
410
- - - ">="
453
+ - - ">"
411
454
  - !ruby/object:Gem::Version
412
- version: '0'
455
+ version: 1.3.1
413
456
  requirements: []
414
- rubygems_version: 3.1.2
457
+ rubygems_version: 3.2.22
415
458
  signing_key:
416
459
  specification_version: 4
417
460
  summary: Object-relational mapper framework (part of Rails).