Module: Shared::IsData::Metamorphosize

Extended by:
ActiveSupport::Concern
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).

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



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

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