Class: ActiveScaffold::DataStructures::NestedInfo
- Inherits:
-
Object
- Object
- ActiveScaffold::DataStructures::NestedInfo
show all
- Defined in:
- lib/active_scaffold/data_structures/nested_info.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(model, params) ⇒ NestedInfo
Returns a new instance of NestedInfo.
18
19
20
21
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 18
def initialize(model, params)
@parent_scaffold = "#{params[:parent_scaffold].to_s.camelize}Controller".constantize
@parent_model = @parent_scaffold.active_scaffold_config.model
end
|
Instance Attribute Details
#association ⇒ Object
Returns the value of attribute association.
16
17
18
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 16
def association
@association
end
|
#child_association ⇒ Object
Returns the value of attribute child_association.
16
17
18
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 16
def child_association
@child_association
end
|
#constrained_fields ⇒ Object
Returns the value of attribute constrained_fields.
16
17
18
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 16
def constrained_fields
@constrained_fields
end
|
#param_name ⇒ Object
Returns the value of attribute param_name.
16
17
18
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 16
def param_name
@param_name
end
|
#parent_id ⇒ Object
Returns the value of attribute parent_id.
16
17
18
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 16
def parent_id
@parent_id
end
|
#parent_model ⇒ Object
Returns the value of attribute parent_model.
16
17
18
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 16
def parent_model
@parent_model
end
|
#parent_scaffold ⇒ Object
Returns the value of attribute parent_scaffold.
16
17
18
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 16
def parent_scaffold
@parent_scaffold
end
|
Returns the value of attribute scope.
16
17
18
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 16
def scope
@scope
end
|
Instance Method Details
#belongs_to? ⇒ Boolean
41
42
43
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 41
def belongs_to?
false
end
|
#habtm? ⇒ Boolean
33
34
35
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 33
def habtm?
false
end
|
#has_many? ⇒ Boolean
37
38
39
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 37
def has_many?
false
end
|
#has_one? ⇒ Boolean
45
46
47
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 45
def has_one?
false
end
|
#new_instance? ⇒ Boolean
27
28
29
30
31
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 27
def new_instance?
result = @new_instance.nil?
@new_instance = false
result
end
|
#plural_association? ⇒ Boolean
53
54
55
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 53
def plural_association?
has_many? || habtm?
end
|
#readonly? ⇒ Boolean
65
66
67
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 65
def readonly?
false
end
|
#readonly_through_association?(columns) ⇒ Boolean
57
58
59
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 57
def readonly_through_association?(columns)
false
end
|
#singular_association? ⇒ Boolean
49
50
51
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 49
def singular_association?
belongs_to? || has_one?
end
|
#sorted? ⇒ Boolean
69
70
71
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 69
def sorted?
false
end
|
#through_association? ⇒ Boolean
61
62
63
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 61
def through_association?
false
end
|
#to_params ⇒ Object
23
24
25
|
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 23
def to_params
{:parent_scaffold => parent_scaffold.controller_path}
end
|