Small improvements.

This commit is contained in:
Martin Edenhofer 2012-05-18 17:32:06 +02:00
parent 94a2dce104
commit bad459a9a1
2 changed files with 11 additions and 2 deletions

View file

@ -398,6 +398,15 @@ class App.Controller extends Spine.Controller
# execute callback on content
if row.callback
object[row.name]['name'] = row.callback(object[row.name]['name'])
# lookup relation
if !object[row.name]['name']
rowWithoutId = row.name + '_id'
for attribute in attributes
if rowWithoutId is attribute.name
if attribute.relation && App[attribute.relation]
record = App[attribute.relation].find( object[rowWithoutId] )
object[row.name]['name'] = record.name
# @log 'table', 'header', header, 'overview', data_types, 'objects', objects
table = App.view('generic/table')(

View file

@ -134,11 +134,11 @@ class SessionsController < ApplicationController
default_collection['Group'] = Group.all
default_collection['Organization'] = Organization.all
# load routes from external files
# load collections to deliver from external files
dir = File.expand_path('../', __FILE__)
files = Dir.glob( "#{dir}/sessions/collection_*.rb" )
for file in files
require file
load file
ExtraCollection.add(default_collection)
end