cache_fixtures

cache_fixtures(connection, fixtures_map) Class Public methods

human

human(rule, replacement) Instance Public methods Specifies a humanized form of a string by a regular expression rule or by a string mapping. When using a regular expression based replacement, the normal humanize formatting is called after the replacement. When a string is used, the human form should be specified as desired (example: 'The name', not 'the_name'). human /_cnt$/i, '\1_count' human 'legacy_col_person_name', 'Name'

cleanup

cleanup(options = nil) Instance Public methods Cleanup the cache by removing expired entries. Options are passed to the underlying cache implementation. All implementations may not support this method.

convert_to_model

convert_to_model(object) Instance Public methods Converts the given object to an ActiveModel compliant one.

define_attribute_methods

define_attribute_methods(*attr_names) Instance Public methods Declares the attributes that should be prefixed and suffixed by ActiveModel::AttributeMethods. To use, pass attribute names (as strings or symbols), be sure to declare define_attribute_methods after you define any prefix, suffix or affix methods, or they will not hook in. class Person include ActiveModel::AttributeMethods attr_accessor :name, :age, :address attribute_method_prefix 'clear_' # Call to define_attr

remove

remove(conn) Instance Public methods Remove a connection from the connection pool. The connection will remain open and active but will no longer be managed by this pool.

[]

[](key) Instance Public methods

select

select(*fields, &block) Instance Public methods Works in two ways. First: Specify a subset of fields to be selected from the result set. 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> # ] person.pets.select(:name) # => [ # #<Pet id: nil, name: "Fancy-Fa

each

each(&block) Instance Public methods

persisted?

persisted?() Instance Public methods Returns true if the record is persisted, i.e. it's not a new record and it was not destroyed, otherwise returns false.