Class: ActiveScaffold::DataStructures::Association::ActiveRecord
- Inherits:
-
Abstract
- Object
- Abstract
- ActiveScaffold::DataStructures::Association::ActiveRecord
show all
- Defined in:
- lib/active_scaffold/data_structures/association/active_record.rb
Instance Attribute Summary
Attributes inherited from Abstract
#reverse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Abstract
#allow_join?, #belongs_to?, #cache_count?, #collection?, #counter_cache, #counter_cache_hack?, #habtm?, #has_many?, #has_one?, #initialize, #inverse_for?, #klass, #nested?, #polymorphic?, #primary_key, #reverse_association, #scope, #singular?, #through_collection?, #through_singular?
Class Method Details
.reflect_on_all_associations(klass) ⇒ Object
5
6
7
|
# File 'lib/active_scaffold/data_structures/association/active_record.rb', line 5
def self.reflect_on_all_associations(klass)
klass.reflect_on_all_associations
end
|
Instance Method Details
31
32
33
|
# File 'lib/active_scaffold/data_structures/association/active_record.rb', line 31
def as
@association.options[:as]
end
|
#dependent ⇒ Object
35
36
37
|
# File 'lib/active_scaffold/data_structures/association/active_record.rb', line 35
def dependent
@association.options[:dependent]
end
|
40
41
42
|
# File 'lib/active_scaffold/data_structures/association/active_record.rb', line 40
def inverse
@association.inverse_of&.name
end
|
#inverse_klass ⇒ Object
27
28
29
|
# File 'lib/active_scaffold/data_structures/association/active_record.rb', line 27
def inverse_klass
@association.active_record
end
|
#quoted_primary_key ⇒ Object
48
49
50
|
# File 'lib/active_scaffold/data_structures/association/active_record.rb', line 48
def quoted_primary_key
@association.klass.quoted_primary_key
end
|
#quoted_table_name ⇒ Object
44
45
46
|
# File 'lib/active_scaffold/data_structures/association/active_record.rb', line 44
def quoted_table_name
@association.klass.quoted_table_name
end
|
#readonly? ⇒ Boolean
15
16
17
|
# File 'lib/active_scaffold/data_structures/association/active_record.rb', line 15
def readonly?
scope_values[:readonly]
end
|
#respond_to_target? ⇒ Boolean
52
53
54
|
# File 'lib/active_scaffold/data_structures/association/active_record.rb', line 52
def respond_to_target?
true
end
|
#source_reflection ⇒ Object
23
24
25
|
# File 'lib/active_scaffold/data_structures/association/active_record.rb', line 23
def source_reflection
@association.source_reflection if through?
end
|
#through? ⇒ Boolean
11
12
13
|
# File 'lib/active_scaffold/data_structures/association/active_record.rb', line 11
def through?
@association.options[:through].present?
end
|
#through_reflection ⇒ Object
19
20
21
|
# File 'lib/active_scaffold/data_structures/association/active_record.rb', line 19
def through_reflection
@association.through_reflection if through?
end
|