abstract_class?

abstract_class?() Instance Public methods Returns whether this class is an abstract class or not.

base_class

base_class() Instance Public methods Returns the class descending directly from ActiveRecord::Base, or an abstract class, if any, in the inheritance hierarchy. If A extends AR::Base, A.base_class will return A. If B descends from A through some arbitrarily deep hierarchy, B.base_class will return A. If B < A and C < B and if A is an #abstract_class then both B.base_class and C.base_class would return B as the answer since A is an abstract_class.

descends_from_active_record?

descends_from_active_record?() Instance Public methods Returns true if this does not need STI type condition. Returns false if STI type condition needs to be applied.

new

new(*args, &block) Instance Public methods Determines if one of the attributes passed in is the inheritance column, and if the inheritance column is attr accessible, it initializes an instance of the given subclass instead of the base class.

sti_name

sti_name() Instance Public methods

symbolized_base_class

symbolized_base_class() Instance Public methods

symbolized_sti_name

symbolized_sti_name() Instance Public methods

compute_type

compute_type(type_name) Instance Protected methods Returns the class type of the record using the current module as a prefix. So descendants of MyApp::Business::Account would appear as MyApp::Business::AccountSubclass.

initialize_dup

initialize_dup(other) Instance Public methods

to_param

to_param(method_name = nil) Instance Public methods Defines your model's to_param method to generate âprettyâ URLs using method_name, which can be any attribute or method that responds to to_s. class User < ActiveRecord::Base to_param :name end user = User.find_by(name: 'Fancy Pants') user.id # => 123 user_path(user) # => "/users/123-fancy-pants" Values longer than 20 characters will be truncated. The value is truncated word by word. user = User.find_by(name: '