Module: CapsuleCRM::Querying::FindOne
- Extended by:
- ActiveSupport::Concern
- Included in:
- History
- Defined in:
- lib/capsule_crm/querying/find_one.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#reload ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/capsule_crm/querying/find_one.rb', line 13 def reload self.class.find(id).tap do |latest| self.attributes = latest.attributes self.contacts = latest.contacts if respond_to?(:contacts) end associations.keys.each do |association_name| instance_variable_set(:"@#{association_name}", nil) end self end |