Skip to content

Commit db6eb7b

Browse files
committed
Specify singleton method name for accessors defined on singleton_class [ci-skip]
RDoc can't extract the name of accessors defined with `singleton_class.attr_accessor`, resulting in methods called `unknown` in RDoc.
1 parent fe81d66 commit db6eb7b

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

activejob/lib/active_job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def self.use_big_decimal_serializer=(value)
5858
end
5959

6060
##
61-
# :singleton-method:
61+
# :singleton-method: verbose_enqueue_logs
6262
#
6363
# Specifies if the methods calling background job enqueue should be logged below
6464
# their relevant enqueue log lines. Defaults to false.

activerecord/lib/active_record.rb

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,16 @@ module Tasks
180180
singleton_class.attr_accessor :disable_prepared_statements
181181
self.disable_prepared_statements = false
182182

183+
##
184+
# :singleton-method: lazily_load_schema_cache
183185
# Lazily load the schema cache. This option will load the schema cache
184186
# when a connection is established rather than on boot. If set,
185187
# +config.active_record.use_schema_cache_dump+ will be set to false.
186188
singleton_class.attr_accessor :lazily_load_schema_cache
187189
self.lazily_load_schema_cache = false
188190

191+
##
192+
# :singleton-method: schema_cache_ignored_tables
189193
# A list of tables or regex's to match tables to ignore when
190194
# dumping the schema cache. For example if this is set to +[/^_/]+
191195
# the schema cache will not dump tables named with an underscore.
@@ -206,6 +210,8 @@ def self.default_timezone=(default_timezone)
206210

207211
self.default_timezone = :utc
208212

213+
##
214+
# :singleton-method: db_warnings_action
209215
# The action to take when database query produces warning.
210216
# Must be one of :ignore, :log, :raise, :report, or a custom proc.
211217
# The default is :ignore.
@@ -235,6 +241,8 @@ def self.db_warnings_action=(action)
235241

236242
self.db_warnings_action = :ignore
237243

244+
##
245+
# :singleton-method: db_warnings_ignore
238246
# Specify allowlist of database warnings.
239247
singleton_class.attr_accessor :db_warnings_ignore
240248
self.db_warnings_ignore = []
@@ -253,6 +261,8 @@ def self.legacy_connection_handling=(_)
253261
MSG
254262
end
255263

264+
##
265+
# :singleton-method: async_query_executor
256266
# Sets the async_query_executor for an application. By default the thread pool executor
257267
# set to +nil+ which will not run queries in the background. Applications must configure
258268
# a thread pool executor to use this feature. Options are:
@@ -294,15 +304,15 @@ def self.global_executor_concurrency # :nodoc:
294304
self.index_nested_attribute_errors = false
295305

296306
##
297-
# :singleton-method:
307+
# :singleton-method: verbose_query_logs
298308
#
299309
# Specifies if the methods calling database queries should be logged below
300310
# their relevant queries. Defaults to false.
301311
singleton_class.attr_accessor :verbose_query_logs
302312
self.verbose_query_logs = false
303313

304314
##
305-
# :singleton-method:
315+
# :singleton-method: queues
306316
#
307317
# Specifies the names of the queues used by background jobs.
308318
singleton_class.attr_accessor :queues
@@ -327,7 +337,7 @@ def self.global_executor_concurrency # :nodoc:
327337
self.commit_transaction_on_non_local_return = false
328338

329339
##
330-
# :singleton-method:
340+
# :singleton-method: warn_on_records_fetched_greater_than
331341
# Specify a threshold for the size of query result sets. If the number of
332342
# records in the set exceeds the threshold, a warning is logged. This can
333343
# be used to identify queries which load thousands of records and
@@ -339,14 +349,14 @@ def self.global_executor_concurrency # :nodoc:
339349
self.application_record_class = nil
340350

341351
##
342-
# :singleton-method:
352+
# :singleton-method: action_on_strict_loading_violation
343353
# Set the application to log or raise when an association violates strict loading.
344354
# Defaults to :raise.
345355
singleton_class.attr_accessor :action_on_strict_loading_violation
346356
self.action_on_strict_loading_violation = :raise
347357

348358
##
349-
# :singleton-method:
359+
# :singleton-method: schema_format
350360
# Specifies the format to use when dumping the database schema with Rails'
351361
# Rakefile. If :sql, the schema is dumped as (potentially database-
352362
# specific) SQL statements. If :ruby, the schema is dumped as an
@@ -357,27 +367,27 @@ def self.global_executor_concurrency # :nodoc:
357367
self.schema_format = :ruby
358368

