module Amoeba::InstanceMethods

Public Instance Methods

_amoeba_settings() click to toggle source
# File lib/amoeba/instance_methods.rb, line 24
def _amoeba_settings
  self.class.amoeba_block
end
_first_superclass_with_amoeba() click to toggle source
# File lib/amoeba/instance_methods.rb, line 13
def _first_superclass_with_amoeba
  return @_first_superclass_with_amoeba unless @_first_superclass_with_amoeba.nil?

  klass = self.class
  while klass.superclass < ::ActiveRecord::Base
    klass = klass.superclass
    break if klass.respond_to?(:amoeba) && klass.amoeba.enabled
  end
  @_first_superclass_with_amoeba = klass
end
_parent_amoeba() click to toggle source
# File lib/amoeba/instance_methods.rb, line 5
def _parent_amoeba
  if _first_superclass_with_amoeba.respond_to?(:amoeba)
    _first_superclass_with_amoeba.amoeba
  else
    false
  end
end
_parent_amoeba_settings() click to toggle source
# File lib/amoeba/instance_methods.rb, line 28
def _parent_amoeba_settings
  if _first_superclass_with_amoeba.respond_to?(:amoeba_block)
    _first_superclass_with_amoeba.amoeba_block
  else
    false
  end
end
amoeba_dup(options = {}) click to toggle source
# File lib/amoeba/instance_methods.rb, line 36
def amoeba_dup(options = {})
  ::Amoeba::Cloner.new(self, options).run
end