Module: Shared::IsData::Metamorphosize

Extended by:
ActiveSupport::Concern
Included in:
Download
Defined in:
app/models/concerns/shared/is_data/metamorphosize.rb

Overview

Shared code for a classes that are “data” sensu TaxonWorks (things like Projects, users, and preferences are not data).

!! This module must in included last !!

Instance Method Summary collapse

Instance Method Details

#metamorphosizeObject

Returns the same object, but namespaced to the base class used many places, might be good target for optimization.

Returns:

  • (Object)

    the same object, but namespaced to the base class used many places, might be good target for optimization



12
13
14
15
# File 'app/models/concerns/shared/is_data/metamorphosize.rb', line 12

def metamorphosize
  return self if self.class.descends_from_active_record?
  self.becomes(self.class.base_class)
end