359369
##
360-
# :singleton-method:
370+
# :singleton-method: error_on_ignored_order
361371
# Specifies if an error should be raised if the query has an order being
362372
# ignored when doing batch queries. Useful in applications where the
363373
# scope being ignored is error-worthy, rather than a warning.
364374
singleton_class.attr_accessor :error_on_ignored_order
365375
self.error_on_ignored_order = false
366376

367377
##
368-
# :singleton-method:
378+
# :singleton-method: timestamped_migrations
369379
# Specify whether or not to use timestamps for migration versions
370380
singleton_class.attr_accessor :timestamped_migrations
371381
self.timestamped_migrations = true
372382

373383
##
374-
# :singleton-method:
384+
# :singleton-method: migration_strategy
375385
# Specify strategy to use for executing migrations.
376386
singleton_class.attr_accessor :migration_strategy
377387
self.migration_strategy = Migration::DefaultStrategy
378388

379389
##
380-
# :singleton-method:
390+
# :singleton-method: dump_schema_after_migration
381391
# Specify whether schema dump should happen at the end of the
382392
# bin/rails db:migrate command. This is true by default, which is useful for the
383393
# development environment. This should ideally be false in the production
@@ -386,7 +396,7 @@ def self.global_executor_concurrency # :nodoc:
386396
self.dump_schema_after_migration = true
387397

388398
##
389-
# :singleton-method:
399+
# :singleton-method: dump_schemas
390400
# Specifies which database schemas to dump when calling db:schema:dump.
391401
# If the value is :schema_search_path (the default), any schemas listed in
392402
# schema_search_path are dumped. Use :all to dump all schemas regardless
@@ -410,7 +420,7 @@ def self.suppress_multiple_database_warning=(value)
410420
end
411421

412422
##
413-
# :singleton-method:
423+
# :singleton-method: verify_foreign_keys_for_fixtures
414424
# If true, Rails will verify all foreign keys in the database after loading fixtures.
415425
# An error will be raised if there are any foreign key violations, indicating incorrectly
416426
# written fixtures.
@@ -419,7 +429,7 @@ def self.suppress_multiple_database_warning=(value)
419429
self.verify_foreign_keys_for_fixtures = false
420430

421431
##
422-
# :singleton-method:
432+
# :singleton-method: allow_deprecated_singular_associations_name
423433
# If true, Rails will continue allowing plural association names in where clauses on singular associations
424434
# This behavior will be removed in Rails 7.2.
425435
singleton_class.attr_accessor :allow_deprecated_singular_associations_name
@@ -429,29 +439,29 @@ def self.suppress_multiple_database_warning=(value)
429439
self.query_transformers = []
430440

431441
##
432-
# :singleton-method:
442+
# :singleton-method: use_yaml_unsafe_load
433443
# Application configurable boolean that instructs the YAML Coder to use
434444
# an unsafe load if set to true.
435445
singleton_class.attr_accessor :use_yaml_unsafe_load
436446
self.use_yaml_unsafe_load = false
437447

438448
##
439-
# :singleton-method:
449+
# :singleton-method: raise_int_wider_than_64bit
440450
# Application configurable boolean that denotes whether or not to raise
441451
# an exception when the PostgreSQLAdapter is provided with an integer that
442452
# is wider than signed 64bit representation
443453
singleton_class.attr_accessor :raise_int_wider_than_64bit
444454
self.raise_int_wider_than_64bit = true
445455

446456
##
447-
# :singleton-method:
457+
# :singleton-method: yaml_column_permitted_classes
448458
# Application configurable array that provides additional permitted classes
449459
# to Psych safe_load in the YAML Coder
450460
singleton_class.attr_accessor :yaml_column_permitted_classes
451461
self.yaml_column_permitted_classes = [Symbol]
452462

453463
##
454-
# :singleton-method:
464+
# :singleton-method: generate_secure_token_on
455465
# Controls when to generate a value for <tt>has_secure_token</tt>
456466
# declarations. Defaults to <tt>:create</tt>.
457467
singleton_class.attr_accessor :generate_secure_token_on
@@ -466,7 +476,7 @@ def self.marshalling_format_version=(value)
466476
end
467477

468478
##
469-
# :singleton-method:
479+
# :singleton-method: protocol_adapters
470480
# Provides a mapping between database protocols/DBMSs and the
471481
# underlying database adapter to be used. This is used only by the
472482
# <tt>DATABASE_URL</tt> environment variable.

0 commit comments

Comments
 (0)