Changeset 1256

Show
Ignore:
Timestamp:
2008-11-15 12:49:35 (2 months ago)
Author:
gaspard
Message:

commit b355b1cfa0249ca2dd9fec0ff6bb76d037f27264
Author: Gaspard Bucher <gaspard@teti.ch>

Fixed a bug where the database was used in environment initialization (thanks Wolf Mathwig for reporting the bug).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/controllers/application.rb

    r1254 r1256  
    319319        unless valid_template?(res, opts) 
    320320          # problem during rendering, use default zafu 
    321           res = ZafuParser.new(default_zafu_template(opts[:mode]), :helper => skin_helper).render 
     321          res = ZafuParser.new(default_zafu_template(mode), :helper => skin_helper).render 
    322322        end 
    323323         
     
    916916load_models_from_plugins 
    917917load_patches_from_plugins 
     918 
     919# this has to live here in order to be loaded after Application. 
     920# FIXME: move this with 'node_query' into a plugins might be cleaner 
     921# make sure there exists a link with NULL content and id == -1 (used in queries using query order sorting) 
     922if l = Link.find_by_id(-1) 
     923  # do nothing 
     924else 
     925  Link.connection.execute "INSERT INTO #{Link.table_name} (id,target_id,source_id,status,comment) VALUES (-1,NULL,NULL,NULL,NULL)" 
     926end 
  • trunk/lib/node_query.rb

    r1250 r1256  
    88   
    99  load_custom_queries File.join(File.dirname(__FILE__), 'custom_queries') 
    10  
    11   # make sure there exists a link with NULL content and id == -1 (used in queries using query order sorting) 
    12   if l = Link.find_by_id(-1) 
    13     # do nothing 
    14   else 
    15     Link.connection.execute "INSERT INTO #{Link.table_name} (id,target_id,source_id,status,comment) VALUES (-1,NULL,NULL,NULL,NULL)" 
    16   end 
    1710   
    1811  def initialize(query, opts = {})