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_many?, #has_one?, #new_instance?, #parent_scope, #plural_association?, #readonly?, #singular_association?, #sorted?, #through_association?

Constructor Details

#initialize(model, nested_info) ⇒ NestedInfoScope

Returns a new instance of NestedInfoScope.



157
158
159
160
161
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 157

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

Instance Method Details

#nameObject



167
168
169
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 167

def name
  self.scope
end

#to_paramsObject



163
164
165
# File 'lib/active_scaffold/data_structures/nested_info.rb', line 163

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