Class: Mongoid::Relations::Metadata
- Inherits:
-
Hash
- Object
- Hash
- Mongoid::Relations::Metadata
- Defined in:
- lib/mongoid/core_ext/relations/metadata.rb
Instance Method Summary collapse
-
#inspect ⇒ String
Since a lot of the information from the metadata is inferred and not explicitly stored in the hash, the inspection needs to be much more detailed.
-
#inverse_relation_candidates ⇒ Array<Metdata>
private
Get the inverse relation candidates.
-
#versioned? ⇒ true, false
Is this relation using Mongoid’s internal versioning system?.
Instance Method Details
#inspect ⇒ String
Since a lot of the information from the metadata is inferred and not explicitly stored in the hash, the inspection needs to be much more detailed.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/mongoid/core_ext/relations/metadata.rb', line 14 def inspect %(#<Mongoid::Relations::Metadata autobuild: #{autobuilding?} class_name: #{class_name} cyclic: #{cyclic.inspect} counter_cache:#{counter_cached?} dependent: #{dependent.inspect} inverse_of: #{inverse_of.inspect} key: #{key} macro: #{macro} name: #{name} order: #{order.inspect} polymorphic: #{polymorphic?} relation: #{relation} setter: #{setter} versioned: #{versioned?}> ) end |
#inverse_relation_candidates ⇒ Array<Metdata>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Get the inverse relation candidates.
55 56 57 58 59 60 |
# File 'lib/mongoid/core_ext/relations/metadata.rb', line 55 def inverse_relation_candidates .select do || next if .versioned? || .name == name .class_name == inverse_class_name end end |
#versioned? ⇒ true, false
Is this relation using Mongoid’s internal versioning system?
41 42 43 |
# File 'lib/mongoid/core_ext/relations/metadata.rb', line 41 def versioned? !!self[:versioned] end |