Flowdock

135 results found for "{query"

where

(ActiveRecord::QueryMethods, >= v3.0.0 <= v5.2.3)
Importance_5_sm

query generated may be different depending on the database adapter. string A single string, without additional arguments, is passed to the query constructor as an SQL fragment, and used in the where clause of the query. See WhereChain for more details on #not. blank condition If the condition is any blank

to_query

(ActionController::Parameters, >= v5.1.7 <= v5.2.3)
Importance_2_sm

Returns a string representation of the receiver suitable for use as a URL query string: The string pairs “key=value” that conform the query string are sorted lexicographically in ascending order. This method is also aliased as to_param .

has_many

(ActiveRecord::Associations::ClassMethods, >= v1.0.0 <= v5.2.3)
Importance_5_sm

query of collections of associated objects will be added: collection is a placeholder for the symbol passed as the name argument, so has_many :clients would add among others clients.empty? . collection Returns a Relation of all the associated objects. An empty Relation is returned if none are found. collection<<(object

belongs_to

(ActiveRecord::Associations::ClassMethods, >= v1.0.0 <= v5.2.3)
Importance_5_sm

query for a single associated object, for which this object holds an id: association is a placeholder for the symbol passed as the name argument, so belongs_to :author would add among others author.nil? . association Returns the associated object. nil is returned if none is found. association=(associate) Assigns the associate

find_by_sql

(ActiveRecord::Querying, >= v3.2.1 <= v5.2.3)
Importance_2_sm

query. If you call a complicated SQL query which spans multiple tables the columns specified by the SELECT will be attributes of the model, whether or not they are columns of the corresponding table. The sql parameter is a full SQL query as a string. It will be called as is, there

has_one

(ActiveRecord::Associations::ClassMethods, >= v1.0.0 <= v5.2.3)
Importance_5_sm

query of a single associated object will be added: association is a placeholder for the symbol passed as the name argument, so has_one :manager would add among others manager.nil? . association Returns the associated object. nil is returned if none is found. association=(associate) Assigns the associate object, extracts the primary

cache_key

(ActiveRecord::Relation, >= v5.0.0.1 <= v5.2.3)
Importance_2_sm

query. The cache key is built with a fingerprint of the sql query, the number of records matched by the query and a timestamp of the last updated record. When a new record comes to match the query, or any of the existing records is updated or deleted, the cache

scope

(ActiveRecord::Scoping::Named::ClassMethods, >= v3.2.1 <= v5.2.3)
Importance_3_sm

querying objects. The method is intended to return an ActiveRecord::Relation object, which is composable with other scopes. If it returns nil or false, an {all}[rdoc-ref:Scoping::Named::ClassMethods#all] scope is returned instead. A scope represents a narrowing of a database query, such as where(color: :red).select

to_query

(Hash, >= v3.0.9 <= v5.2.3)
Importance_1_sm

Returns a string representation of the receiver suitable for use as a URL query string: The string pairs “key=value” that conform the query string are sorted lexicographically in ascending order. This method is also aliased as to_param .

ActiveRecord::UnknownAttributeReference

Importance_2_sm

query method when allow_unsafe_raw_sql is set to :disabled. For example, passing a non column name value to a relation’s #order method might cause this exception. When working around this exception, caution should be taken to avoid SQL injection vulnerabilities when passing user-provided values to query

exec_queries

(ActiveRecord::Relation::RecordFetchWarning, >= v5.0.0.1 <= v5.2.3)
Importance_1_sm

query returns is greater than the value of warn_on_records_fetched_greater_than, a warning is logged. This allows for the detection of queries that return a large number of records, which could cause memory bloat. In most cases, fetching large number of records can be performed efficiently using

clear_query_cache

(ActiveRecord::ConnectionAdapters::QueryCache, >= v2.0.3 <= v5.2.3)
Importance_2_sm

Clears the query cache . One reason you may wish to call this method explicitly is between queries that ask the database to randomize results. Otherwise the cache would see the same SQL query and repeatedly return the same result each time, silently undermining the randomness you were expecting.

query_hash

(ActiveRecord::ConnectionAdapters::ConnectionSpecification::ConnectionUrlResolver, >= v4.1.8 <= v5.2.3)
Importance_1_sm

Converts the query parameters of the URI into a hash.

explain

(ActiveRecord::Relation, >= v3.2.1 <= v5.2.3)
Importance_1_sm

query or queries triggered by this relation and returns the result as a string. The string is formatted imitating the ones printed by the database shell. Note that this method actually runs the queries, since the results of some are needed by the next ones when eager loading is going

ActiveRecord::Enum

Importance_5_sm

Declare an enum attribute where the values map to integers in the database, but can be queried by name. Example:

ActiveRecord::Result

Importance_2_sm

This class encapsulates a result returned from calling {#exec_query}[rdoc-ref:ConnectionAdapters::DatabaseStatements#exec_query] on any database connection adapter. For example:

ActiveRecord::Base

Importance_5_sm

querying. MultiparameterAssignmentErrors - Collection of errors that occurred during a mass assignment using the {ActiveRecord::Base#attributes=}[rdoc-ref:AttributeAssignment#attributes=] method. The errors property of this exception contains an array of AttributeAssignmentError objects that should be inspected to determine which attributes triggered the errors. RecordInvalid - raised by {ActiveRecord::Base#save

to_query

(Array, >= v3.0.0 <= v5.2.3)
Importance_1_sm

Converts an array into a string suitable for use as a URL query string, using the given key as the param name.

size

(ActiveRecord::Associations::CollectionProxy, >= v4.0.2 <= v5.2.3)
Importance_2_sm

collection hasn’t been loaded, it executes a SELECT COUNT(*) query. Else it calls collection. size . If the collection has been already loaded size and length are equivalent. If not and you are going to need the records anyway length will take one less query. Otherwise size is more efficient.

exists?

(ActiveRecord::FinderMethods, >= v3.0.0 <= v5.2.3)
Importance_2_sm

query}%"]) . Hash - Finds the record that matches these find-style conditions (such as {name: 'David'} ). false - Returns always false . No args - Returns false if the relation is empty, true otherwise. For more information about specifying conditions as a hash or array, see the Conditions section in the introduction to ActiveRecord

update

(ActiveRecord::Persistence::ClassMethods, >= v5.2.3 <= v5.2.3)
Importance_2_sm

Updating a large number of records will run an UPDATE query for each record, which may cause a performance issue. When running callbacks is not needed for each record update, it is preferred to use {update_all}[rdoc-ref:Relation#update_all] for updating all records in a single query.

ActionController::Streaming

Importance_4_sm

queries are made, and the layout is processed. Streaming inverts the rendering flow by rendering the layout first and streaming each part of the layout as they are processed. This allows the header of the HTML (which is usually in the layout) to be streamed back to client very quickly

cacheable_query

(ActiveRecord::ConnectionAdapters::DatabaseStatements, >= v4.2.1 <= v5.2.3)
Importance_1_sm

This is used in the StatementCache object. It returns an object that can be used to query the database repeatedly.

none

(ActiveRecord::QueryMethods, >= v4.0.2 <= v5.2.3)
Importance_2_sm

array of records without querying the database. Any subsequent condition chained to the returned relation will continue generating an empty relation and will not fire any query to the database. Used in cases where a method or scope could return zero records but the result needs to be chainable. For example:

ActiveRecord::ExplainSubscriber

Importance_0_sm

SCHEMA queries cannot be EXPLAINed, also we do not want to run EXPLAIN on our own EXPLAINs no matter how loopingly beautiful that would be. On the other hand, we want to monitor the performance of our real database queries, not the performance of the access to the query cache.

collecting_queries_for_explain

(ActiveRecord::Explain, >= v3.2.1 <= v5.2.3)
Importance_1_sm

Executes the block with the collect flag enabled. Queries are collected asynchronously by the subscriber and returned.

to_query

(Object, >= v2.0.3 <= v5.2.3)
Importance_1_sm

Converts an object into a string suitable for use as a URL query string, using the given key as the param name.

count_by_sql

(ActiveRecord::Querying, >= v3.2.1 <= v5.2.3)
Importance_1_sm

COUNT(*) in the SELECT part. The use of this method should be restricted to complicated SQL queries that can’t be executed using the ActiveRecord::Calculations class methods. Look into those before using this. Parameters sql - An SQL statement which should return a count query from the database, see the example above.

query

(ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements, >= v4.2.1 <= v5.2.3)
Importance_1_sm

Queries the database and returns the results in an Array-like object

build_query

(ActionView::PathResolver, >= v3.1.0 <= v5.2.3)
Importance_1_sm

Helper for building query glob string based on resolver’s pattern.