Small improvements.
This commit is contained in:
parent
94a2dce104
commit
bad459a9a1
2 changed files with 11 additions and 2 deletions
|
@ -399,6 +399,15 @@ class App.Controller extends Spine.Controller
|
|||
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')(
|
||||
header: header,
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue