Method: OceanDynamo::HasMany#reload
- Defined in:
- lib/ocean-dynamo/associations/has_many.rb
#reload ⇒ Object
Sets all has_many relations to nil.
100 101 102 103 104 105 106 107 108 109 |
# File 'lib/ocean-dynamo/associations/has_many.rb', line 100 def reload(*) result = super self.class.relations_of_type(:has_many).each do |klass| attr_name = klass.to_s.pluralize.underscore instance_variable_set("@#{attr_name}", nil) end result end |