Module: Mongoid::Relations
- Defined in:
- lib/locomotive/mongoid/patches.rb
Overview
FIXME: github.com/benedikt/mongoid-tree/issues/58 We replace all the @_#name occurences by @_#name_ivar.
Defined Under Namespace
Instance Method Summary collapse
Instance Method Details
#reload_relations ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/locomotive/mongoid/patches.rb', line 35 def reload_relations relations.each_pair do |name, | if instance_variable_defined?("@_#{name}_ivar") if _parent.nil? || instance_variable_get("@_#{name}_ivar") != _parent remove_instance_variable("@_#{name}_ivar") end end end end |