activerecord 7.1.0 → 7.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +95 -0
  3. data/README.rdoc +1 -0
  4. data/lib/active_record/associations.rb +14 -14
  5. data/lib/active_record/attribute_methods/dirty.rb +13 -9
  6. data/lib/active_record/callbacks.rb +2 -2
  7. data/lib/active_record/connection_adapters/abstract/database_statements.rb +5 -3
  8. data/lib/active_record/connection_adapters/abstract/schema_statements.rb +1 -3
  9. data/lib/active_record/connection_adapters/abstract_adapter.rb +13 -4
  10. data/lib/active_record/connection_adapters/mysql2/database_statements.rb +3 -0
  11. data/lib/active_record/connection_adapters/postgresql/column.rb +14 -2
  12. data/lib/active_record/connection_adapters/postgresql/database_statements.rb +4 -1
  13. data/lib/active_record/connection_adapters/postgresql/oid/money.rb +3 -2
  14. data/lib/active_record/connection_adapters/postgresql/oid/timestamp_with_time_zone.rb +1 -1
  15. data/lib/active_record/connection_adapters/postgresql/schema_statements.rb +14 -6
  16. data/lib/active_record/connection_adapters/postgresql_adapter.rb +32 -32
  17. data/lib/active_record/connection_adapters/sqlite3/database_statements.rb +10 -3
  18. data/lib/active_record/connection_adapters/trilogy/database_statements.rb +1 -0
  19. data/lib/active_record/core.rb +25 -24
  20. data/lib/active_record/encryption/extended_deterministic_queries.rb +0 -15
  21. data/lib/active_record/enum.rb +6 -9
  22. data/lib/active_record/gem_version.rb +1 -1
  23. data/lib/active_record/insert_all.rb +3 -3
  24. data/lib/active_record/internal_metadata.rb +3 -1
  25. data/lib/active_record/migration/command_recorder.rb +4 -1
  26. data/lib/active_record/migration/pending_migration_connection.rb +21 -0
  27. data/lib/active_record/migration.rb +6 -3
  28. data/lib/active_record/model_schema.rb +5 -5
  29. data/lib/active_record/nested_attributes.rb +7 -9
  30. data/lib/active_record/normalization.rb +8 -0
  31. data/lib/active_record/promise.rb +1 -1
  32. data/lib/active_record/railtie.rb +1 -1
  33. data/lib/active_record/railties/databases.rake +5 -5
  34. data/lib/active_record/reflection.rb +12 -0
  35. data/lib/active_record/relation/calculations.rb +16 -8
  36. data/lib/active_record/relation/query_methods.rb +1 -1
  37. data/lib/active_record/schema_migration.rb +1 -1
  38. data/lib/active_record/timestamp.rb +1 -1
  39. data/lib/arel/nodes/homogeneous_in.rb +1 -1
  40. metadata +10 -9
@@ -93,7 +93,8 @@ module ActiveRecord
93
93
  end
94
94
  end
95
95
 
96
- # Same as <tt>#count</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
96
+ # Same as #count, but performs the query asynchronously and returns an
97
+ # ActiveRecord::Promise.
97
98
  def async_count(column_name = nil)
98
99
  async.count(column_name)
99
100
  end
@@ -106,7 +107,8 @@ module ActiveRecord
106
107
  calculate(:average, column_name)
107
108
  end
108
109
 
109
- # Same as <tt>#average</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
110
+ # Same as #average, but performs the query asynchronously and returns an
111
+ # ActiveRecord::Promise.
110
112
  def async_average(column_name)
111
113
  async.average(column_name)
112
114
  end
@@ -120,7 +122,8 @@ module ActiveRecord
120
122
  calculate(:minimum, column_name)
121
123
  end
122
124
 
123
- # Same as <tt>#minimum</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
125
+ # Same as #minimum, but performs the query asynchronously and returns an
126
+ # ActiveRecord::Promise.
124
127
  def async_minimum(column_name)
125
128
  async.minimum(column_name)
126
129
  end
@@ -134,7 +137,8 @@ module ActiveRecord
134
137
  calculate(:maximum, column_name)
135
138
  end
136
139
 
137
- # Same as <tt>#maximum</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
140
+ # Same as #maximum, but performs the query asynchronously and returns an
141
+ # ActiveRecord::Promise.
138
142
  def async_maximum(column_name)
139
143
  async.maximum(column_name)
140
144
  end
@@ -152,7 +156,8 @@ module ActiveRecord
152
156
  end
153
157
  end
154
158
 
155
- # Same as <tt>#sum</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
159
+ # Same as #sum, but performs the query asynchronously and returns an
160
+ # ActiveRecord::Promise.
156
161
  def async_sum(identity_or_column = nil)
157
162
  async.sum(identity_or_column)
158
163
  end
