Class: Marty::VwPromise
- Inherits:
-
Base
show all
- Defined in:
- app/models/marty/vw_promise.rb
Defined Under Namespace
Classes: VirtualRoot
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
get_final_attrs, get_struct_attrs, make_hash, make_openstruct, mcfly_pt
joins, old_joins
Class Method Details
.children_for_id(id, search_order) ⇒ Object
44
45
46
47
|
# File 'app/models/marty/vw_promise.rb', line 44
def self.children_for_id(id, search_order)
q = id == 'root' ? where(parent_id: nil) : find(id).children
q.live_search(search_order).order(id: :desc).includes(:children, :user)
end
|
.root ⇒ Object
40
41
42
|
# File 'app/models/marty/vw_promise.rb', line 40
def self.root
VirtualRoot.new
end
|
Instance Method Details
#leaf ⇒ Object
49
50
51
|
# File 'app/models/marty/vw_promise.rb', line 49
def leaf
children.empty?
end
|
#to_s ⇒ Object
53
54
55
|
# File 'app/models/marty/vw_promise.rb', line 53
def to_s
inspect
end
|