Module: Arable::ActiveRecordExtension

Defined in:
lib/arable.rb

Instance Method Summary collapse

Instance Method Details

#inherited(subclass) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/arable.rb', line 45

def inherited(subclass)
  super

  subclass.extend(Arable::ClassMethods)

  # include Arable only when the class has finished defining itself
  TracePoint.trace(:end) do |trace|
    if subclass == trace.self
      subclass.include(Arable)
      trace.disable
    end
  end
end