@@ -287,7 +292,8 @@ module ActiveRecord
287
292
  end
288
293
  end
289
294
 
290
- # Same as <tt>#pluck</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
295
+ # Same as #pluck, but performs the query asynchronously and returns an
296
+ # ActiveRecord::Promise.
291
297
  def async_pluck(*column_names)
292
298
  async.pluck(*column_names)
293
299
  end
@@ -315,7 +321,8 @@ module ActiveRecord
315
321
  limit(1).pluck(*column_names).then(&:first)
316
322
  end
317
323
 
318
- # Same as <tt>#pick</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
324
+ # Same as #pick, but performs the query asynchronously and returns an
325
+ # ActiveRecord::Promise.
319
326
  def async_pick(*column_names)
320
327
  async.pick(*column_names)
321
328
  end
@@ -358,7 +365,8 @@ module ActiveRecord
358
365
  result.then { |result| type_cast_pluck_values(result, columns) }
359
366
  end
360
367
 
361
- # Same as <tt>#ids</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
368
+ # Same as #ids, but performs the query asynchronously and returns an
369
+ # ActiveRecord::Promise.
362
370
  def async_ids
363
371
  async.ids
364
372
  end
@@ -588,7 +588,7 @@ module ActiveRecord
588
588
  # User.order(Arel.sql('end_date - start_date'))
589
589
  # # SELECT "users".* FROM "users" ORDER BY end_date - start_date
590
590
  #
591
- # Custom query syntax, like JSON columns for Postgres, is supported in this way.
591
+ # Custom query syntax, like JSON columns for PostgreSQL, is supported in this way.
592
592
  #
593
593
  # User.order(Arel.sql("payload->>'kind'"))
594
594
  # # SELECT "users".* FROM "users" ORDER BY payload->>'kind'
@@ -6,7 +6,7 @@ module ActiveRecord
6
6
  # number is inserted in to the schema migrations table so it doesn't need
7
7
  # to be executed the next time.
8
8
  class SchemaMigration # :nodoc:
9
- class NullSchemaMigration
9
+ class NullSchemaMigration # :nodoc:
10
10
  end
11
11
 
12
12
  attr_reader :connection, :arel_table
@@ -30,7 +30,7 @@ module ActiveRecord
30
30
  #
31
31
  # ActiveRecord::Base.time_zone_aware_types = [:datetime]
32
32
  #
33
- # You can also add database specific timezone aware types. For example, for PostgreSQL:
33
+ # You can also add database-specific timezone aware types. For example, for PostgreSQL:
34
34
  #
35
35
  # ActiveRecord::Base.time_zone_aware_types += [:tsrange, :tstzrange]
36
36
  #
@@ -48,7 +48,7 @@ module Arel # :nodoc: all
48
48
  end
49
49
 
50
50
  def proc_for_binds
51
- -> value { ActiveModel::Attribute.with_cast_value(attribute.name, value, attribute.type_caster) }
51
+ -> value { ActiveModel::Attribute.with_cast_value(attribute.name, value, ActiveModel::Type.default_value) }
52
52
  end
53
53
 
54
54
  def fetch_attribute(&block)
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: 7.1.0
4
+ version: 7.1.2
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: 2023-10-05 00:00:00.000000000 Z
11
+ date: 2023-11-10 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: 7.1.0
19
+ version: 7.1.2
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: 7.1.0
26
+ version: 7.1.2
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: 7.1.0
33
+ version: 7.1.2
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: 7.1.0
40
+ version: 7.1.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: timeout
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -279,6 +279,7 @@ files:
279
279
  - lib/active_record/migration/default_strategy.rb
280
280
  - lib/active_record/migration/execution_strategy.rb
281
281
  - lib/active_record/migration/join_table.rb
282
+ - lib/active_record/migration/pending_migration_connection.rb
282
283
  - lib/active_record/model_schema.rb
283
284
  - lib/active_record/nested_attributes.rb
284
285
  - lib/active_record/no_touching.rb
@@ -469,10 +470,10 @@ licenses:
469
470
  - MIT
470
471
  metadata:
471
472
  bug_tracker_uri: https://github.com/rails/rails/issues
472
- changelog_uri: https://github.com/rails/rails/blob/v7.1.0/activerecord/CHANGELOG.md
473
- documentation_uri: https://api.rubyonrails.org/v7.1.0/
473
+ changelog_uri: https://github.com/rails/rails/blob/v7.1.2/activerecord/CHANGELOG.md
474
+ documentation_uri: https://api.rubyonrails.org/v7.1.2/
474
475
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
475
- source_code_uri: https://github.com/rails/rails/tree/v7.1.0/activerecord
476
+ source_code_uri: https://github.com/rails/rails/tree/v7.1.2/activerecord
476
477
  rubygems_mfa_required: 'true'
477
478
  post_install_message:
478
479
  rdoc_options: