Flowdock

106 results found for "{query"

where

(ActiveRecord::QueryMethods, >= v3.0.0 <= v4.2.7)
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

has_many

(ActiveRecord::Associations::ClassMethods, >= v1.0.0 <= v4.2.7)
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(force_reload = false) Returns an array of all the associated objects. An empty array is returned if none are found

find_by_sql

(ActiveRecord::Querying, >= v3.2.1 <= v4.2.7)
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

scope

(ActiveRecord::Scoping::Named::ClassMethods, >= v3.2.1 <= v4.2.7)
Importance_3_sm

Adds a class method for retrieving and querying objects. A scope represents a narrowing of a database query, such as where(color: :red).select('shirts.*').includes(:washing_instructions) .

belongs_to

(ActiveRecord::Associations::ClassMethods, >= v1.0.0 <= v4.2.7)
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(force_reload = false) Returns the associated object. nil is returned if none is found. association

has_one

(ActiveRecord::Associations::ClassMethods, >= v1.0.0 <= v4.2.7)
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(force_reload = false) Returns the associated object. nil is returned if none is found. association=(associate) Assigns the associate

to_query

(Hash, >= v3.0.9 <= v4.2.7)
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 .

clear_query_cache

(ActiveRecord::ConnectionAdapters::QueryCache, >= v2.0.0 <= v4.2.7)
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 <= v4.2.7)
Importance_1_sm

Converts the query parameters of the URI into a hash.

explain

(ActiveRecord::Relation, >= v3.2.1 <= v4.2.7)
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::Base

Importance_5_sm

querying. MultiparameterAssignmentErrors - Collection of errors that occurred during a mass assignment using the 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 save! and create! when the record is invalid. RecordNotFound

to_query

(Array, >= v3.0.0 <= v4.2.7)
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 <= v4.2.7)
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 <= v4.2.7)
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 table is empty, true otherwise. For more information about specifying conditions as a hash or array, see the Conditions section in the introduction to ActiveRecord

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 <= v4.2.7)
Importance_1_sm

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

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: Where conditions on an enum attribute must use the ordinal value of an enum .

none

(ActiveRecord::QueryMethods, >= v4.0.2 <= v4.2.7)
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 now 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 <= v4.2.7)
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 <= v4.2.7)
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.

query

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

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

count_by_sql

(ActiveRecord::Querying, >= v3.2.1 <= v4.2.7)
Importance_1_sm

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 below. Product.count_by_sql “SELECT COUNT(*) FROM sales s, customers c WHERE s.customer_id = c.id

build_query

(ActionView::PathResolver, >= v3.1.0 <= v4.2.7)
Importance_1_sm

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

size

(ActiveRecord::Associations::CollectionAssociation, >= v3.1.0 <= v4.2.7)
Importance_1_sm

query if the collection hasn’t been loaded, and calling collection. size if it has. 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. This

sql_query_length

(ActiveRecord::ConnectionAdapters::DatabaseLimits, >= v2.3.8 <= v4.2.7)
Importance_1_sm

Returns the maximum length of an SQL query.

joins_per_query

(ActiveRecord::ConnectionAdapters::DatabaseLimits, >= v2.3.8 <= v4.2.7)
Importance_1_sm

Returns maximum number of joins in a single query.

exec_query

(ActiveRecord::ConnectionAdapters::DatabaseStatements, >= v3.1.0 <= v4.2.7)
Importance_1_sm

Executes sql statement in the context of this connection using binds as the bind substitutes. name is logged along with the executed sql statement.

ActiveRecord::Store

Importance_3_sm

query that store outside the context of a single record. You can then declare accessors to this store that are then accessible just like any other attribute of the model. This is very helpful for easily exposing store keys to a form or elsewhere that’s already built around just

size

(ActiveRecord::Associations::HasManyThroughAssociation, >= v2.1.0 <= v4.2.7)
Importance_1_sm

executing a SELECT COUNT(*) query if the collection hasn’t been loaded, and by calling collection. size if it has. If the collection will likely have a size greater than zero, and if fetching the collection will be needed afterwards, one less SELECT query will be generated by using #length instead.