class ActiveScaffold::DataStructures::NestedInfo
Attributes
association[RW]
child_association[RW]
constrained_fields[RW]
param_name[RW]
parent_id[RW]
parent_model[RW]
parent_scaffold[RW]
scope[RW]
Public Class Methods
get(model, params)
click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 3 def self.get(model, params) if params[:association].nil? ActiveScaffold::DataStructures::NestedInfoScope.new(model, params) else ActiveScaffold::DataStructures::NestedInfoAssociation.new(model, params) end rescue ActiveScaffold::ControllerNotFound nil end
new(model, params)
click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 15 def initialize(model, params) @parent_scaffold = "#{params[:parent_scaffold].to_s.camelize}Controller".constantize @parent_model = @parent_scaffold.active_scaffold_config.model end
Public Instance Methods
belongs_to?()
click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 38 def belongs_to? false end
habtm?()
click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 30 def habtm? false end
has_many?()
click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 34 def has_many? false end
has_one?()
click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 42 def has_one? false end
new_instance?()
click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 24 def new_instance? result = @new_instance.nil? @new_instance = false result end
plural_association?()
click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 50 def plural_association? has_many? || habtm? end
readonly?()
click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 62 def readonly? false end
readonly_through_association?(columns)
click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 54 def readonly_through_association?(columns) false end
singular_association?()
click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 46 def singular_association? belongs_to? || has_one? end
sorted?()
click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 66 def sorted? false end
through_association?()
click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 58 def through_association? false end
to_params()
click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 20 def to_params {:parent_scaffold => parent_scaffold.controller_path} end