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, Collections, Copyable, DefaultScope, Dirty, Extras, Fields, Hierarchy, Indexes, Inspection, JSON, Keys, Matchers, MultiDatabase, NamedScope, NestedAttributes, Persistence, Relations, Reloading, Safety, Serialization, Sharding, State, Threaded::Lifecycle, Timestamps::Timeless, Validations
Included in:
Document
Defined in:
lib/mongoid/components.rb

Overview

:nodoc

Constant Summary collapse

MODULES =
[
  Mongoid::Atomic,
  Mongoid::Attributes,
  Mongoid::Collections,
  Mongoid::Copyable,
  Mongoid::DefaultScope,
  Mongoid::Dirty,
  Mongoid::Extras,
  Mongoid::Fields,
  Mongoid::Hierarchy,
  Mongoid::Indexes,
  Mongoid::Inspection,
  Mongoid::JSON,
  Mongoid::Keys,
  Mongoid::Matchers,
  Mongoid::NamedScope,
  Mongoid::NestedAttributes,
  Mongoid::Persistence,
  Mongoid::Relations,
  Mongoid::Relations::Proxy,
  Mongoid::Safety,
  Mongoid::Serialization,
  Mongoid::Sharding,
  Mongoid::State,
  Mongoid::Validations,
  Mongoid::Callbacks,
  Mongoid::MultiDatabase,
]

Constants included from Callbacks

Mongoid::Callbacks::CALLBACKS

Constants included from Copyable

Mongoid::Copyable::COPYABLES

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 Keys

#identifier

Attributes included from Attributes

#attributes

Class Method Summary collapse

Methods included from Callbacks

#run_callbacks

Methods included from Validations

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

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

mongoize, #serializable_hash

Methods included from Safety

merge_safety_options, #safely, #unsafely

Methods included from Reloading

#reload

Methods included from Relations

#embedded?, #embedded_many?, #embedded_one?, #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::Accessors

#build, #create_relation, #relation_exists?, #set_relation

Methods included from Persistence

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

Methods included from Persistence::Atomic

#add_to_set, #bit, #inc, #pop, #pull, #pull_all, #push, #push_all, #rename, #set, #unset

Methods included from Matchers

#matches?

Methods included from Keys

#primary_key, #using_object_ids?

Methods included from Inspection

#inspect

Methods included from Hierarchy

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

Methods included from Fields

#apply_default, #apply_defaults, #apply_non_proc_defaults, #apply_proc_defaults, #defaults, option, options

Methods included from Collections

#collection, #db

Methods included from Attributes

#assign_attributes, #attribute_present?, #read_attribute, #remove_attribute, #respond_to?, #write_attribute, #write_attributes

Methods included from Attributes::Processing

#process

Methods included from Dirty

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

Methods included from Atomic

#add_atomic_pull, #atomic_array_add_to_sets, #atomic_array_pulls, #atomic_array_pushes, #atomic_delete_modifier, #atomic_insert_modifier, #atomic_path, #atomic_position, #atomic_pulls, #atomic_pushes, #atomic_selector, #atomic_sets, #atomic_unsets, #atomic_updates, #delayed_atomic_pulls, #delayed_atomic_sets

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



90
91
92
93
94
95
96
# File 'lib/mongoid/components.rb', line 90

def prohibited_methods
  @prohibited_methods ||= MODULES.inject([]) do |methods, mod|
    methods.tap do |mets|
      mets << mod.instance_methods.map{ |m| m.to_sym }
    end
  end.flatten
end