sanitize_limit

sanitize_limit(limit) Instance Public methods Sanitizes the given LIMIT parameter in order to prevent SQL injection. The limit may be anything that can evaluate to a string via to_s. It should look like an integer, or a comma-delimited list of integers, or an Arel SQL literal. Returns Integer and Arel::Nodes::SqlLiteral limits as is. Returns the sanitized limit parameter, either as an integer, or as a string which contains a comma-delimited list of integers.

load

load() Instance Public methods Causes the records to be loaded from the database if they have not been loaded already. You can use this if for some reason you need to explicitly load some records before actually using them. The return value is the relation itself, not the records. Post.where(published: true).load # => #<ActiveRecord::Relation>

since

since(time = ::Time.current) Instance Public methods Reads best with argument: 10.minutes.since(time) from_now

as_json

as_json(options = nil) Instance Public methods Returns a hash representing the model. Some configuration can be passed through options. The option include_root_in_json controls the top-level behavior of as_json. If true, as_json will emit a single root node named after the object's type. The default value for include_root_in_json option is false. user = User.find(1) user.as_json # => { "id" => 1, "name" => "Konata Izumi", "age" => 16, # "created_at" => "2006/08/0

sanitize_sql_hash_for_assignment

sanitize_sql_hash_for_assignment(attrs, table) Instance Protected methods Sanitizes a hash of attribute/value pairs into SQL conditions for a SET clause. { status: nil, group_id: 1 } # => "status = NULL , group_id = 1"

start_processing

start_processing(event) Instance Public methods

expand_cache_key

expand_cache_key(key, namespace = nil) Class Public methods Expands out the key argument into a key that can be used for the cache store. Optionally accepts a namespace, and all keys will be scoped within that namespace. If the key argument provided is an array, or responds to to_a, then each of elements in the array will be turned into parameters/keys and concatenated into a single key. For example: expand_cache_key([:foo, :bar]) # => "foo/bar" expand_cache_key([:

namespaced?

namespaced?() Instance Protected methods

local_to_utc

local_to_utc(time, dst=true) Instance Public methods Adjust the given time to the simultaneous time in UTC. Returns a Time.utc() instance.

default_options

default_options() Instance Public methods