Class: ActiveScaffold::DataStructures::NestedInfoScope

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

#belongs_to?, get, #habtm?, #has_one?, #new_instance?, #parent_scope, #sorted?

Constructor Details

#initialize(model, nested_info) ⇒ NestedInfoScope

Returns a new instance of NestedInfoScope.



116
117
118
119
120
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 116

def initialize(model, nested_info)
  super(model, nested_info)
  @scope = nested_info[:name]
  @constrained_fields = [] 
end

Instance Method Details

#nameObject



126
127
128
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 126

def name
  self.scope
end

#to_paramsObject



122
123
124
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 122

def to_params
  super.merge(:named_scope => @scope)
end