Module: Mongoid::Components

Extended by:
ActiveSupport::Concern
Includes:
ActiveModel::Conversion, ActiveModel::MassAssignmentSecurity, ActiveModel::Naming, ActiveModel::Observing, ActiveModel::Serializers::JSON, ActiveModel::Serializers::Xml, Atomic, Attributes, Callbacks, Copyable, Dirty, Equality, Evolvable, Fields, Hierarchy, Indexes, Inspection, JSON, Matchers, NestedAttributes, Persistence, Relations, Reloading, Scoping, Serialization, Sessions, Sharding, State, Threaded::Lifecycle, Timestamps::Timeless, Validations
Included in:
Document
Defined in:
lib/mongoid/components.rb

Constant Summary collapse

MODULES =
[
  Mongoid::Atomic,
  Mongoid::Attributes,
  Mongoid::Callbacks,
  Mongoid::Copyable,
  Mongoid::Dirty,
  Mongoid::Evolvable,
  Mongoid::Fields,
  Mongoid::Hierarchy,
  Mongoid::Indexes,
  Mongoid::Inspection,
  Mongoid::JSON,
  Mongoid::Matchers,
  Mongoid::NestedAttributes,
  Mongoid::Persistence,
  Mongoid::Relations,
  Mongoid::Reloading,
  Mongoid::Scoping,
  Mongoid::Serialization,
  Mongoid::Sessions,
  Mongoid::Sharding,
  Mongoid::State,
  Mongoid::Threaded::Lifecycle,
  Mongoid::Timestamps::Timeless,
  Mongoid::Validations,
  Mongoid::Equality
]

Constants included from Callbacks

Mongoid::Callbacks::CALLBACKS

Constants included from Atomic

Atomic::UPDATES

Instance Attribute Summary

Attributes included from State

#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 Callbacks

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

Methods included from Validations

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

Methods included from Timestamps::Timeless

#timeless, #timestamping?

Methods included from State

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

Methods included from Sharding

#shard_key_fields, #shard_key_selector

Methods included from Serialization

#serializable_hash

Methods included from Sessions

clear, #collection, #collection_name, default, disconnect, #mongo_session, #with, with_name

Methods included from Reloading

#reload

Methods included from Relations

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

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

#autosaved?, #begin_autosave, #exit_autosave

Methods included from Relations::Accessors

#__build__, #create_relation, #relation_exists?, #reset_relation_criteria, #set_relation

Methods included from Persistence

#destroy, #insert, #remove, #save, #save!, #touch, #update, #update_attribute, #update_attributes, #update_attributes!, #upsert

Methods included from Atomic::Positionable

#positionally

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_selector, #atomic_sets, #atomic_unsets, #atomic_updates, #delayed_atomic_pulls, #delayed_atomic_sets, #delayed_atomic_unsets, #flag_as_destroyed, #flagged_destroys, #process_flagged_destroys

Methods included from Matchers

#matches?

Methods included from Inspection

#inspect

Methods included from Hierarchy

#_children, #_root, #_root?, #collect_children, #flag_children_persisted, #hereditary?, #parentize, #remove_child, #reset_persisted_children

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_present?, #attributes_before_type_cast, #has_attribute?, #has_attribute_before_type_cast?, #read_attribute, #read_attribute_before_type_cast, #remove_attribute, #respond_to?, #write_attribute, #write_attributes

Methods included from Attributes::Readonly

#attribute_writable?

Methods included from Attributes::Processing

#process_attributes

Methods included from Dirty

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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Mongoid::Attributes

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



86
87
88
89
90
# File 'lib/mongoid/components.rb', line 86

def prohibited_methods
  @prohibited_methods ||= MODULES.flat_map do |mod|
    mod.instance_methods.map{ |m| m.to_sym }
  end
end