Class: ActsAsOrderedTree::Relation::Preloaded

Inherits:
Base
  • Object
show all
Defined in:
lib/acts_as_ordered_tree/relation/preloaded.rb

Overview

Common relation, but with already loaded records

Constant Summary

Constants inherited from Base

Base::EMPTY_SCOPE_METHOD

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from ActsAsOrderedTree::Relation::Base

Instance Method Details

#records(records) ⇒ Object

Set loaded records to records


8
9
10
11
12
13
# File 'lib/acts_as_ordered_tree/relation/preloaded.rb', line 8

def records(records)
  relation = clone
  relation.instance_variable_set :@records, records
  relation.instance_variable_set :@loaded,  true
  relation
end