API 0.4 Updates - work on traces pages + pagination, edit tab, some API testing

* traces - added some routes, replicated data access / pagination, but presentation and pending file control not complete
* edit - setup so that applet can be loaded + token authorisation enabled
* API - tests out ok against applet, but had to change segment-node associations
* misc - gems version required upgraded to 1.2.3 (latest stable rails version), changed some find_first to find(:first... calls
This commit is contained in:
Dan Moore 2007-03-23 23:13:19 +00:00
parent e7c2d2a211
commit d07277efba
25 changed files with 248 additions and 93 deletions

View file

@ -8,8 +8,9 @@ class Segment < ActiveRecord::Base
has_many :old_segments, :foreign_key => :id
belongs_to :user
has_one :from_node, :class_name => 'Node', :foreign_key => 'id'
has_one :to_node, :class_name => 'Node', :foreign_key => 'id'
# using belongs_to :foreign_key = 'node_*', since if use has_one :foreign_key = 'id', segment preconditions? fails checking for segment id in node table
belongs_to :from_node, :class_name => 'Node', :foreign_key => 'node_a'
belongs_to :to_node, :class_name => 'Node', :foreign_key => 'node_b'
def self.from_xml(xml, create=false)
p = XML::Parser.new