Sha256: 37ca9c6b31b52253d54258d8359fc15fcb74f9196d9fd001e057521ba8e32c5c

Contents?: true

Size: 658 Bytes

Versions: 2

Compression:

Stored size: 658 Bytes

Contents

# frozen_string_literal: true

# Base test class
class ApplicationRecord < ActiveRecord::Base
  self.abstract_class = true

  extend ActsAsRecursiveTree::ActsMacro
end

class Node < ApplicationRecord
  acts_as_tree
  has_one :node_info
end

class NodeInfo < ApplicationRecord
  belongs_to :node
end

class NodeWithPolymorphicParent < ApplicationRecord
  acts_as_tree parent_key: :other_id, parent_type_column: :other_type
end

class NodeWithOtherParentKey < ApplicationRecord
  acts_as_tree parent_key: :other_id
end

class Location < ApplicationRecord
  acts_as_tree
end

class Building < Location
end

class Floor < Location
end

class Room < Location
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acts_as_recursive_tree-4.1.0 spec/db/models.rb
acts_as_recursive_tree-4.0.0 spec/db/models.rb