Module: ObjectGraph

Defined in:
backend/app/model/ASModel_object_graph.rb

Defined Under Namespace

Modules: ClassMethods Classes: ObjectGraph

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



61
62
63
# File 'backend/app/model/ASModel_object_graph.rb', line 61

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#object_graph(opts = {}) ⇒ Object



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'backend/app/model/ASModel_object_graph.rb', line 116

def object_graph(opts = {})
  graph = ObjectGraph.new(self.class => [self.id])

  while true
    version = graph.version

    graph.models.each do |model|
      model.calculate_object_graph(graph, opts)
    end

    break unless graph.changed_since?(version)
  end

  graph
end