152 results found for "{query"
annotate
(ActiveRecord::QueryMethods, >= v6.0.0 <= v7.1.3.2)Adds an SQL comment to queries generated from this relation. For example: The SQL block comment delimiters, “/*” and “*/”, will be added automatically. Some escaping is performed, however untrusted user input should not be used.
reorder
(ActiveRecord::QueryMethods, >= v3.0.0 <= v7.1.3.2)Replaces any existing order defined on the relation with the specified order . generates a query with ‘ORDER BY id ASC, name ASC’.
record_key_for_dom_id
(ActionView::RecordIdentifier, >= v4.0.2 <= v7.1.3.2)query for the underlying database record, you should write a helper like ‘person_record_from_dom_id’ that will extract the key either based on the default implementation (which just joins all key attributes with ‘_’) or on your own overwritten version of the method. By default, this implementation passes the key string
destroy_all
(ActiveRecord::Relation, >= v3.0.0 <= v7.1.3.2)record can be time consuming when you’re removing many records at once. It generates at least one SQL DELETE query per record (or possibly more, to enforce your callbacks). If you want to delete many rows quickly, without concern for their associations or callbacks, use #delete_all instead. Examples
references
(ActiveRecord::QueryMethods, >= v4.0.2 <= v7.1.3.2)Use to indicate that the given table_names are referenced by an SQL string, and should therefore be JOINed in any query rather than loaded separately. This method only works in conjunction with #includes . See #includes for more details.
scoping
(ActiveRecord::Relation, >= v3.0.0 <= v7.1.3.2)Scope all queries to the current scope. Please check unscoped if you want to remove all previous scopes (including the default_scope) during the execution of a block.
insert
(ActiveRecord::ConnectionAdapters::DatabaseStatements, >= v1.0.0 <= v7.1.3.2)query and returns the new record’s ID id_value will be returned unless the value is nil, in which case the database will attempt to calculate the last inserted id and return that value. If the next id was calculated in advance (as in Oracle), it should be passed
pp
(ActiveRecord::ConnectionAdapters::SQLite3::ExplainPrettyPrinter, >= v5.0.0.1 <= v7.1.3.2)Pretty prints the result of an EXPLAIN QUERY PLAN in a way that resembles the output of the SQLite shell:
clear
(ActiveRecord::Associations::CollectionProxy, >= v3.1.0 <= v7.1.3.2)difference is that returns self, instead of an array with the deleted objects, so methods can be chained. See delete_all for more information. Note that because delete_all removes records by directly running an SQL query into the database, the updated_at column of the object is not changed.
ActiveRecord::StaleObjectError
Raised on attempt to save stale record. Record is stale when it’s being saved in another query after instantiation, for example, when two users edit the same wiki page and one starts editing and saves the page before the other. Read more about optimistic locking in ActiveRecord::Locking module documentation.
ActiveRecord::ExplainRegistry
This is a thread locals registry for EXPLAIN. For example returns the collected queries local to the current thread. See the documentation of ActiveSupport::PerThreadRegistry for further details.
sql
(Arel, >= v6.0.0 <= v7.1.3.2)Wrap a known-safe SQL string for passing to query methods, e.g. Great caution should be taken to avoid SQL injection vulnerabilities. This method should not be used with unsafe values such as request parameters or model attributes.
cleanup_view_runtime
(ActionController::Instrumentation, >= v3.0.0 <= v7.1.3.2)A hook which allows you to clean up any time, wrongly taken into account in views, like database querying time.
columns_for_distinct
(ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements, >= v4.2.1 <= v7.1.3.2)PostgreSQL requires the ORDER BY columns in the select list for distinct queries, and requires that the ORDER BY include the distinct column.
execute
(ActiveRecord::ConnectionAdapters::DatabaseStatements, >= v1.0.0 <= v7.1.3.2)Executes the SQL statement in the context of this connection and returns the raw result from the connection adapter. Note: depending on your database connector, the result returned by this method may be manually memory managed. Consider using the exec_query wrapper instead.
filename
(ActiveStorage::Blob, >= v5.2.3 <= v7.1.3.2)Returns an ActiveStorage::Filename instance of the filename that can be queried for basename, extension, and a sanitized version of the filename that’s safe to use in URLs.
execute
(ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements, >= v4.2.1 <= v7.1.3.2)Executes an SQL statement, returning a PG::Result object on success or raising a PG::Error exception otherwise. Note: the PG::Result object is manually memory managed; if you don’t need it specifically, you may want consider the exec_query wrapper.
ActiveRecord::QueryMethods::WhereChain
WhereChain objects act as placeholder for queries in which #where does not have any parameter. In this case, #where must be chained with #not to return a new relation.
locked?
(ActiveRecord::ConnectionAdapters::QueryCache, >= v3.2.8 <= v6.1.7.7)If arel is locked this is a SELECT … FOR UPDATE or somesuch. Such queries should not be cached.
ignored_columns
(ActiveRecord::ModelSchema::ClassMethods, >= v5.1.7 <= v7.1.3.2)The list of columns names the model should ignore. Ignored columns won’t have attribute accessors defined, and won’t be referenced in SQL queries.
scopes
(ActiveRecord::Reflection::AbstractReflection, >= v5.1.7 <= v7.1.3.2)Returns a list of scopes that should be applied for this Reflection object when querying the database.
compute_asset_path
(ActionView::Helpers::AssetUrlHelper, >= v4.0.2 <= v7.1.3.2)Computes asset path to public directory. Plugins and extensions can override this method to point to custom assets or generate digested paths or query strings.
cache
(ActiveRecord::QueryCache::ClassMethods, >= v2.3.8 <= v7.1.3.2)Enable the query cache within the block if Active Record is configured. If it’s not, it will execute the given block.
prepare_update_statement
(Arel::Visitors::MySQL, >= v6.0.0 <= v7.1.3.2)In the simple case, MySQL allows us to place JOINs directly into the UPDATE query. However, this does not allow for LIMIT, OFFSET and ORDER. To support these, we must use a subquery.
define_attribute_methods
(ActiveRecord::AttributeMethods::ClassMethods, >= v2.0.3 <= v7.1.3.2)Generates all the attribute related methods for columns in the database accessors, mutators and query methods.
uncached
(ActiveRecord::QueryCache::ClassMethods, >= v2.3.8 <= v7.1.3.2)Disable the query cache within the block if Active Record is configured. If it’s not, it will execute the given block.
clear_association_scope_cache
(ActiveRecord::Reflection::ThroughReflection, >= v5.0.0.1 <= v7.0.0)This is for clearing cache on the reflection. Useful for tests that need to compare SQL queries on associations.
clear_association_scope_cache
(ActiveRecord::Reflection::AssociationReflection, >= v5.0.0.1 <= v7.1.3.2)This is for clearing cache on the reflection. Useful for tests that need to compare SQL queries on associations.
exec_explain
(ActiveRecord::Explain, >= v3.2.1 <= v7.1.3.2)Makes the adapter execute EXPLAIN for the tuples of queries and bindings. Returns a formatted string ready to be logged.
Rails::Command::ServerCommand
Hard-coding a bunch of handlers here as we don’t have a public way of querying them from the Rack::Handler registry.