change_column_null

change_column_null(table_name, column_name, null, default = nil) Instance Public methods Sets or removes a +NOT NULL+ constraint on a column. The null flag indicates whether the value can be NULL. For example change_column_null(:users, :nickname, false) says nicknames cannot be NULL (adds the constraint), whereas change_column_null(:users, :nickname, true) allows them to be NULL (drops the constraint). The method accepts an optional fourth argument to replace existing +NULL+s wit

table_alias_length

table_alias_length() Instance Public methods Returns the maximum length of a table alias.

capture

capture(stream) Instance Public methods Captures the given stream and returns it: stream = capture(:stdout) { puts 'notice' } stream # => "notice\n" stream = capture(:stderr) { warn 'error' } stream # => "error\n" even for subprocesses: stream = capture(:stdout) { system('echo notice') } stream # => "notice\n" stream = capture(:stderr) { system('echo error 1>&2') } stream # => "error\n" silence

initialize_copy

initialize_copy(other) Instance Public methods

process_attributes_for

process_attributes_for(node, options) Instance Protected methods

generate_method_for_mime

generate_method_for_mime(mime) Class Public methods

new

new(app, check_ip_spoofing = true, custom_proxies = nil) Class Public methods Create a new RemoteIp middleware instance. The check_ip_spoofing option is on by default. When on, an exception is raised if it looks like the client is trying to lie about its own IP address. It makes sense to turn off this check on sites aimed at non-IP clients (like WAP devices), or behind proxies that set headers in an incorrect or confusing way (like AWS ELB). The custom_proxies argument can take a r

rename_index

rename_index(table_name, old_name, new_name) Instance Public methods

to_f

to_f() Instance Public methods Converts self to a floating-point number of seconds since the Unix epoch.

seconds_to_utc_offset

seconds_to_utc_offset(seconds, colon = true) Class Public methods Assumes self represents an offset from UTC in seconds (as returned from Time#utc_offset) and turns this into an +HH:MM formatted string. TimeZone.seconds_to_utc_offset(-21_600) # => "-06:00"