Module: IronTrail::Model

Defined in:
lib/iron_trail/model.rb

Overview

Including this module will create something akin to:

has_many :iron_trails

But a has_many association here wouldn’t suffice, so IronTrail has its own AR reflection and association classes.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(mod) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/iron_trail/model.rb', line 10

def self.included(mod)
  mod.include ClassMethods

  ::ActiveRecord::Reflection.add_reflection(
    mod,
    :iron_trails,
    ::IronTrail::Reflection.new(:iron_trails, nil, { class_name: 'IrontrailChange' }, mod)
  )
end