Module: ToModelHash

Extended by:
ActiveSupport::Concern
Included in:
ApplicationRecord
Defined in:
lib/extensions/ar_to_model_hash.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#to_model_hash(options = nil) ⇒ Object


45
46
47
48
49
# File 'lib/extensions/ar_to_model_hash.rb', line 45

def to_model_hash(options = nil)
  options ||= self.class.to_model_hash_options
  MiqPreloader.preload(self, to_model_hash_build_preload(options))
  to_model_hash_recursive(options)
end

#to_model_yaml(options = nil) ⇒ Object


51
52
53
# File 'lib/extensions/ar_to_model_hash.rb', line 51

def to_model_yaml(options = nil)
  to_model_hash(options).to_yaml
end