Module: ClassInheritableAttributes

Included in:
ActiveRecord::Base
Defined in:
lib/active_record/support/class_inheritable_attributes.rb

Overview

Allows attributes to be shared within an inheritance hierarchy, but where each descentent gets a copy of their parents’ attributes, instead of just a pointer to the same. This means that the child can add elements to, for example, an array without those additions being shared with either their parent, siblings, or children, which is unlike the regular class-level attributes that are shared across the entire hierarchy.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.append_features(base) ⇒ Object

:nodoc:



6
7
8
9
# File 'lib/active_record/support/class_inheritable_attributes.rb', line 6

def self.append_features(base)
  super
  base.extend(ClassMethods)
end