belongs_to

belongs_to(name, scope = nil, options = {}) Instance Public methods Specifies a one-to-one association with another class. This method should only be used if this class contains the foreign key. If the other class contains the foreign key, then you should use has_one instead. See also ActiveRecord::Associations::ClassMethods's overview on when to use has_one and when to use belongs_to. Methods will be added for retrieval and query for a single associated object, for which this obje

supports_savepoints?

supports_savepoints?() Instance Public methods Does this adapter support savepoints? PostgreSQL and MySQL do, SQLite < 3.6.8 does not.

call

call(env) Instance Public methods

human_attribute_name

human_attribute_name(attribute, options = {}) Instance Public methods Transforms attribute names into a more human format, such as âFirst nameâ instead of âfirst_nameâ. Person.human_attribute_name("first_name") # => "First name" Specify options with additional translating options.

add_flash_types

add_flash_types(*types) Instance Public methods Creates new flash types. You can pass as many types as you want to create flash types other than the default alert and notice in your controllers and views. For instance: # in application_controller.rb class ApplicationController < ActionController::Base add_flash_types :warning end # in your controller redirect_to user_path(@user), warning: "Incomplete profile" # in your view <%= warning %> This method will automatically

distinct

distinct() Instance Public methods Specifies whether the records should be unique or not. class Person < ActiveRecord::Base has_many :pets end person.pets.select(:name) # => [ # #<Pet name: "Fancy-Fancy">, # #<Pet name: "Fancy-Fancy"> # ] person.pets.select(:name).distinct # => [#<Pet name: "Fancy-Fancy">] uniq

utc_offset

utc_offset() Instance Public methods Returns the offset from current time to UTC time in seconds. gmt_offset gmtoff

uses_transaction?

uses_transaction?(method) Instance Public methods

filtered_query_string

filtered_query_string() Instance Protected methods

raw_write_attribute

raw_write_attribute(attr_name, value) Instance Public methods