exec_query

exec_query(sql, name = 'SQL', binds = []) Instance Public methods Executes sql statement in the context of this connection using binds as the bind substitutes. name is logged along with the executed sql statement.

stringify_keys

stringify_keys() Instance Public methods Returns a new hash with all keys converted to strings. hash = { name: 'Rob', age: '28' } hash.stringify_keys # => { "name" => "Rob", "age" => "28" }

sending?

sending?() Instance Public methods

root

root(options = {}) Instance Public methods You can specify what Rails should route â/â to with the root method: root to: 'pages#main' For options, see match, as root uses it internally. You can also pass a string which will expand root 'pages#main' You should put the root route at the top of config/routes.rb, because this means it will be matched first. As this is the most popular route of most Rails applications, this is beneficial.

assigns

assigns(key = nil) Instance Public methods

new 2

new(*args, &block) Instance Public methods Initializes new record from relation while maintaining the current scope. Expects arguments in the same format as Base.new. users = User.where(name: 'DHH') user = users.new # => #<User id: nil, name: "DHH", created_at: nil, updated_at: nil> You can also pass a block to new with the new record as argument: user = users.new { |user| user.name = 'Oscar' } user.name # => Oscar build

migrate

migrate(direction) Class Public methods

delete

delete(key) Instance Public methods Delete messages for key. Returns the deleted messages. person.errors.get(:name) # => ["cannot be nil"] person.errors.delete(:name) # => ["cannot be nil"] person.errors.get(:name) # => nil

middle_of_day

middle_of_day() Instance Public methods Returns a new Time representing the middle of the day (12:00) midday noon at_midday at_noon at_middle_of_day

new

new(app) Class Public methods