fill_breakable

fill_breakable(sep=' ', width=sep.length) Instance Public methods This is similar to breakable except the decision to break or not is determined individually. Two fill_breakable under a group may cause 4 results: (break,break), (break,non-break), (non-break,break), (non-break,non-break). This is different to breakable because two breakable under a group may cause 2 results: (break,break), (non-break,non-break). The text sep+ is inserted if a line is not broken at this point. If sep

started?

started?() Instance Public methods Returns true if the HTTP session has been started. active?

find

find(*args) Instance Public methods Find by id - This can either be a specific id (1), a list of ids (1, 5, 6), or an array of ids ([5, 6, 10]). If no record can be found for all of the listed ids, then RecordNotFound will be raised. If the primary key is an integer, find by id coerces its arguments using to_i. Person.find(1) # returns the object for ID = 1 Person.find("1") # returns the object for ID = 1 Person.find("31-sarah") # returns the object for ID = 31 Pers

beginning_of_week

beginning_of_week(start_day = Date.beginning_of_week) Instance Public methods Returns a new date/time representing the start of this week on the given day. Week is assumed to start on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. DateTime objects have their time set to 0:00. at_beginning_of_week

fatal?

fatal?() Instance Public methods Will the logger output FATAL messages?

render_to_string

render_to_string(*) Instance Public methods Overwrite #render_to_string because body can now be set to a rack body.

update

update(id, attributes) Instance Public methods Updates an object (or multiple objects) and saves it to the database, if validations pass. The resulting object is returned whether the object was saved successfully to the database or not. Parameters id - This should be the id or an array of ids to be updated. attributes - This should be a hash of attributes or an array of hashes. Examples # Updates one record Person.update(15, user_name: 'Samuel', group: 'expert') # Updates mu

new

new(*sequences) Class Public methods

connect

connect(tcp) Instance Public methods Connect to IO tcp, with context of the current certificate configuration

find

find(*args, &block) Instance Public methods Finds an object in the collection responding to the id. Uses the same rules as ActiveRecord::Base.find. Returns ActiveRecord::RecordNotFound error if the object cannot be found. class Person < ActiveRecord::Base has_many :pets end person.pets # => [ # #<Pet id: 1, name: "Fancy-Fancy", person_id: 1>, # #<Pet id: 2, name: "Spook", person_id: 1>, # #<Pet id: 3, name: "Choo-Choo", person_id: 1>