Module: Mongoid::List
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/mongoid/list.rb,
lib/mongoid/list/version.rb,
lib/mongoid/list/abstract.rb,
lib/mongoid/list/embedded.rb,
lib/mongoid/list/collection.rb
Overview
Defined Under Namespace
Modules: ClassMethods
Classes: Abstract, Collection, Embedded
Constant Summary
collapse
- VERSION =
"0.6.0"
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#_process_list_change ⇒ Object
Returns the value of attribute _process_list_change.
58
59
60
|
# File 'lib/mongoid/list.rb', line 58
def _process_list_change
@_process_list_change
end
|
Instance Method Details
#list_scope_changing? ⇒ Boolean
81
82
83
|
# File 'lib/mongoid/list.rb', line 81
def list_scope_changing?
@_list_scope_changing ||= (list_scoped? && changes.keys.include?(list_scope_field.to_s))
end
|
#list_scope_changing_conditions ⇒ Object
77
78
79
|
# File 'lib/mongoid/list.rb', line 77
def list_scope_changing_conditions
{ list_scope_field.to_sym => _scope_list_update_to_previous }
end
|
#list_scope_conditions ⇒ Object
73
74
75
|
# File 'lib/mongoid/list.rb', line 73
def list_scope_conditions
list_scoped? ? { list_scope_field.to_sym => list_scope_value } : {}
end
|
#list_scope_field ⇒ Object
65
66
67
|
# File 'lib/mongoid/list.rb', line 65
def list_scope_field
self.class.mongoid_list_settings[:scope]
end
|
#list_scope_value ⇒ Object
69
70
71
|
# File 'lib/mongoid/list.rb', line 69
def list_scope_value
public_send(list_scope_field)
end
|
#list_scoped? ⇒ Boolean
61
62
63
|
# File 'lib/mongoid/list.rb', line 61
def list_scoped?
self.class.mongoid_list_settings[:scoped]
end
|