#
# ### in monkeys.yml
#
# george:
# id: 1
# name: George the Monkey
# pirate_id: 1
#
# Add a few more monkeys and pirates and break this into multiple files,
# and it gets pretty hard to keep track of what's going on. Let's
# use labels instead of IDs:
#
# ### in pirates.yml
#
# reginald:
# name: Reginald the Pirate
# monkey: george
#
#
#
# ### in monkeys.yml
#
# george:
# name: George the Monkey
# pirate: reginald
#
# Pow! All is made clear. Active Record reflects on the fixture's model class,
# finds all the +belongs_to+ associations, and allows you to specify
# a target *label* for the *association* (monkey: george) rather than
# a target *id* for the *FK* (monkey_id: 1).
#
# ==== Polymorphic +belongs_to+
#
# Supporting polymorphic relationships is a little bit more complicated, since
# Active Record needs to know what type your association is pointing at. Something
# like this should look familiar:
#
# ### in fruit.rb
#
# belongs_to :eater, polymorphic: true
#
#
#
# ### in fruits.yml
#
# apple:
# id: 1
# name: apple
# eater_id: 1
# eater_type: Monkey
#
# Can we do better? You bet!
#
# apple:
# eater: george (Monkey)
#
# Just provide the polymorphic target type and Active Record will take care of the rest.
#
# ==== +has_and_belongs_to_many+ or has_many :through
#
# \Time to give our monkey some fruit.
#
# ### in monkeys.yml
#
# george:
# id: 1
# name: George the Monkey
#
#
#
# ### in fruits.yml
#
# apple:
# id: 1
# name: apple
#
# orange:
# id: 2
# name: orange
#
# grape:
# id: 3
# name: grape
#
#
#
# ### in fruits_monkeys.yml
#
# apple_george:
# fruit_id: 1
# monkey_id: 1
#
# orange_george:
# fruit_id: 2
# monkey_id: 1
#
# grape_george:
# fruit_id: 3
# monkey_id: 1
#
# Let's make the HABTM fixture go away.
#
# ### in monkeys.yml
#
# george:
# id: 1
# name: George the Monkey
# fruits: apple, orange, grape
#
#
#
# ### in fruits.yml
#
# apple:
# name: apple
#
# orange:
# name: orange
#
# grape:
# name: grape
#
# Zap! No more fruits_monkeys.yml file. We've specified the list of fruits
# on George's fixture, but we could've just as easily specified a list
# of monkeys on each fruit. As with +belongs_to+, Active Record reflects on
# the fixture's model class and discovers the +has_and_belongs_to_many+
# associations.
#
# === Autofilled \Timestamp Columns
#
# If your table/model specifies any of Active Record's
# standard timestamp columns (+created_at+, +created_on+, +updated_at+, +updated_on+),
# they will automatically be set to Time.now.
#
# If you've set specific values, they'll be left alone.
#
# === Fixture label interpolation
#
# The label of the current fixture is always available as a column value:
#
# geeksomnia:
# name: Geeksomnia's Account
# subdomain: $LABEL
# email: $LABEL@email.com
#
# Also, sometimes (like when porting older join table fixtures) you'll need
# to be able to get a hold of the identifier for a given label. ERB
# to the rescue:
#
# george_reginald:
# monkey_id: <%= ActiveRecord::FixtureSet.identify(:reginald) %>
# pirate_id: <%= ActiveRecord::FixtureSet.identify(:george) %>
#
# If the model uses UUID values for identifiers, add the +:uuid+ argument:
#
# ActiveRecord::FixtureSet.identify(:boaty_mcboatface, :uuid)
#
# === Support for YAML defaults
#
# You can set and reuse defaults in your fixtures YAML file.
# This is the same technique used in the +database.yml+ file to specify
# defaults:
#
# DEFAULTS: &DEFAULTS
# created_on: <%= 3.weeks.ago.to_fs(:db) %>
#
# first:
# name: Smurf
# <<: *DEFAULTS
#
# second:
# name: Fraggle
# <<: *DEFAULTS
#
# Any fixture labeled "DEFAULTS" is safely ignored.
#
# Besides using "DEFAULTS", you can also specify what fixtures will
# be ignored by setting "ignore" in "_fixture" section.
#
# # users.yml
# _fixture:
# ignore:
# - base
# # or use "ignore: base" when there is only one fixture that needs to be ignored.
#
# base: &base
# admin: false
# introduction: "This is a default description"
#
# admin:
# <<: *base
# admin: true
#
# visitor:
# <<: *base
#
# In the above example, 'base' will be ignored when creating fixtures.
# This can be used for common attributes inheriting.
#
# == Composite Primary Key Fixtures
#
# Fixtures for composite primary key tables are fairly similar to normal tables.
# When using an id column, the column may be omitted as usual:
#
# # app/models/book.rb
# class Book < ApplicationRecord
# self.primary_key = [:author_id, :id]
# belongs_to :author
# end
#
#
#
# # books.yml
# alices_adventure_in_wonderland:
# author_id: <%= ActiveRecord::FixtureSet.identify(:lewis_carroll) %>
# title: "Alice's Adventures in Wonderland"
#
# However, in order to support composite primary key relationships,
# you must use the `composite_identify` method:
#
# # app/models/book_orders.rb
# class BookOrder < ApplicationRecord
# self.primary_key = [:shop_id, :id]
# belongs_to :order, query_constraints: [:shop_id, :order_id]
# belongs_to :book, query_constraints: [:author_id, :book_id]
# end
#
#
#
# # book_orders.yml
# alices_adventure_in_wonderland_in_books:
# author: lewis_carroll
# book_id: <%= ActiveRecord::FixtureSet.composite_identify(
# :alices_adventure_in_wonderland, Book.primary_key)[:id] %>
# shop: book_store
# order_id: <%= ActiveRecord::FixtureSet.composite_identify(
# :books, Order.primary_key)[:id] %>
#
# == Configure the fixture model class
#
# It's possible to set the fixture's model class directly in the YAML file.
# This is helpful when fixtures are loaded outside tests and
# +set_fixture_class+ is not available (e.g.
# when running bin/rails db:fixtures:load).
#
# _fixture:
# model_class: User
# david:
# name: David
#
# Any fixtures labeled "_fixture" are safely ignored.
#
# source://activerecord//lib/active_record/fixtures.rb#523
class ActiveRecord::FixtureSet
# @return [FixtureSet] a new instance of FixtureSet
#
# source://activerecord//lib/active_record/fixtures.rb#709
def initialize(_, name, class_name, path, config = T.unsafe(nil)); end
# source://activerecord//lib/active_record/fixtures.rb#720
def [](x); end
# source://activerecord//lib/active_record/fixtures.rb#724
def []=(k, v); end
# source://activerecord//lib/active_record/fixtures.rb#537
def all_loaded_fixtures; end
# source://activerecord//lib/active_record/fixtures.rb#537
def all_loaded_fixtures=(val); end
# Returns the value of attribute config.
#
# source://activerecord//lib/active_record/fixtures.rb#707
def config; end
# source://activerecord//lib/active_record/fixtures.rb#728
def each(&block); end
# Returns the value of attribute fixtures.
#
# source://activerecord//lib/active_record/fixtures.rb#707
def fixtures; end
# Returns the value of attribute ignored_fixtures.
#
# source://activerecord//lib/active_record/fixtures.rb#707
def ignored_fixtures; end
# Returns the value of attribute model_class.
#
# source://activerecord//lib/active_record/fixtures.rb#707
def model_class; end
# Returns the value of attribute name.
#
# source://activerecord//lib/active_record/fixtures.rb#707
def name; end
# source://activerecord//lib/active_record/fixtures.rb#732
def size; end
# Returns the value of attribute table_name.
#
# source://activerecord//lib/active_record/fixtures.rb#707
def table_name; end
# Returns a hash of rows to be inserted. The key is the table, the value is
# a list of rows to insert to that table.
#
# source://activerecord//lib/active_record/fixtures.rb#738
def table_rows; end
private
# source://activerecord//lib/active_record/fixtures.rb#796
def default_fixture_model_class; end
# source://activerecord//lib/active_record/fixtures.rb#758
def ignored_fixtures=(base); end
# source://activerecord//lib/active_record/fixtures.rb#750
def model_class=(class_name); end
# Loads the fixtures from the YAML file at +path+.
# If the file sets the +model_class+ and current instance value is not set,
# it uses the file value.
#
# @raise [ArgumentError]
#
# source://activerecord//lib/active_record/fixtures.rb#777
def read_fixture_files(path); end
class << self
# source://activerecord//lib/active_record/fixtures.rb#537
def all_loaded_fixtures; end
# source://activerecord//lib/active_record/fixtures.rb#537
def all_loaded_fixtures=(val); end
# source://activerecord//lib/active_record/fixtures.rb#572
def cache_fixtures(connection, fixtures_map); end
# source://activerecord//lib/active_record/fixtures.rb#556
def cache_for_connection(connection); end
# source://activerecord//lib/active_record/fixtures.rb#564
def cached_fixtures(connection, keys_to_fetch = T.unsafe(nil)); end
# Returns a consistent, platform-independent hash representing a mapping
# between the label and the subcomponents of the provided composite key.
#
# Example:
#
# composite_identify("label", [:a, :b, :c]) # => { a: hash_1, b: hash_2, c: hash_3 }
#
# source://activerecord//lib/active_record/fixtures.rb#631
def composite_identify(label, key); end
# Superclass for the evaluation contexts used by \ERB fixtures.
#
# source://activerecord//lib/active_record/fixtures.rb#639
def context_class; end
# source://activerecord//lib/active_record/fixtures.rb#591
def create_fixtures(fixtures_directories, fixture_set_names, class_names = T.unsafe(nil), config = T.unsafe(nil), &block); end
# source://activerecord//lib/active_record/fixtures.rb#540
def default_fixture_model_name(fixture_set_name, config = T.unsafe(nil)); end
# source://activerecord//lib/active_record/fixtures.rb#546
def default_fixture_table_name(fixture_set_name, config = T.unsafe(nil)); end
# @return [Boolean]
#
# source://activerecord//lib/active_record/fixtures.rb#560
def fixture_is_cached?(connection, table_name); end
# Returns a consistent, platform-independent identifier for +label+.
#
# \Integer identifiers are values less than 2^30. UUIDs are RFC 4122 version 5 SHA-1 hashes.
#
# source://activerecord//lib/active_record/fixtures.rb#617
def identify(label, column_type = T.unsafe(nil)); end
# source://activerecord//lib/active_record/fixtures.rb#585
def instantiate_all_loaded_fixtures(object, load_instances = T.unsafe(nil)); end
# source://activerecord//lib/active_record/fixtures.rb#576
def instantiate_fixtures(object, fixture_set, load_instances = T.unsafe(nil)); end
# source://activerecord//lib/active_record/fixtures.rb#552
def reset_cache; end
private
# source://activerecord//lib/active_record/fixtures.rb#692
def check_all_foreign_keys_valid!(conn); end
# source://activerecord//lib/active_record/fixtures.rb#663
def insert(fixture_sets, connection); end
# source://activerecord//lib/active_record/fixtures.rb#644
def read_and_insert(fixtures_directories, fixture_files, class_names, connection); end
# source://activerecord//lib/active_record/fixtures.rb#702
def update_all_loaded_fixtures(fixtures_map); end
end
end
# source://activerecord//lib/active_record/fixture_set/file.rb#7
class ActiveRecord::FixtureSet::File
include ::Enumerable
# @return [File] a new instance of File
#
# source://activerecord//lib/active_record/fixture_set/file.rb#19
def initialize(file); end
# source://activerecord//lib/active_record/fixture_set/file.rb#23
def each(&block); end
# source://activerecord//lib/active_record/fixture_set/file.rb#31
def ignored_fixtures; end
# source://activerecord//lib/active_record/fixture_set/file.rb#27
def model_class; end
private
# source://activerecord//lib/active_record/fixture_set/file.rb#40
def config_row; end
# source://activerecord//lib/active_record/fixture_set/file.rb#51
def raw_rows; end
# source://activerecord//lib/active_record/fixture_set/file.rb#36
def rows; end
# Validate our unmarshalled data.
#
# source://activerecord//lib/active_record/fixture_set/file.rb#76
def validate(data); end
# source://activerecord//lib/active_record/fixture_set/file.rb#61
def validate_config_row(data); end
class << self
# Open a fixture file named +file+. When called with a block, the block
# is called with the filehandle and the filehandle is automatically closed
# when the block finishes.
#
# source://activerecord//lib/active_record/fixture_set/file.rb#14
def open(file); end
end
end
# --
# An instance of FixtureSet is normally stored in a single YAML file and
# possibly in a folder with the same name.
# ++
#
# source://activerecord//lib/active_record/fixtures.rb#533
ActiveRecord::FixtureSet::MAX_ID = T.let(T.unsafe(nil), Integer)
# source://activerecord//lib/active_record/fixture_set/model_metadata.rb#5
class ActiveRecord::FixtureSet::ModelMetadata
# @return [ModelMetadata] a new instance of ModelMetadata
#
# source://activerecord//lib/active_record/fixture_set/model_metadata.rb#6
def initialize(model_class); end
# source://activerecord//lib/active_record/fixture_set/model_metadata.rb#29
def column_names; end
# source://activerecord//lib/active_record/fixture_set/model_metadata.rb#18
def column_type(column_name); end
# @return [Boolean]
#
# source://activerecord//lib/active_record/fixture_set/model_metadata.rb#25
def has_column?(column_name); end
# source://activerecord//lib/active_record/fixture_set/model_metadata.rb#37
def inheritance_column_name; end
# source://activerecord//lib/active_record/fixture_set/model_metadata.rb#10
def primary_key_name; end
# source://activerecord//lib/active_record/fixture_set/model_metadata.rb#14
def primary_key_type; end
# source://activerecord//lib/active_record/fixture_set/model_metadata.rb#33
def timestamp_column_names; end
end
# NOTE: This class has to be defined in compact style in
# order for rendering context subclassing to work correctly.
#
# source://activerecord//lib/active_record/fixture_set/render_context.rb#7
class ActiveRecord::FixtureSet::RenderContext
class << self
# source://activerecord//lib/active_record/fixture_set/render_context.rb#8
def create_subclass; end
end
end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#5
class ActiveRecord::FixtureSet::TableRow
# @return [TableRow] a new instance of TableRow
#
# source://activerecord//lib/active_record/fixture_set/table_row.rb#65
def initialize(fixture, table_rows:, label:, now:); end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#73
def to_hash; end
private
# source://activerecord//lib/active_record/fixture_set/table_row.rb#186
def add_join_records(association); end
# @return [Boolean]
#
# source://activerecord//lib/active_record/fixture_set/table_row.rb#136
def column_defined?(col); end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#86
def fill_row_model_attributes; end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#103
def fill_timestamps; end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#127
def generate_composite_primary_key; end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#119
def generate_primary_key; end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#112
def interpolate_label; end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#82
def model_class; end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#78
def model_metadata; end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#95
def reflection_class; end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#140
def resolve_enums; end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#148
def resolve_sti_reflections; end
end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#24
class ActiveRecord::FixtureSet::TableRow::HasManyThroughProxy < ::ActiveRecord::FixtureSet::TableRow::ReflectionProxy
# source://activerecord//lib/active_record/fixture_set/table_row.rb#33
def join_table; end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#29
def lhs_key; end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#25
def rhs_key; end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#37
def timestamp_column_names; end
end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#42
class ActiveRecord::FixtureSet::TableRow::PrimaryKeyError < ::StandardError
# @return [PrimaryKeyError] a new instance of PrimaryKeyError
#
# source://activerecord//lib/active_record/fixture_set/table_row.rb#43
def initialize(label, association, value); end
end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#6
class ActiveRecord::FixtureSet::TableRow::ReflectionProxy
# @return [ReflectionProxy] a new instance of ReflectionProxy
#
# source://activerecord//lib/active_record/fixture_set/table_row.rb#7
def initialize(association); end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#11
def join_table; end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#15
def name; end
# source://activerecord//lib/active_record/fixture_set/table_row.rb#19
def primary_key_type; end
end
# source://activerecord//lib/active_record/fixture_set/table_rows.rb#8
class ActiveRecord::FixtureSet::TableRows
# @return [TableRows] a new instance of TableRows
#
# source://activerecord//lib/active_record/fixture_set/table_rows.rb#9
def initialize(table_name, model_class:, fixtures:); end
# Returns the value of attribute model_class.
#
# source://activerecord//lib/active_record/fixture_set/table_rows.rb#21
def model_class; end
# source://activerecord//lib/active_record/fixture_set/table_rows.rb#27
def model_metadata; end
# Returns the value of attribute tables.
#
# source://activerecord//lib/active_record/fixture_set/table_rows.rb#21
def tables; end
# source://activerecord//lib/active_record/fixture_set/table_rows.rb#23
def to_hash; end
private
# source://activerecord//lib/active_record/fixture_set/table_rows.rb#32
def build_table_rows_from(table_name, fixtures); end
end
# source://activerecord//lib/active_record/future_result.rb#4
class ActiveRecord::FutureResult
# @return [FutureResult] a new instance of FutureResult
#
# source://activerecord//lib/active_record/future_result.rb#55
def initialize(pool, *args, **kwargs); end
# source://activerecord//lib/active_record/future_result.rb#83
def cancel; end
# @return [Boolean]
#
# source://activerecord//lib/active_record/future_result.rb#124
def canceled?; end
# source://activerecord//lib/active_record/future_result.rb#50
def empty?(*_arg0, **_arg1, &_arg2); end
# source://activerecord//lib/active_record/future_result.rb#79
def execute!(connection); end
# source://activerecord//lib/active_record/future_result.rb#89
def execute_or_skip; end
# Returns the value of attribute lock_wait.
#
# source://activerecord//lib/active_record/future_result.rb#53
def lock_wait; end
# source://activesupport/7.1.3.3/lib/active_support/core_ext/module/delegation.rb#331
def method_missing(method, *args, **_arg2, &block); end
# @return [Boolean]
#
# source://activerecord//lib/active_record/future_result.rb#120
def pending?; end
# source://activerecord//lib/active_record/future_result.rb#107
def result; end
# source://activerecord//lib/active_record/future_result.rb#74
def schedule!(session); end
# source://activerecord//lib/active_record/future_result.rb#70
def then(&block); end
# source://activerecord//lib/active_record/future_result.rb#50
def to_a(*_arg0, **_arg1, &_arg2); end
private
# source://activerecord//lib/active_record/future_result.rb#152
def exec_query(connection, *args, **kwargs); end
# source://activerecord//lib/active_record/future_result.rb#129
def execute_or_wait; end
# source://activerecord//lib/active_record/future_result.rb#144
def execute_query(connection, async: T.unsafe(nil)); end
# source://activesupport/7.1.3.3/lib/active_support/core_ext/module/delegation.rb#323
def respond_to_missing?(name, include_private = T.unsafe(nil)); end
end
# source://activerecord//lib/active_record/future_result.rb#48
class ActiveRecord::FutureResult::Canceled < ::ActiveRecord::ActiveRecordError; end
# source://activerecord//lib/active_record/future_result.rb#5
class ActiveRecord::FutureResult::Complete
# @return [Complete] a new instance of Complete
#
# source://activerecord//lib/active_record/future_result.rb#9
def initialize(result); end
# @return [Boolean]
#
# source://activerecord//lib/active_record/future_result.rb#17
def canceled?; end
# source://activerecord//lib/active_record/future_result.rb#7
def empty?(*_arg0, **_arg1, &_arg2); end
# @return [Boolean]
#
# source://activerecord//lib/active_record/future_result.rb#13
def pending?; end
# Returns the value of attribute result.
#
# source://activerecord//lib/active_record/future_result.rb#6
def result; end
# source://activerecord//lib/active_record/future_result.rb#21
def then(&block); end
# source://activerecord//lib/active_record/future_result.rb#7
def to_a(*_arg0, **_arg1, &_arg2); end
end
# source://activerecord//lib/active_record/future_result.rb#26
class ActiveRecord::FutureResult::EventBuffer
# @return [EventBuffer] a new instance of EventBuffer
#
# source://activerecord//lib/active_record/future_result.rb#27
def initialize(future_result, instrumenter); end
# source://activerecord//lib/active_record/future_result.rb#39
def flush; end
# source://activerecord//lib/active_record/future_result.rb#33
def instrument(name, payload = T.unsafe(nil), &block); end
end
# source://activerecord//lib/active_record/future_result.rb#156
class ActiveRecord::FutureResult::SelectAll < ::ActiveRecord::FutureResult
private
# source://activerecord//lib/active_record/future_result.rb#158
def exec_query(*_arg0, **_arg1); end
end
# source://activerecord//lib/rails/generators/active_record/migration.rb#6
module ActiveRecord::Generators; end
# source://activerecord//lib/rails/generators/active_record.rb#10
class ActiveRecord::Generators::Base < ::Rails::Generators::NamedBase
include ::Rails::Generators::Migration
include ::ActiveRecord::Generators::Migration
extend ::Rails::Generators::Migration::ClassMethods
extend ::ActiveRecord::Generators::Migration::ClassMethods
class << self
# Set the current directory as base for the inherited generators.
#
# source://activerecord//lib/rails/generators/active_record.rb#14
def base_root; end
end
end
# source://activerecord//lib/rails/generators/active_record/migration.rb#7
module ActiveRecord::Generators::Migration
extend ::ActiveSupport::Concern
include ::Rails::Generators::Migration
mixes_in_class_methods ::Rails::Generators::Migration::ClassMethods
mixes_in_class_methods ::ActiveRecord::Generators::Migration::ClassMethods
private
# source://activerecord//lib/rails/generators/active_record/migration.rb#42
def configured_migrate_path; end
# source://activerecord//lib/rails/generators/active_record/migration.rb#30
def db_migrate_path; end
# source://activerecord//lib/rails/generators/active_record/migration.rb#38
def default_migrate_path; end
# source://activerecord//lib/rails/generators/active_record/migration.rb#25
def foreign_key_type; end
# source://activerecord//lib/rails/generators/active_record/migration.rb#20
def primary_key_type; end
end
# source://activerecord//lib/rails/generators/active_record/migration.rb#11
module ActiveRecord::Generators::Migration::ClassMethods
# Implement the required interface for Rails::Generators::Migration.
#
# source://activerecord//lib/rails/generators/active_record/migration.rb#13
def next_migration_number(dirname); end
end
# source://activerecord//lib/active_record/associations.rb#74
class ActiveRecord::HasManyThroughAssociationNotFoundError < ::ActiveRecord::ActiveRecordError
include ::DidYouMean::Correctable
# @return [HasManyThroughAssociationNotFoundError] a new instance of HasManyThroughAssociationNotFoundError
#
# source://activerecord//lib/active_record/associations.rb#77
def initialize(owner_class = T.unsafe(nil), reflection = T.unsafe(nil)); end
# source://activerecord//lib/active_record/associations.rb#90
def corrections; end
# Returns the value of attribute owner_class.
#
# source://activerecord//lib/active_record/associations.rb#75
def owner_class; end
# Returns the value of attribute reflection.
#
# source://activerecord//lib/active_record/associations.rb#75
def reflection; end
end
# source://activerecord//lib/active_record/associations.rb#124
class ActiveRecord::HasManyThroughAssociationPointlessSourceTypeError < ::ActiveRecord::ActiveRecordError
# @return [HasManyThroughAssociationPointlessSourceTypeError] a new instance of HasManyThroughAssociationPointlessSourceTypeError
#
# source://activerecord//lib/active_record/associations.rb#125
def initialize(owner_class_name = T.unsafe(nil), reflection = T.unsafe(nil), source_reflection = T.unsafe(nil)); end
end
# source://activerecord//lib/active_record/associations.rb#104
class ActiveRecord::HasManyThroughAssociationPolymorphicSourceError < ::ActiveRecord::ActiveRecordError
# @return [HasManyThroughAssociationPolymorphicSourceError] a new instance of HasManyThroughAssociationPolymorphicSourceError
#
# source://activerecord//lib/active_record/associations.rb#105
def initialize(owner_class_name = T.unsafe(nil), reflection = T.unsafe(nil), source_reflection = T.unsafe(nil)); end
end
# source://activerecord//lib/active_record/associations.rb#114
class ActiveRecord::HasManyThroughAssociationPolymorphicThroughError < ::ActiveRecord::ActiveRecordError
# @return [HasManyThroughAssociationPolymorphicThroughError] a new instance of HasManyThroughAssociationPolymorphicThroughError
#
# source://activerecord//lib/active_record/associations.rb#115
def initialize(owner_class_name = T.unsafe(nil), reflection = T.unsafe(nil)); end
end
# source://activerecord//lib/active_record/associations.rb#218
class ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection < ::ActiveRecord::ThroughCantAssociateThroughHasOneOrManyReflection; end
# source://activerecord//lib/active_record/associations.rb#234
class ActiveRecord::HasManyThroughNestedAssociationsAreReadonly < ::ActiveRecord::ThroughNestedAssociationsAreReadonly; end
# source://activerecord//lib/active_record/associations.rb#167
class ActiveRecord::HasManyThroughOrderError < ::ActiveRecord::ActiveRecordError
# @return [HasManyThroughOrderError] a new instance of HasManyThroughOrderError
#
# source://activerecord//lib/active_record/associations.rb#168
def initialize(owner_class_name = T.unsafe(nil), reflection = T.unsafe(nil), through_reflection = T.unsafe(nil)); end
end
# source://activerecord//lib/active_record/associations.rb#154
class ActiveRecord::HasManyThroughSourceAssociationNotFoundError < ::ActiveRecord::ActiveRecordError
# @return [HasManyThroughSourceAssociationNotFoundError] a new instance of HasManyThroughSourceAssociationNotFoundError
#
# source://activerecord//lib/active_record/associations.rb#155
def initialize(reflection = T.unsafe(nil)); end
end
# source://activerecord//lib/active_record/associations.rb#144
class ActiveRecord::HasOneAssociationPolymorphicThroughError < ::ActiveRecord::ActiveRecordError
# @return [HasOneAssociationPolymorphicThroughError] a new instance of HasOneAssociationPolymorphicThroughError
#
# source://activerecord//lib/active_record/associations.rb#145
def initialize(owner_class_name = T.unsafe(nil), reflection = T.unsafe(nil)); end
end
# source://activerecord//lib/active_record/associations.rb#134
class ActiveRecord::HasOneThroughCantAssociateThroughCollection < ::ActiveRecord::ActiveRecordError
# @return [HasOneThroughCantAssociateThroughCollection] a new instance of HasOneThroughCantAssociateThroughCollection
#
# source://activerecord//lib/active_record/associations.rb#135
def initialize(owner_class_name = T.unsafe(nil), reflection = T.unsafe(nil), through_reflection = T.unsafe(nil)); end
end
# source://activerecord//lib/active_record/associations.rb#221
class ActiveRecord::HasOneThroughCantAssociateThroughHasOneOrManyReflection < ::ActiveRecord::ThroughCantAssociateThroughHasOneOrManyReflection; end
# source://activerecord//lib/active_record/associations.rb#237
class ActiveRecord::HasOneThroughNestedAssociationsAreReadonly < ::ActiveRecord::ThroughNestedAssociationsAreReadonly; end
# source://activerecord//lib/active_record/migration.rb#124
class ActiveRecord::IllegalMigrationNameError < ::ActiveRecord::MigrationError
# @return [IllegalMigrationNameError] a new instance of IllegalMigrationNameError
#
# source://activerecord//lib/active_record/migration.rb#125
def initialize(name = T.unsafe(nil)); end
end
# Raised when a relation cannot be mutated because it's already loaded.
#
# class Task < ActiveRecord::Base
# end
#
# relation = Task.all
# relation.loaded? # => true
#
# # Methods which try to mutate a loaded relation fail.
# relation.where!(title: 'TODO') # => ActiveRecord::ImmutableRelation
# relation.limit!(5) # => ActiveRecord::ImmutableRelation
#
# source://activerecord//lib/active_record/errors.rb#471
class ActiveRecord::ImmutableRelation < ::ActiveRecord::ActiveRecordError; end
# = Single table inheritance
#
# Active Record allows inheritance by storing the name of the class in a column that by
# default is named "type" (can be changed by overwriting Base.inheritance_column).
# This means that an inheritance looking like this:
#
# class Company < ActiveRecord::Base; end
# class Firm < Company; end
# class Client < Company; end
# class PriorityClient < Client; end
#
# When you do Firm.create(name: "37signals"), this record will be saved in
# the companies table with type = "Firm". You can then fetch this row again using
# Company.where(name: '37signals').first and it will return a Firm object.
#
# Be aware that because the type column is an attribute on the record every new
# subclass will instantly be marked as dirty and the type column will be included
# in the list of changed attributes on the record. This is different from non
# Single Table Inheritance(STI) classes:
#
# Company.new.changed? # => false
# Firm.new.changed? # => true
# Firm.new.changes # => {"type"=>["","Firm"]}
#
# If you don't have a type column defined in your table, single-table inheritance won't
# be triggered. In that case, it'll work just like normal subclasses with no special magic
# for differentiating between them or reloading the right type with find.
#
# Note, all the attributes for all the cases are kept in the same table.
# Read more:
# * https://www.martinfowler.com/eaaCatalog/singleTableInheritance.html
#
# source://activerecord//lib/active_record/inheritance.rb#39
module ActiveRecord::Inheritance
extend ::ActiveSupport::Concern
include GeneratedInstanceMethods
mixes_in_class_methods GeneratedClassMethods
private
# Sets the attribute used for single table inheritance to this class name if this is not the
# ActiveRecord::Base descendant.
# Considering the hierarchy Reply < Message < ActiveRecord::Base, this makes it possible to
# do Reply.new without having to set Reply[Reply.inheritance_column] = "Reply" yourself.
# No such attribute would be set for objects of the Message class in that example.
#
# source://activerecord//lib/active_record/inheritance.rb#357
def ensure_proper_type; end
# source://activerecord//lib/active_record/inheritance.rb#341
def initialize_dup(other); end
# source://activerecord//lib/active_record/inheritance.rb#347
def initialize_internals_callback; end
module GeneratedClassMethods
def store_full_class_name; end
def store_full_class_name=(value); end
def store_full_class_name?; end
def store_full_sti_class; end
def store_full_sti_class=(value); end
def store_full_sti_class?; end
end
module GeneratedInstanceMethods
def store_full_class_name; end
def store_full_class_name?; end
def store_full_sti_class; end
def store_full_sti_class?; end
end
end
# source://activerecord//lib/active_record/inheritance.rb#52
module ActiveRecord::Inheritance::ClassMethods
# Set this to +true+ if this is an abstract class (see
# abstract_class?).
# If you are using inheritance with Active Record and don't want a class
# to be considered as part of the STI hierarchy, you must set this to
# true.
# +ApplicationRecord+, for example, is generated as an abstract class.
#
# Consider the following default behavior:
#
# Shape = Class.new(ActiveRecord::Base)
# Polygon = Class.new(Shape)
# Square = Class.new(Polygon)
#
# Shape.table_name # => "shapes"
# Polygon.table_name # => "shapes"
# Square.table_name # => "shapes"
# Shape.create! # => #optional: true
.
# This can be used, for example, when conditionally validating the presence
# of the parent model:
#
# class Veterinarian < ActiveRecord::Base
# has_many :patients, inverse_of: :veterinarian
# accepts_nested_attributes_for :patients
# end
#
# class Patient < ActiveRecord::Base
# belongs_to :veterinarian, inverse_of: :patients, optional: true
# validates :veterinarian, presence: true, unless: -> { awaiting_intake }
# end
#
# Note that if you do not specify the +:inverse_of+ option, then
# Active Record will try to automatically guess the inverse association
# based on heuristics.
#
# For one-to-one nested associations, if you build the new (in-memory)
# child object yourself before assignment, then this module will not
# overwrite it, e.g.:
#
# class Member < ActiveRecord::Base
# has_one :avatar
# accepts_nested_attributes_for :avatar
#
# def avatar
# super || build_avatar(width: 200)
# end
# end
#
# member = Member.new
# member.avatar_attributes = {icon: 'sad'}
# member.avatar.width # => 200
#
# === Creating forms with nested attributes
#
# Use ActionView::Helpers::FormHelper#fields_for to create form elements for
# nested attributes.
#
# Integration test params should reflect the structure of the form. For
# example:
#
# post members_path, params: {
# member: {
# name: 'joe',
# posts_attributes: {
# '0' => { title: 'Foo' },
# '1' => { title: 'Bar' }
# }
# }
# }
#
# source://activerecord//lib/active_record/nested_attributes.rb#301
module ActiveRecord::NestedAttributes::ClassMethods
# Defines an attributes writer for the specified association(s).
#
# Supported options:
# [:allow_destroy]
# If true, destroys any members from the attributes hash with a
# _destroy key and a value that evaluates to +true+
# (e.g. 1, '1', true, or 'true'). This option is false by default.
# [:reject_if]
# Allows you to specify a Proc or a Symbol pointing to a method
# that checks whether a record should be built for a certain attribute
# hash. The hash is passed to the supplied Proc or the method
# and it should return either +true+ or +false+. When no +:reject_if+
# is specified, a record will be built for all attribute hashes that
# do not have a _destroy value that evaluates to true.
# Passing :all_blank instead of a Proc will create a proc
# that will reject a record where all the attributes are blank excluding
# any value for +_destroy+.
# [:limit]
# Allows you to specify the maximum number of associated records that
# can be processed with the nested attributes. Limit also can be specified
# as a Proc or a Symbol pointing to a method that should return a number.
# If the size of the nested attributes array exceeds the specified limit,
# NestedAttributes::TooManyRecords exception is raised. If omitted, any
# number of associations can be processed.
# Note that the +:limit+ option is only applicable to one-to-many
# associations.
# [:update_only]
# For a one-to-one association, this option allows you to specify how
# nested attributes are going to be used when an associated record already
# exists. In general, an existing record may either be updated with the
# new set of attribute values or be replaced by a wholly new record
# containing those values. By default the +:update_only+ option is false
# and the nested attributes are used to update the existing record only
# if they include the record's :id value. Otherwise a new
# record will be instantiated and used to replace the existing one.
# However if the +:update_only+ option is true, the nested attributes
# are used to update the record's attributes always, regardless of
# whether the :id is present. The option is ignored for collection
# associations.
#
# Examples:
# # creates avatar_attributes=
# accepts_nested_attributes_for :avatar, reject_if: proc { |attributes| attributes['name'].blank? }
# # creates avatar_attributes=
# accepts_nested_attributes_for :avatar, reject_if: :all_blank
# # creates avatar_attributes= and posts_attributes=
# accepts_nested_attributes_for :avatar, :posts, allow_destroy: true
#
# source://activerecord//lib/active_record/nested_attributes.rb#351
def accepts_nested_attributes_for(*attr_names); end
private
# Generates a writer method for this association. Serves as a point for
# accessing the objects in the association. For example, this method
# could generate the following:
#
# def pirate_attributes=(attributes)
# assign_nested_attributes_for_one_to_one_association(:pirate, attributes)
# end
#
# This redirects the attempts to write objects in an association through
# the helper methods defined below. Makes it seem like the nested
# associations are just regular associations.
#
# source://activerecord//lib/active_record/nested_attributes.rb#386
def generate_association_writer(association_name, type); end
end
# source://activerecord//lib/active_record/nested_attributes.rb#302
ActiveRecord::NestedAttributes::ClassMethods::REJECT_ALL_BLANK_PROC = T.let(T.unsafe(nil), Proc)
# source://activerecord//lib/active_record/nested_attributes.rb#9
class ActiveRecord::NestedAttributes::TooManyRecords < ::ActiveRecord::ActiveRecordError; end
# Attribute hash keys that should not be assigned as normal attributes.
# These hash keys are nested attributes implementation details.
#
# source://activerecord//lib/active_record/nested_attributes.rb#408
ActiveRecord::NestedAttributes::UNASSIGNABLE_KEYS = T.let(T.unsafe(nil), Array)
# Raised when a given database does not exist.
#
# source://activerecord//lib/active_record/errors.rb#307
class ActiveRecord::NoDatabaseError < ::ActiveRecord::StatementInvalid
include ::ActiveSupport::ActionableError
extend ::ActiveSupport::ActionableError::ClassMethods
# @return [NoDatabaseError] a new instance of NoDatabaseError
#
# source://activerecord//lib/active_record/errors.rb#314
def initialize(message = T.unsafe(nil), connection_pool: T.unsafe(nil)); end
# source://activesupport/7.1.3.3/lib/active_support/actionable_error.rb#17
def _actions; end
# source://activesupport/7.1.3.3/lib/active_support/actionable_error.rb#17
def _actions=(_arg0); end
# source://activesupport/7.1.3.3/lib/active_support/actionable_error.rb#17
def _actions?; end
class << self
# source://activesupport/7.1.3.3/lib/active_support/actionable_error.rb#17
def _actions; end
# source://activesupport/7.1.3.3/lib/active_support/actionable_error.rb#17
def _actions=(value); end
# source://activesupport/7.1.3.3/lib/active_support/actionable_error.rb#17
def _actions?; end
# source://activerecord//lib/active_record/errors.rb#319
def db_error(db_name); end
end
end
# source://activerecord//lib/active_record/migration.rb#184
class ActiveRecord::NoEnvironmentInSchemaError < ::ActiveRecord::MigrationError
# @return [NoEnvironmentInSchemaError] a new instance of NoEnvironmentInSchemaError
#
# source://activerecord//lib/active_record/migration.rb#185
def initialize; end
end
# = Active Record No Touching
#
# source://activerecord//lib/active_record/no_touching.rb#5
module ActiveRecord::NoTouching
extend ::ActiveSupport::Concern
mixes_in_class_methods ::ActiveRecord::NoTouching::ClassMethods
# Returns +true+ if the class has +no_touching+ set, +false+ otherwise.
#
# Project.no_touching do
# Project.first.no_touching? # true
# Message.first.no_touching? # false
# end
#
# @return [Boolean]
#
# source://activerecord//lib/active_record/no_touching.rb#53
def no_touching?; end
# source://activerecord//lib/active_record/no_touching.rb#61
def touch(*_arg0, **_arg1); end
# source://activerecord//lib/active_record/no_touching.rb#57
def touch_later(*_arg0); end
class << self
# @return [Boolean]
#
# source://activerecord//lib/active_record/no_touching.rb#36
def applied_to?(klass); end
# source://activerecord//lib/active_record/no_touching.rb#29
def apply_to(klass); end
private
# source://activerecord//lib/active_record/no_touching.rb#41
def klasses; end
end
end
# source://activerecord//lib/active_record/no_touching.rb#8
module ActiveRecord::NoTouching::ClassMethods
# Lets you selectively disable calls to +touch+ for the
# duration of a block.
#
# ==== Examples
# ActiveRecord::Base.no_touching do
# Project.first.touch # does nothing
# Message.first.touch # does nothing
# end
#
# Project.no_touching do
# Project.first.touch # does nothing
# Message.first.touch # works, but does not touch the associated project
# end
#
# source://activerecord//lib/active_record/no_touching.rb#23
def no_touching(&block); end
end
# source://activerecord//lib/active_record/normalization.rb#4
module ActiveRecord::Normalization
extend ::ActiveSupport::Concern
include GeneratedInstanceMethods
mixes_in_class_methods GeneratedClassMethods
mixes_in_class_methods ::ActiveRecord::Normalization::ClassMethods
# Normalizes a specified attribute using its declared normalizations.
#
# ==== Examples
#
# class User < ActiveRecord::Base
# normalizes :email, with: -> email { email.strip.downcase }
# end
#
# legacy_user = User.find(1)
# legacy_user.email # => " CRUISE-CONTROL@EXAMPLE.COM\n"
# legacy_user.normalize_attribute(:email)
# legacy_user.email # => "cruise-control@example.com"
# legacy_user.save
#
# source://activerecord//lib/active_record/normalization.rb#26
def normalize_attribute(name); end
private
# source://activerecord//lib/active_record/normalization.rb#114
def normalize_changed_in_place_attributes; end
module GeneratedClassMethods
def normalized_attributes; end
def normalized_attributes=(value); end
def normalized_attributes?; end
end
module GeneratedInstanceMethods
def normalized_attributes; end
def normalized_attributes=(value); end
def normalized_attributes?; end
end
end
# source://activerecord//lib/active_record/normalization.rb#31
module ActiveRecord::Normalization::ClassMethods
# Normalizes a given +value+ using normalizations declared for +name+.
#
# ==== Examples
#
# class User < ActiveRecord::Base
# normalizes :email, with: -> email { email.strip.downcase }
# end
#
# User.normalize_value_for(:email, " CRUISE-CONTROL@EXAMPLE.COM\n")
# # => "cruise-control@example.com"
#
# source://activerecord//lib/active_record/normalization.rb#108
def normalize_value_for(name, value); end
# Declares a normalization for one or more attributes. The normalization
# is applied when the attribute is assigned or updated, and the normalized
# value will be persisted to the database. The normalization is also
# applied to the corresponding keyword argument of query methods. This
# allows a record to be created and later queried using unnormalized
# values.
#
# However, to prevent confusion, the normalization will not be applied
# when the attribute is fetched from the database. This means that if a
# record was persisted before the normalization was declared, the record's
# attribute will not be normalized until either it is assigned a new
# value, or it is explicitly migrated via Normalization#normalize_attribute.
#
# Because the normalization may be applied multiple times, it should be
# _idempotent_. In other words, applying the normalization more than once
# should have the same result as applying it only once.
#
# By default, the normalization will not be applied to +nil+ values. This
# behavior can be changed with the +:apply_to_nil+ option.
#
# Be aware that if your app was created before Rails 7.1, and your app
# marshals instances of the targeted model (for example, when caching),
# then you should set ActiveRecord.marshalling_format_version to +7.1+ or
# higher via either config.load_defaults 7.1 or
# config.active_record.marshalling_format_version = 7.1.
# Otherwise, +Marshal+ may attempt to serialize the normalization +Proc+
# and raise +TypeError+.
#
# ==== Options
#
# * +:with+ - Any callable object that accepts the attribute's value as
# its sole argument, and returns it normalized.
# * +:apply_to_nil+ - Whether to apply the normalization to +nil+ values.
# Defaults to +false+.
#
# ==== Examples
#
# class User < ActiveRecord::Base
# normalizes :email, with: -> email { email.strip.downcase }
# normalizes :phone, with: -> phone { phone.delete("^0-9").delete_prefix("1") }
# end
#
# user = User.create(email: " CRUISE-CONTROL@EXAMPLE.COM\n")
# user.email # => "cruise-control@example.com"
#
# user = User.find_by(email: "\tCRUISE-CONTROL@EXAMPLE.COM ")
# user.email # => "cruise-control@example.com"
# user.email_before_type_cast # => "cruise-control@example.com"
#
# User.where(email: "\tCRUISE-CONTROL@EXAMPLE.COM ").count # => 1
# User.where(["email = ?", "\tCRUISE-CONTROL@EXAMPLE.COM "]).count # => 0
#
# User.exists?(email: "\tCRUISE-CONTROL@EXAMPLE.COM ") # => true
# User.exists?(["email = ?", "\tCRUISE-CONTROL@EXAMPLE.COM "]) # => false
#
# User.normalize_value_for(:phone, "+1 (555) 867-5309") # => "5558675309"
#
# source://activerecord//lib/active_record/normalization.rb#88
def normalizes(*names, with:, apply_to_nil: T.unsafe(nil)); end
end
# source://activerecord//lib/active_record/normalization.rb#120
class ActiveRecord::Normalization::NormalizedValueType
include ::ActiveModel::Type::SerializeCastValue
extend ::ActiveModel::Type::SerializeCastValue::ClassMethods
# @return [NormalizedValueType] a new instance of NormalizedValueType
#
# source://activerecord//lib/active_record/normalization.rb#126
def initialize(cast_type:, normalizer:, normalize_nil:); end
# source://activerecord//lib/active_record/normalization.rb#145
def ==(other); end
# source://activerecord//lib/active_record/normalization.rb#133
def cast(value); end
# Returns the value of attribute cast_type.
#
# source://activerecord//lib/active_record/normalization.rb#123
def cast_type; end
# source://activerecord//lib/active_record/normalization.rb#145
def eql?(other); end
# source://activerecord//lib/active_record/normalization.rb#153
def hash; end
# source://activerecord//lib/active_record/normalization.rb#157
def inspect; end
# Returns the value of attribute normalize_nil.
#
# source://activerecord//lib/active_record/normalization.rb#123
def normalize_nil; end
# Returns the value of attribute normalize_nil.
#
# source://activerecord//lib/active_record/normalization.rb#123
def normalize_nil?; end
# Returns the value of attribute normalizer.
#
# source://activerecord//lib/active_record/normalization.rb#123
def normalizer; end
# source://activerecord//lib/active_record/normalization.rb#137
def serialize(value); end
# source://activerecord//lib/active_record/normalization.rb#141
def serialize_cast_value(value); end
private
# source://activerecord//lib/active_record/normalization.rb#162
def normalize(value); end
end
# Raised when a record cannot be inserted or updated because it would violate a not null constraint.
#
# source://activerecord//lib/active_record/errors.rb#272
class ActiveRecord::NotNullViolation < ::ActiveRecord::StatementInvalid; end
# source://activerecord//lib/active_record/migration/pending_migration_connection.rb#4
class ActiveRecord::PendingMigrationConnection
class << self
# source://activerecord//lib/active_record/migration/pending_migration_connection.rb#17
def current_preventing_writes; end
# source://activerecord//lib/active_record/migration/pending_migration_connection.rb#5
def establish_temporary_connection(db_config, &block); end
# @return [Boolean]
#
# source://activerecord//lib/active_record/migration/pending_migration_connection.rb#13
def primary_class?; end
end
end
# source://activerecord//lib/active_record/migration.rb#134
class ActiveRecord::PendingMigrationError < ::ActiveRecord::MigrationError
include ::ActiveSupport::ActionableError
extend ::ActiveSupport::ActionableError::ClassMethods
# @return [PendingMigrationError] a new instance of PendingMigrationError
#
# source://activerecord//lib/active_record/migration.rb#146
def initialize(message = T.unsafe(nil), pending_migrations: T.unsafe(nil)); end
# source://activesupport/7.1.3.3/lib/active_support/actionable_error.rb#17
def _actions; end
# source://activesupport/7.1.3.3/lib/active_support/actionable_error.rb#17
def _actions=(_arg0); end
# source://activesupport/7.1.3.3/lib/active_support/actionable_error.rb#17
def _actions?; end
private
# source://activerecord//lib/active_record/migration.rb#170
def connection; end
# source://activerecord//lib/active_record/migration.rb#156
def detailed_migration_message(pending_migrations); end
class << self
# source://activesupport/7.1.3.3/lib/active_support/actionable_error.rb#17
def _actions; end
# source://activesupport/7.1.3.3/lib/active_support/actionable_error.rb#17
def _actions=(value); end
# source://activesupport/7.1.3.3/lib/active_support/actionable_error.rb#17
def _actions?; end
end
end
# = Active Record \Persistence
#
# source://activerecord//lib/active_record/persistence.rb#7
module ActiveRecord::Persistence
extend ::ActiveSupport::Concern
mixes_in_class_methods ::ActiveRecord::Persistence::ClassMethods
# Returns an instance of the specified +klass+ with the attributes of the
# current record. This is mostly useful in relation to single table
# inheritance (STI) structures where you want a subclass to appear as the
# superclass. This can be used along with record identification in
# Action Pack to allow, say, Client < Company to do something
# like render partial: @client.becomes(Company) to render that
# instance using the companies/company partial instead of clients/client.
#
# Note: The new instance will share a link to the same attributes as the original class.
# Therefore the STI column value will still be the same.
# Any change to the attributes on either instance will affect both instances.
# This includes any attribute initialization done by the new instance.
#
# If you want to change the STI column as well, use #becomes! instead.
#
# source://activerecord//lib/active_record/persistence.rb#814
def becomes(klass); end
# Wrapper around #becomes that also changes the instance's STI column value.
# This is especially useful if you want to persist the changed class in your
# database.
#
# Note: The old instance's STI column value will be changed too, as both objects
# share the same set of attributes.
#
# source://activerecord//lib/active_record/persistence.rb#835
def becomes!(klass); end
# Initializes +attribute+ to zero if +nil+ and subtracts the value passed as +by+ (default is 1).
# The decrement is performed directly on the underlying attribute, no setter is invoked.
# Only makes sense for number-based attributes. Returns +self+.
#
# source://activerecord//lib/active_record/persistence.rb#982
def decrement(attribute, by = T.unsafe(nil)); end
# Wrapper around #decrement that writes the update to the database.
# Only +attribute+ is updated; the record itself is not saved.
# This means that any other modified attributes will still be dirty.
# Validations and callbacks are skipped. Supports the +touch+ option from
# +update_counters+, see that for more.
# Returns +self+.
#
# source://activerecord//lib/active_record/persistence.rb#992
def decrement!(attribute, by = T.unsafe(nil), touch: T.unsafe(nil)); end
# Deletes the record in the database and freezes this instance to
# reflect that no changes should be made (since they can't be
# persisted). Returns the frozen instance.
#
# The row is simply removed with an SQL +DELETE+ statement on the
# record's primary key, and no callbacks are executed.
#
# Note that this will also delete records marked as {#readonly?}[rdoc-ref:Core#readonly?].
#
# To enforce the object's +before_destroy+ and +after_destroy+
# callbacks or any :dependent association
# options, use #destroy.
#
# source://activerecord//lib/active_record/persistence.rb#766
def delete; end
# Deletes the record in the database and freezes this instance to reflect
# that no changes should be made (since they can't be persisted).
#
# There's a series of callbacks associated with #destroy. If the
# before_destroy callback throws +:abort+ the action is cancelled
# and #destroy returns +false+.
# See ActiveRecord::Callbacks for further details.
#
# source://activerecord//lib/active_record/persistence.rb#780
def destroy; end
# Deletes the record in the database and freezes this instance to reflect
# that no changes should be made (since they can't be persisted).
#
# There's a series of callbacks associated with #destroy!. If the
# before_destroy callback throws +:abort+ the action is cancelled
# and #destroy! raises ActiveRecord::RecordNotDestroyed.
# See ActiveRecord::Callbacks for further details.
#
# source://activerecord//lib/active_record/persistence.rb#796
def destroy!; end
# Returns true if this object has been destroyed, otherwise returns false.
#
# @return [Boolean]
#
# source://activerecord//lib/active_record/persistence.rb#682
def destroyed?; end
# Initializes +attribute+ to zero if +nil+ and adds the value passed as +by+ (default is 1).
# The increment is performed directly on the underlying attribute, no setter is invoked.
# Only makes sense for number-based attributes. Returns +self+.
#
# source://activerecord//lib/active_record/persistence.rb#959
def increment(attribute, by = T.unsafe(nil)); end
# Wrapper around #increment that writes the update to the database.
# Only +attribute+ is updated; the record itself is not saved.
# This means that any other modified attributes will still be dirty.
# Validations and callbacks are skipped. Supports the +touch+ option from
# +update_counters+, see that for more.
# Returns +self+.
#
# source://activerecord//lib/active_record/persistence.rb#971
def increment!(attribute, by = T.unsafe(nil), touch: T.unsafe(nil)); end
# Returns true if this object hasn't been saved yet -- that is, a record
# for the object doesn't exist in the database yet; otherwise, returns false.
#
# @return [Boolean]
#
# source://activerecord//lib/active_record/persistence.rb#665
def new_record?; end
# Returns true if the record is persisted, i.e. it's not a new record and it was
# not destroyed, otherwise returns false.
#
# @return [Boolean]
#
# source://activerecord//lib/active_record/persistence.rb#688
def persisted?; end
# Returns true if this object was just created -- that is, prior to the last
# update or delete, the object didn't exist in the database and new_record? would have
# returned true.
#
# @return [Boolean]
#
# source://activerecord//lib/active_record/persistence.rb#672
def previously_new_record?; end
# Returns true if this object was previously persisted but now it has been deleted.
#
# @return [Boolean]
#
# source://activerecord//lib/active_record/persistence.rb#677
def previously_persisted?; end
# Reloads the record from the database.
#
# This method finds the record by its primary key (which could be assigned
# manually) and modifies the receiver in-place:
#
# account = Account.new
# # => #update_columns(name => value)
.
#
# source://activerecord//lib/active_record/persistence.rb#911
def update_column(name, value); end
# Updates the attributes directly in the database issuing an UPDATE SQL
# statement and sets them in the receiver:
#
# user.update_columns(last_request_at: Time.current)
#
# This is the fastest way to update attributes because it goes straight to
# the database, but take into account that in consequence the regular update
# procedures are totally bypassed. In particular:
#
# * \Validations are skipped.
# * \Callbacks are skipped.
# * +updated_at+/+updated_on+ are not updated.
# * However, attributes are serialized with the same rules as ActiveRecord::Relation#update_all
#
# This method raises an ActiveRecord::ActiveRecordError when called on new
# objects, or when at least one of the attributes is marked as readonly.
#
# @raise [ActiveRecordError]
#
# source://activerecord//lib/active_record/persistence.rb#931
def update_columns(attributes); end
private
# Creates a record with values matching those of the instance attributes
# and returns its id.
#
# @yield [_self]
# @yieldparam _self [ActiveRecord::Persistence] the object that the method was called on
#
# source://activerecord//lib/active_record/persistence.rb#1247
def _create_record(attribute_names = T.unsafe(nil)); end
# source://activerecord//lib/active_record/persistence.rb#1197
def _delete_row; end
# source://activerecord//lib/active_record/persistence.rb#1153
def _find_record(options); end
# source://activerecord//lib/active_record/persistence.rb#1164
def _in_memory_query_constraints_hash; end
# source://activerecord//lib/active_record/persistence.rb#1179
def _query_constraints_hash; end
# @raise [ReadOnlyRecord]
#
# source://activerecord//lib/active_record/persistence.rb#1281
def _raise_readonly_record_error; end
# source://activerecord//lib/active_record/persistence.rb#1273
def _raise_record_not_destroyed; end
# @raise [ActiveRecordError]
#
# source://activerecord//lib/active_record/persistence.rb#1285
def _raise_record_not_touched_error; end
# source://activerecord//lib/active_record/persistence.rb#1201
def _touch_row(attribute_names, time); end
# Updates the associated record with values matching those of the instance attributes.
# Returns the number of affected rows.
#
# @yield [_self]
# @yieldparam _self [ActiveRecord::Persistence] the object that the method was called on
#
# source://activerecord//lib/active_record/persistence.rb#1227
def _update_record(attribute_names = T.unsafe(nil)); end
# source://activerecord//lib/active_record/persistence.rb#1211
def _update_row(attribute_names, attempted_action = T.unsafe(nil)); end
# @return [Boolean]
#
# source://activerecord//lib/active_record/persistence.rb#1174
def apply_scoping?(options); end
# source://activerecord//lib/active_record/persistence.rb#1218
def create_or_update(**_arg0, &block); end
# A hook to be overridden by association modules.
#
# source://activerecord//lib/active_record/persistence.rb#1190
def destroy_associations; end
# source://activerecord//lib/active_record/persistence.rb#1193
def destroy_row; end
# source://activerecord//lib/active_record/persistence.rb#1141
def init_internals; end
# source://activerecord//lib/active_record/persistence.rb#1147
def strict_loaded_associations; end
# @raise [ActiveRecordError]
#
# source://activerecord//lib/active_record/persistence.rb#1269
def verify_readonly_attribute(name); end
end
# source://activerecord//lib/active_record/persistence.rb#10
module ActiveRecord::Persistence::ClassMethods
# source://activerecord//lib/active_record/persistence.rb#611
def _delete_record(constraints); end
# source://activerecord//lib/active_record/persistence.rb#569
def _insert_record(values, returning); end
# source://activerecord//lib/active_record/persistence.rb#594
def _update_record(values, constraints); end
# Builds an object (or multiple objects) and returns either the built object or a list of built
# objects.
#
# The +attributes+ parameter can be either a Hash or an Array of Hashes. These Hashes describe the
# attributes on the objects that are to be built.
#
# ==== Examples
# # Build a single new object
# User.build(first_name: 'Jamie')
#
# # Build an Array of new objects
# User.build([{ first_name: 'Jamie' }, { first_name: 'Jeremy' }])
#
# # Build a single object and pass it into a block to set other attributes.
# User.build(first_name: 'Jamie') do |u|
# u.is_admin = false
# end
#
# # Building an Array of new objects using a block, where the block is executed for each object:
# User.build([{ first_name: 'Jamie' }, { first_name: 'Jeremy' }]) do |u|
# u.is_admin = false
# end
#
# source://activerecord//lib/active_record/persistence.rb#82
def build(attributes = T.unsafe(nil), &block); end
# Returns an array of column names to be used in queries. The source of column
# names is derived from +query_constraints_list+ or +primary_key+. This method
# is for internal use when the primary key is to be treated as an array.
#
# source://activerecord//lib/active_record/persistence.rb#510
def composite_query_constraints_list; end
# Creates an object (or multiple objects) and saves it to the database, if validations pass.
# The resulting object is returned whether the object was saved successfully to the database or not.
#
# The +attributes+ parameter can be either a Hash or an Array of Hashes. These Hashes describe the
# attributes on the objects that are to be created.
#
# ==== Examples
# # Create a single new object
# User.create(first_name: 'Jamie')
#
# # Create an Array of new objects
# User.create([{ first_name: 'Jamie' }, { first_name: 'Jeremy' }])
#
# # Create a single object and pass it into a block to set other attributes.
# User.create(first_name: 'Jamie') do |u|
# u.is_admin = false
# end
#
# # Creating an Array of new objects using a block, where the block is executed for each object:
# User.create([{ first_name: 'Jamie' }, { first_name: 'Jeremy' }]) do |u|
# u.is_admin = false
# end
#
# source://activerecord//lib/active_record/persistence.rb#33
def create(attributes = T.unsafe(nil), &block); end
# Creates an object (or multiple objects) and saves it to the database,
# if validations pass. Raises a RecordInvalid error if validations fail,
# unlike Base#create.
#
# The +attributes+ parameter can be either a Hash or an Array of Hashes.
# These describe which attributes to be created on the object, or
# multiple objects when given an Array of Hashes.
#
# source://activerecord//lib/active_record/persistence.rb#50
def create!(attributes = T.unsafe(nil), &block); end
# Deletes the row with a primary key matching the +id+ argument, using an
# SQL +DELETE+ statement, and returns the number of rows deleted. Active
# Record objects are not instantiated, so the object's callbacks are not
# executed, including any :dependent association options.
#
# You can delete multiple rows at once by passing an Array of ids.
#
# Note: Although it is often much faster than the alternative, #destroy,
# skipping callbacks might bypass business logic in your application
# that ensures referential integrity or performs other essential jobs.
#
# ==== Examples
#
# # Delete a single row
# Todo.delete(1)
#
# # Delete multiple rows
# Todo.delete([2,3,4])
#
# source://activerecord//lib/active_record/persistence.rb#565
def delete(id_or_array); end
# Destroy an object (or multiple objects) that has the given id. The object is instantiated first,
# therefore all callbacks and filters are fired off before the object is deleted. This method is
# less efficient than #delete but allows cleanup methods and other actions to be run.
#
# This essentially finds the object (or multiple objects) with the given id, creates a new object
# from the attributes, and then calls destroy on it.
#
# ==== Parameters
#
# * +id+ - This should be the id or an array of ids to be destroyed.
#
# ==== Examples
#
# # Destroy a single object
# Todo.destroy(1)
#
# # Destroy multiple objects
# todos = [1,2,3]
# Todo.destroy(todos)
#
# source://activerecord//lib/active_record/persistence.rb#533
def destroy(id); end
# @return [Boolean]
#
# source://activerecord//lib/active_record/persistence.rb#495
def has_query_constraints?; end
# Inserts a single record into the database in a single SQL INSERT
# statement. It does not instantiate any models nor does it trigger
# Active Record callbacks or validations. Though passed values
# go through Active Record's type casting and serialization.
#
# See #insert_all for documentation.
#
# source://activerecord//lib/active_record/persistence.rb#96
def insert(attributes, returning: T.unsafe(nil), unique_by: T.unsafe(nil), record_timestamps: T.unsafe(nil)); end
# Inserts a single record into the database in a single SQL INSERT
# statement. It does not instantiate any models nor does it trigger
# Active Record callbacks or validations. Though passed values
# go through Active Record's type casting and serialization.
#
# See #insert_all! for more.
#
# source://activerecord//lib/active_record/persistence.rb#185
def insert!(attributes, returning: T.unsafe(nil), record_timestamps: T.unsafe(nil)); end
# Inserts multiple records into the database in a single SQL INSERT
# statement. It does not instantiate any models nor does it trigger
# Active Record callbacks or validations. Though passed values
# go through Active Record's type casting and serialization.
#
# The +attributes+ parameter is an Array of Hashes. Every Hash determines
# the attributes for a single row and must have the same keys.
#
# Rows are considered to be unique by every unique index on the table. Any
# duplicate rows are skipped.
# Override with :unique_by (see below).
#
# Returns an ActiveRecord::Result with its contents based on
# :returning (see below).
#
# ==== Options
#
# [:returning]
# (PostgreSQL and SQLite3 only) An array of attributes to return for all successfully
# inserted records, which by default is the primary key.
# Pass returning: %w[ id name ] for both id and name
# or returning: false to omit the underlying RETURNING SQL
# clause entirely.
#
# You can also pass an SQL string if you need more control on the return values
# (for example, returning: Arel.sql("id, name as new_name")).
#
# [:unique_by]
# (PostgreSQL and SQLite only) By default rows are considered to be unique
# by every unique index on the table. Any duplicate rows are skipped.
#
# To skip rows according to just one unique index pass :unique_by.
#
# Consider a Book model where no duplicate ISBNs make sense, but if any
# row has an existing id, or is not unique by another unique index,
# ActiveRecord::RecordNotUnique is raised.
#
# Unique indexes can be identified by columns or name:
#
# unique_by: :isbn
# unique_by: %i[ author_id name ]
# unique_by: :index_books_on_isbn
#
# [:record_timestamps]
# By default, automatic setting of timestamp columns is controlled by
# the model's record_timestamps config, matching typical
# behavior.
#
# To override this and force automatic setting of timestamp columns one
# way or the other, pass :record_timestamps:
#
# record_timestamps: true # Always set timestamps automatically
# record_timestamps: false # Never set timestamps automatically
#
# Because it relies on the index information from the database
# :unique_by is recommended to be paired with
# Active Record's schema_cache.
#
# ==== Example
#
# # Insert records and skip inserting any duplicates.
# # Here "Eloquent Ruby" is skipped because its id is not unique.
#
# Book.insert_all([
# { id: 1, title: "Rework", author: "David" },
# { id: 1, title: "Eloquent Ruby", author: "Russ" }
# ])
#
# # insert_all works on chained scopes, and you can use create_with
# # to set default attributes for all inserted records.
#
# author.books.create_with(created_at: Time.now).insert_all([
# { id: 1, title: "Rework" },
# { id: 2, title: "Eloquent Ruby" }
# ])
#
# source://activerecord//lib/active_record/persistence.rb#175
def insert_all(attributes, returning: T.unsafe(nil), unique_by: T.unsafe(nil), record_timestamps: T.unsafe(nil)); end
# Inserts multiple records into the database in a single SQL INSERT
# statement. It does not instantiate any models nor does it trigger
# Active Record callbacks or validations. Though passed values
# go through Active Record's type casting and serialization.
#
# The +attributes+ parameter is an Array of Hashes. Every Hash determines
# the attributes for a single row and must have the same keys.
#
# Raises ActiveRecord::RecordNotUnique if any rows violate a
# unique index on the table. In that case, no rows are inserted.
#
# To skip duplicate rows, see #insert_all. To replace them, see #upsert_all.
#
# Returns an ActiveRecord::Result with its contents based on
# :returning (see below).
#
# ==== Options
#
# [:returning]
# (PostgreSQL and SQLite3 only) An array of attributes to return for all successfully
# inserted records, which by default is the primary key.
# Pass returning: %w[ id name ] for both id and name
# or returning: false to omit the underlying RETURNING SQL
# clause entirely.
#
# You can also pass an SQL string if you need more control on the return values
# (for example, returning: Arel.sql("id, name as new_name")).
#
# [:record_timestamps]
# By default, automatic setting of timestamp columns is controlled by
# the model's record_timestamps config, matching typical
# behavior.
#
# To override this and force automatic setting of timestamp columns one
# way or the other, pass :record_timestamps:
#
# record_timestamps: true # Always set timestamps automatically
# record_timestamps: false # Never set timestamps automatically
#
# ==== Examples
#
# # Insert multiple records
# Book.insert_all!([
# { title: "Rework", author: "David" },
# { title: "Eloquent Ruby", author: "Russ" }
# ])
#
# # Raises ActiveRecord::RecordNotUnique because "Eloquent Ruby"
# # does not have a unique id.
# Book.insert_all!([
# { id: 1, title: "Rework", author: "David" },
# { id: 1, title: "Eloquent Ruby", author: "Russ" }
# ])
#
# source://activerecord//lib/active_record/persistence.rb#242
def insert_all!(attributes, returning: T.unsafe(nil), record_timestamps: T.unsafe(nil)); end
# Given an attributes hash, +instantiate+ returns a new instance of
# the appropriate class. Accepts only keys as strings.
#
# For example, +Post.all+ may return Comments, Messages, and Emails
# by storing the record's subclass in a +type+ attribute. By calling
# +instantiate+ instead of +new+, finder methods ensure they get new
# instances of the appropriate class for each record.
#
# See ActiveRecord::Inheritance#discriminate_class_for_record to see
# how this "single-table" inheritance mapping is implemented.
#
# source://activerecord//lib/active_record/persistence.rb#376
def instantiate(attributes, column_types = T.unsafe(nil), &block); end
# Accepts a list of attribute names to be used in the WHERE clause
# of SELECT / UPDATE / DELETE queries and in the ORDER BY clause for `#first` and `#last` finder methods.
#
# class Developer < ActiveRecord::Base
# query_constraints :company_id, :id
# end
#
# developer = Developer.first
# # SELECT "developers".* FROM "developers" ORDER BY "developers"."company_id" ASC, "developers"."id" ASC LIMIT 1
# developer.inspect # => #ORDER BY
clause to a query.
#
# #order accepts arguments in one of several formats.
#
# === symbols
#
# The symbol represents the name of the column you want to order the results by.
#
# User.order(:name)
# # SELECT "users".* FROM "users" ORDER BY "users"."name" ASC
#
# By default, the order is ascending. If you want descending order, you can
# map the column name symbol to +:desc+.
#
# User.order(email: :desc)
# # SELECT "users".* FROM "users" ORDER BY "users"."email" DESC
#
# Multiple columns can be passed this way, and they will be applied in the order specified.
#
# User.order(:name, email: :desc)
# # SELECT "users".* FROM "users" ORDER BY "users"."name" ASC, "users"."email" DESC
#
# === strings
#
# Strings are passed directly to the database, allowing you to specify
# simple SQL expressions.
#
# This could be a source of SQL injection, so only strings composed of plain
# column names and simple function(column_name)
expressions
# with optional +ASC+/+DESC+ modifiers are allowed.
#
# User.order('name')
# # SELECT "users".* FROM "users" ORDER BY name
#
# User.order('name DESC')
# # SELECT "users".* FROM "users" ORDER BY name DESC
#
# User.order('name DESC, email')
# # SELECT "users".* FROM "users" ORDER BY name DESC, email
#
# === Arel
#
# If you need to pass in complicated expressions that you have verified
# are safe for the database, you can use Arel.
#
# User.order(Arel.sql('end_date - start_date'))
# # SELECT "users".* FROM "users" ORDER BY end_date - start_date
#
# Custom query syntax, like JSON columns for PostgreSQL, is supported in this way.
#
# User.order(Arel.sql("payload->>'kind'"))
# # SELECT "users".* FROM "users" ORDER BY payload->>'kind'
#
# source://activerecord//lib/active_record/relation/query_methods.rb#595
def order(*args); end
# Same as #order but operates on relation in-place instead of copying.
#
# source://activerecord//lib/active_record/relation/query_methods.rb#603
def order!(*args); end
# source://activerecord//lib/active_record/relation/query_methods.rb#155
def order_values; end
# source://activerecord//lib/active_record/relation/query_methods.rb#159
def order_values=(value); end
# Specify associations +args+ to be eager loaded using separate queries.
# A separate query is performed for each association.
#
# users = User.preload(:address).limit(5)
# users.each do |user|
# user.address.city
# end
#
# # SELECT "users".* FROM "users" LIMIT 5
# # SELECT "addresses".* FROM "addresses" WHERE "addresses"."id" IN (1,2,3,4,5)
#
# Instead of loading the 5 addresses with 5 separate queries, all addresses
# are loaded with a separate query.
#
# Loading multiple and nested associations is possible using Hashes and Arrays,
# similar to #includes:
#
# User.preload(:address, friends: [:address, :followers])
# # SELECT "users".* FROM "users"
# # SELECT "addresses".* FROM "addresses" WHERE "addresses"."id" IN (1,2,3,4,5)
# # SELECT "friends".* FROM "friends" WHERE "friends"."user_id" IN (1,2,3,4,5)
# # SELECT ...
#
# source://activerecord//lib/active_record/relation/query_methods.rb#299
def preload(*args); end
# source://activerecord//lib/active_record/relation/query_methods.rb#304
def preload!(*args); end
# source://activerecord//lib/active_record/relation/query_methods.rb#155
def preload_values; end
# source://activerecord//lib/active_record/relation/query_methods.rb#159
def preload_values=(value); end
# Mark a relation as readonly. Attempting to update a record will result in
# an error.
#
# users = User.readonly
# users.first.save
# => ActiveRecord::ReadOnlyRecord: User is marked as readonly
#
# To make a readonly relation writable, pass +false+.
#
# users.readonly(false)
# users.first.save
# => true
#
# source://activerecord//lib/active_record/relation/query_methods.rb#1208
def readonly(value = T.unsafe(nil)); end
# source://activerecord//lib/active_record/relation/query_methods.rb#1212
def readonly!(value = T.unsafe(nil)); end
# source://activerecord//lib/active_record/relation/query_methods.rb#155
def readonly_value; end
# source://activerecord//lib/active_record/relation/query_methods.rb#159
def readonly_value=(value); end
# Use to indicate that the given +table_names+ are referenced by an SQL string,
# and should therefore be +JOIN+ed in any query rather than loaded separately.
# This method only works in conjunction with #includes.
# See #includes for more details.
#
# User.includes(:posts).where("posts.name = 'foo'")
# # Doesn't JOIN the posts table, resulting in an error.
#
# User.includes(:posts).where("posts.name = 'foo'").references(:posts)
# # Query now knows the string references posts, so adds a JOIN
#
# source://activerecord//lib/active_record/relation/query_methods.rb#332
def references(*table_names); end
# source://activerecord//lib/active_record/relation/query_methods.rb#337
def references!(*table_names); end
# source://activerecord//lib/active_record/relation/query_methods.rb#155
def references_values; end
# source://activerecord//lib/active_record/relation/query_methods.rb#159
def references_values=(value); end
# Allows you to change a previously set group statement.
#
# Post.group(:title, :body)
# # SELECT `posts`.`*` FROM `posts` GROUP BY `posts`.`title`, `posts`.`body`
#
# Post.group(:title, :body).regroup(:title)
# # SELECT `posts`.`*` FROM `posts` GROUP BY `posts`.`title`
#
# This is short-hand for unscope(:group).group(fields).
# Note that we're unscoping the entire group statement.
#
# source://activerecord//lib/active_record/relation/query_methods.rb#532
def regroup(*args); end
# Same as #regroup but operates on relation in-place instead of copying.
#
# source://activerecord//lib/active_record/relation/query_methods.rb#538
def regroup!(*args); end
# Replaces any existing order defined on the relation with the specified order.
#
# User.order('email DESC').reorder('id ASC') # generated SQL has 'ORDER BY id ASC'
#
# Subsequent calls to order on the same relation will be appended. For example:
#
# User.order('email DESC').reorder('id ASC').order('name ASC')
#
# generates a query with ORDER BY id ASC, name ASC.
#
# source://activerecord//lib/active_record/relation/query_methods.rb#651
def reorder(*args); end
# Same as #reorder but operates on relation in-place instead of copying.
#
# source://activerecord//lib/active_record/relation/query_methods.rb#659
def reorder!(*args); end
# source://activerecord//lib/active_record/relation/query_methods.rb#155
def reordering_value; end
# source://activerecord//lib/active_record/relation/query_methods.rb#159
def reordering_value=(value); end
# Allows you to change a previously set select statement.
#
# Post.select(:title, :body)
# # SELECT `posts`.`title`, `posts`.`body` FROM `posts`
#
# Post.select(:title, :body).reselect(:created_at)
# # SELECT `posts`.`created_at` FROM `posts`
#
# This is short-hand for unscope(:select).select(fields).
# Note that we're unscoping the entire select statement.
#
# source://activerecord//lib/active_record/relation/query_methods.rb#480
def reselect(*args); end
# Same as #reselect but operates on relation in-place instead of copying.
#
# source://activerecord//lib/active_record/relation/query_methods.rb#487
def reselect!(*args); end
# Reverse the existing order clause on the relation.
#
# User.order('name ASC').reverse_order # generated SQL has 'ORDER BY name DESC'
#
# source://activerecord//lib/active_record/relation/query_methods.rb#1397
def reverse_order; end
# source://activerecord//lib/active_record/relation/query_methods.rb#1401
def reverse_order!; end
# source://activerecord//lib/active_record/relation/query_methods.rb#155
def reverse_order_value; end
# source://activerecord//lib/active_record/relation/query_methods.rb#159
def reverse_order_value=(value); end
# Allows you to change a previously set where condition for a given attribute, instead of appending to that condition.
#
# Post.where(trashed: true).where(trashed: false)
# # WHERE `trashed` = 1 AND `trashed` = 0
#
# Post.where(trashed: true).rewhere(trashed: false)
# # WHERE `trashed` = 0
#
# Post.where(active: true).where(trashed: true).rewhere(trashed: false)
# # WHERE `active` = 1 AND `trashed` = 0
#
# This is short-hand for unscope(where: conditions.keys).where(conditions).
# Note that unlike reorder, we're only unscoping the named conditions -- not the entire where statement.
#
# source://activerecord//lib/active_record/relation/query_methods.rb#960
def rewhere(conditions); end
# Works in two unique ways.
#
# First: takes a block so it can be used just like Array#select.
#
# Model.all.select { |m| m.field == value }
#
# This will build an array of objects from the database for the scope,
# converting them into an array and iterating through them using
# Array#select.
#
# Second: Modifies the SELECT statement for the query so that only certain
# fields are retrieved:
#
# Model.select(:field)
# # => [#