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)
  nested_info = {}
  begin
    unless params[:association].nil?
      ActiveScaffold::DataStructures::NestedInfoAssociation.new(model, params)
    else
      ActiveScaffold::DataStructures::NestedInfoScope.new(model, params)
    end
  rescue ActiveScaffold::ControllerNotFound
    nil
  end
end
new(model, params) click to toggle source
# 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

Public Instance Methods

belongs_to?() click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 41
def belongs_to?
  false
end
habtm?() click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 33
def habtm?
  false 
end
has_many?() click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 37
def has_many?
  false
end
has_one?() click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 45
def has_one?
  false
end
new_instance?() click to toggle source
# 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?() click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 53
def plural_association?
  has_many? || habtm?
end
readonly?() click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 65
def readonly?
  false
end
readonly_through_association?() click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 57
def readonly_through_association?
  false
end
singular_association?() click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 49
def singular_association?
  belongs_to? || has_one?
end
sorted?() click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 69
def sorted?
  false
end
through_association?() click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 61
def through_association?
  false
end
to_params() click to toggle source
# File lib/active_scaffold/data_structures/nested_info.rb, line 23
def to_params
  {:parent_scaffold => parent_scaffold.controller_path}
end