Module: Mongoid::Composable

Extended by:
ActiveSupport::Concern
Includes:
ActiveModel::ForbiddenAttributesProtection, ActiveModel::Model, ActiveModel::Serializers::JSON, ActiveModel::Serializers::Xml, Atomic, Attributes, Changeable, Clients, Copyable, Equality, Evolvable, Fields, Indexable, Inspectable, Interceptable, Matchable, Persistable, Relations, Reloadable, Scopable, Selectable, Serializable, Shardable, Stateful, Threaded::Lifecycle, Traversable, Validatable
Included in:
Document
Defined in:
lib/mongoid/composable.rb

Overview

This module provides inclusions of all behaviour in a Mongoid document.

Since:

  • 4.0.0

Constant Summary collapse

MODULES =

Since:

  • 4.0.0

[
  Atomic,
  Attributes,
  Copyable,
  Changeable,
  Evolvable,
  Fields,
  Indexable,
  Inspectable,
  Interceptable,
  Matchable,
  Persistable,
  Relations,
  Reloadable,
  Scopable,
  Serializable,
  Clients,
  Shardable,
  Stateful,
  Threaded::Lifecycle,
  Traversable,
  Validatable,
  Equality,
  ActiveModel::Model,
  ActiveModel::Validations
]

Constants included from Interceptable

Interceptable::CALLBACKS

Constants included from Persistable

Persistable::LIST_OPERATIONS

Constants included from Matchable

Matchable::MATCHERS

Constants included from Fields

Fields::IDS, Fields::TYPE_MAPPINGS

Constants included from Atomic

Atomic::UPDATES

Instance Attribute Summary

Attributes included from Stateful

#destroyed, #flagged_for_destroy, #new_record

Attributes included from Relations

#__metadata

Attributes included from Attributes

#attributes

Class Method Summary collapse

Methods included from Equality

#<=>, #==, #===, #eql?

Methods included from Copyable

#clone

Methods included from Interceptable

#callback_executable?, #in_callback_state?, #run_after_callbacks, #run_before_callbacks, #run_callbacks

Methods included from Validatable

#begin_validate, #exit_validate, #performing_validations?, #read_attribute_for_validation, #valid?, #validated?, #validating_with_query?

Methods included from Traversable

#_children, #_parent, #_parent=, #_reset_memoized_children!, #_root, #_root?, #collect_children, #flag_children_persisted, #hereditary?, #parentize, #remove_child, #reset_persisted_children

Methods included from Stateful

#destroyed?, #flagged_for_destroy?, #new_record?, #persisted?, #pushable?, #readonly?, #settable?, #updateable?

Methods included from Shardable

#shard_key_fields, #shard_key_selector

Methods included from Serializable

#serializable_hash

Methods included from Selectable

#atomic_selector

Methods included from Reloadable

#reload

Methods included from Relations

#embedded?, #embedded_many?, #embedded_one?, #metadata_name, #referenced_many?, #referenced_one?, #reload_relations

Methods included from Relations::CounterCache

#reset_counters

Methods included from Relations::Touchable

#touch

Methods included from Relations::Synchronization

#remove_inverse_keys, #syncable?, #synced, #synced?, #update_inverse_keys

Methods included from Relations::Reflections

#reflect_on_all_associations, #reflect_on_association

Methods included from Relations::Macros

#associations

Methods included from Relations::Cascading

#cascade!

Methods included from Relations::AutoSave

#__autosaving__, #autosaved?, #changed_for_autosave?

Methods included from Relations::Accessors

#__build__, #create_relation, #reset_relation_criteria, #set_relation

Methods included from Persistable

#atomically, #fail_due_to_callback!, #fail_due_to_validation!

Methods included from Persistable::Unsettable

#unset

Methods included from Persistable::Upsertable

#upsert

Methods included from Persistable::Updatable

#update, #update!, #update_attribute

Methods included from Persistable::Settable

#set

Methods included from Persistable::Savable

#save, #save!

Methods included from Persistable::Renamable

#rename

Methods included from Persistable::Pushable

#add_to_set, #push

Methods included from Persistable::Pullable

#pull, #pull_all

Methods included from Persistable::Poppable

#pop

Methods included from Persistable::Logical

#bit

Methods included from Persistable::Incrementable

#inc

Methods included from Persistable::Destroyable

#destroy, #destroy!

Methods included from Persistable::Deletable

#delete

Methods included from Persistable::Creatable

#insert

Methods included from Matchable

matcher, #matches?

Methods included from Inspectable

#inspect

Methods included from Fields

#apply_default, #apply_defaults, #apply_post_processed_defaults, #apply_pre_processed_defaults, #attribute_names, #database_field_name, #lazy_settable?, option, options, #using_object_ids?

Methods included from Evolvable

#__evolve_object_id__

Methods included from Attributes

#assign_attributes, #attribute_missing?, #attribute_present?, #attributes_before_type_cast, #has_attribute?, #has_attribute_before_type_cast?, #read_attribute, #read_attribute_before_type_cast, #remove_attribute, #write_attribute, #write_attributes

Methods included from Attributes::Readonly

#attribute_writable?

Methods included from Attributes::Processing

#process_attributes

Methods included from Clients

clear, clients, #collection, #collection_name, default, disconnect, #mongo_client, set, with_name

Methods included from Mongoid::Clients::Options

#collection_name, #mongo_client, #persistence_options, #with

Methods included from Changeable

#changed, #changed?, #changed_attributes, #changes, #children_changed?, #move_changes, #post_persist, #previous_changes, #remove_change, #setters

Methods included from Atomic

#add_atomic_pull, #add_atomic_unset, #atomic_array_add_to_sets, #atomic_array_pulls, #atomic_array_pushes, #atomic_attribute_name, #atomic_delete_modifier, #atomic_insert_modifier, #atomic_path, #atomic_paths, #atomic_position, #atomic_pulls, #atomic_pushes, #atomic_sets, #atomic_unsets, #atomic_updates, #delayed_atomic_pulls, #delayed_atomic_sets, #delayed_atomic_unsets, #flag_as_destroyed, #flagged_destroys, #process_flagged_destroys

Class Method Details

.prohibited_methodsArray<Symbol>

Get a list of methods that would be a bad idea to define as field names or override when including Mongoid::Document.

Examples:

Bad thing!

Mongoid::Components.prohibited_methods

Returns:

Since:

  • 2.1.8



98
99
100
101
102
# File 'lib/mongoid/composable.rb', line 98

def prohibited_methods
  @prohibited_methods ||= MODULES.flat_map do |mod|
    mod.instance_methods.map(&:to_sym)
  end
end