Class: ActiveScaffold::DataStructures::NestedInfoAssociation
- Inherits:
-
NestedInfo
show all
- Defined in:
- lib/active_scaffold/data_structures/nested_info.rb
Instance Attribute Summary
Attributes inherited from NestedInfo
#association, #child_association, #constrained_fields, #parent_id, #parent_model, #parent_scaffold, #scope
Instance Method Summary
collapse
Methods inherited from NestedInfo
get, #new_instance?, #parent_scope
Constructor Details
Returns a new instance of NestedInfoAssociation.
63
64
65
66
67
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 63
def initialize(model, session_info)
super(model, session_info)
@association = session_info[:association]
iterate_model_associations(model)
end
|
Instance Method Details
#belongs_to? ⇒ Boolean
73
74
75
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 73
def belongs_to?
association.belongs_to?
end
|
#default_sorting ⇒ Object
93
94
95
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 93
def default_sorting
association.options[:order]
end
|
#habtm? ⇒ Boolean
69
70
71
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 69
def habtm?
association.macro == :has_and_belongs_to_many
end
|
#has_one? ⇒ Boolean
77
78
79
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 77
def has_one?
association.macro == :has_one
end
|
#readonly? ⇒ Boolean
81
82
83
84
85
86
87
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 81
def readonly?
if association.options.has_key? :readonly
association.options[:readonly]
else
association.options.has_key? :through
end
end
|
#sorted? ⇒ Boolean
89
90
91
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 89
def sorted?
association.options.has_key? :order
end
|