Class: CouchbaseOrm::NestedDocument

Inherits:
Document
  • Object
show all
Defined in:
lib/couchbase-orm/base.rb

Instance Method Summary collapse

Methods inherited from Document

#[], #[]=

Methods included from Encrypt

#as_json, #decode_encrypted_attributes, #encode_encrypted_attributes, #to_json

Methods included from StrictLoading

#init_strict_loading, #strict_loading!, #strict_loading?

Methods included from ActiveRecordCompat

#_has_attribute?, #_write_attribute, #attribute_for_inspect, #attribute_names, #attribute_present?, #has_attribute?, #slice, #values_at

Methods included from Changeable

#_children, #attribute_before_last_save, #changed, #changed?, #changed_attributes, #changes, #changes_applied, #children_changed?, #move_changes, #previous_changes, #reset_object!, #saved_change_to_attribute, #saved_change_to_attribute?, #setters, #will_save_change_to_attribute?

Methods included from Inspectable

#inspect

Constructor Details

#initialize(*args, **kwargs) ⇒ NestedDocument

Returns a new instance of NestedDocument.



113
114
115
116
117
118
# File 'lib/couchbase-orm/base.rb', line 113

def initialize(*args, **kwargs)
    super
    if respond_to?(:id) && id.nil?
        assign_attributes(id: SecureRandom.hex)
    end
end