Class: ActiveScaffold::DataStructures::Association::Mongoid
- Inherits:
-
Abstract
show all
- Defined in:
- lib/active_scaffold/data_structures/association/mongoid.rb
Instance Attribute Summary
Attributes inherited from Abstract
#reverse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Abstract
#allow_join?, #as, #belongs_to?, #collection?, #counter_cache_hack?, #habtm?, #has_many?, #has_one?, #initialize, #inverse_for?, #klass, #readonly?, #respond_to_target?, #reverse_association, #scope, #singular?, #source_reflection, #through?, #through_collection?, #through_reflection, #through_singular?
Class Method Details
.reflect_on_all_associations(klass) ⇒ Object
38
39
40
|
# File 'lib/active_scaffold/data_structures/association/mongoid.rb', line 38
def self.reflect_on_all_associations(klass)
klass.relations.values
end
|
Instance Method Details
#association_primary_key ⇒ Object
14
15
16
|
# File 'lib/active_scaffold/data_structures/association/mongoid.rb', line 14
def association_primary_key
@association.primary_key
end
|
#counter_cache ⇒ Object
22
23
24
|
# File 'lib/active_scaffold/data_structures/association/mongoid.rb', line 22
def counter_cache
@association[:counter_cache]
end
|
#foreign_type ⇒ Object
18
19
20
|
# File 'lib/active_scaffold/data_structures/association/mongoid.rb', line 18
def foreign_type
@association.type
end
|
#polymorphic? ⇒ Boolean
6
7
8
|
# File 'lib/active_scaffold/data_structures/association/mongoid.rb', line 6
def polymorphic?
belongs_to? && @association.polymorphic?
end
|
#primary_key ⇒ Object
10
11
12
|
# File 'lib/active_scaffold/data_structures/association/mongoid.rb', line 10
def primary_key
@association[:primary_key]
end
|
#quoted_primary_key ⇒ Object
34
35
36
|
# File 'lib/active_scaffold/data_structures/association/mongoid.rb', line 34
def quoted_primary_key
'_id'
end
|
#quoted_table_name ⇒ Object
30
31
32
|
# File 'lib/active_scaffold/data_structures/association/mongoid.rb', line 30
def quoted_table_name
table_name
end
|
#table_name ⇒ Object
26
27
28
|
# File 'lib/active_scaffold/data_structures/association/mongoid.rb', line 26
def table_name
@association.klass.collection.name
end
|