class Mongoid::SleepingKingStudios::HasTree::Parent::Metadata
Stores information about a HasTree
concern’s parent relation.
Public Instance Methods
inverse_of()
click to toggle source
The name of the tree’s children relation. If no relation name is set, defaults to :children.
@return [Symbol] The relation name.
# File lib/mongoid/sleeping_king_studios/has_tree/parent/metadata.rb, line 14 def inverse_of fetch(:inverse_of, :children) end
inverse_of?()
click to toggle source
@return [Boolean] True if a custom inverse relation name is set;
otherwise false.
# File lib/mongoid/sleeping_king_studios/has_tree/parent/metadata.rb, line 20 def inverse_of? !!self[:inverse_of] end
relation_name()
click to toggle source
The name of the tree’s parent relation. If no relation name is set, defaults to :parent.
@return [Symbol] The relation name.
# File lib/mongoid/sleeping_king_studios/has_tree/parent/metadata.rb, line 28 def relation_name fetch(:relation_name, :parent) end
relation_name?()
click to toggle source
@return [Boolean] True if a custom relation name is set; otherwise
false.
# File lib/mongoid/sleeping_king_studios/has_tree/parent/metadata.rb, line 34 def relation_name? !!self[:relation_name] end