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

create

create(*args, &block) Instance Public methods Tries to create a new record with the same scoped attributes defined in the relation. Returns the initialized object if validation fails. Expects arguments in the same format as Base.create. Examples users = User.where(name: 'Oscar') users.create # #<User id: 3, name: "oscar", ...> users.create(name: 'fxn') users.create # #<User id: 4, name: "fxn", ...> users.create { |user| user.name = 'tenderlove' } # #<User id: 5

suppress

suppress(*exception_classes) Instance Public methods Blocks and ignores any exception passed as argument if raised within the block. suppress(ZeroDivisionError) do 1/0 puts 'This code is NOT reached' end puts 'This code gets executed and nothing related to ZeroDivisionError was seen'

in_time_zone

in_time_zone(zone = ::Time.zone) Instance Public methods Returns the simultaneous time in Time.zone if a zone is given or if Time.zone_default is set. Otherwise, it returns the current time. Time.zone = 'Hawaii' # => 'Hawaii' DateTime.utc(2000).in_time_zone # => Fri, 31 Dec 1999 14:00:00 HST -10:00 Date.new(2000).in_time_zone # => Sat, 01 Jan 2000 00:00:00 HST -10:00 This method is similar to Time#localtime, except that it uses Time.zone as the local zone instead

sanitize

sanitize(text, options = {}) Instance Public methods

key?

key?(key) Instance Public methods

log_path

log_path() Instance Public methods

becomes

becomes(klass) Instance Public methods Returns an instance of the specified klass with the attributes of the current record. This is mostly useful in relation to single-table inheritance structures where you want a subclass to appear as the superclass. This can be used along with record identification in Action Pack to allow, say, Client < Company to do something like render partial: @client.becomes(Company) to render that instance using the companies/company partial instead of