sunday

sunday() Instance Public methods Returns Sunday of this week assuming that week starts on Monday. DateTime objects have their time set to 23:59:59.

joins

joins(*args) Instance Public methods Performs a joins on args: User.joins(:posts) => SELECT "users".* FROM "users" INNER JOIN "posts" ON "posts"."user_id" = "users"."id" You can use strings in order to customize your joins: User.joins("LEFT JOIN bookmarks ON bookmarks.bookmarkable_type = 'Post' AND bookmarks.user_id = users.id") => SELECT "users".* FROM "users" LEFT JOIN bookmarks ON bookmarks.bookmarkable_type = 'Post' AND bookmarks.user_id = users.id

validates_acceptance_of

validates_acceptance_of(*attr_names) Instance Public methods Encapsulates the pattern of wanting to validate the acceptance of a terms of service check box (or similar agreement). class Person < ActiveRecord::Base validates_acceptance_of :terms_of_service validates_acceptance_of :eula, message: 'must be abided' end If the database column does not exist, the terms_of_service attribute is entirely virtual. This check is performed only if terms_of_service is not nil and by def

unescape_bytea

unescape_bytea(value) Instance Public methods Unescapes bytea output from a database to the binary string it represents. NOTE: This is NOT an inverse of #escape_bytea! This is only to be used on escaped binary output from database drive.

to_sentence

to_sentence(options = {}) Instance Public methods Converts the array to a comma-separated sentence where the last element is joined by the connector word. You can pass the following options to change the default behavior. If you pass an option key that doesn't exist in the list below, it will raise an ArgumentError. Options :words_connector - The sign or word used to join the elements in arrays with two or more elements (default: â, â). :two_words_connector - The sign or word us

head_with_status_code_first

head_with_status_code_first() Instance Public methods

id_before_type_cast

id_before_type_cast() Instance Public methods Returns the primary key value before type cast.

inspect

inspect() Instance Public methods

reverse_merge

reverse_merge(other_hash) Instance Public methods Like merge but the other way around: Merges the receiver into the argument and returns a new hash with indifferent access as result: hash = ActiveSupport::HashWithIndifferentAccess.new hash['a'] = nil hash.reverse_merge(a: 0, b: 1) # => {"a"=>nil, "b"=>1}

load_and_configure_sdoc

load_and_configure_sdoc() Instance Public methods