Skip to content

Commit

Permalink
remove the grouping model and replace it with the generic relationshi…
Browse files Browse the repository at this point in the history
…p model

git-svn-id: svn+ssh://rubyforge.org/var/svn/biocatalogue/trunk@401 1acaf488-1b9d-4964-8077-0a2fdb83ef00
  • Loading branch information
ebontane committed Jan 30, 2009
1 parent 66f8bfd commit e7ae6da
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
2 changes: 0 additions & 2 deletions app/models/grouping.rb

This file was deleted.

2 changes: 2 additions & 0 deletions app/models/relationship.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Relationship < ActiveRecord::Base
end
12 changes: 6 additions & 6 deletions app/models/soaplab_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ def create_groupings(wsdls=[])
services = find_services_in_catalogue(wsdls)
services.each{ |service|

grouping = Grouping.new(:subject_type => service.class.to_s,
:subject_id =>service.id,
:predicate =>'BioCatalogue:memberOf',
:object_type => self.class.to_s,
:object_id =>self.id)
grouping.save!
relationship = Relationship.new(:subject_type => service.class.to_s,
:subject_id =>service.id,
:predicate =>'BioCatalogue:memberOf',
:object_type => self.class.to_s,
:object_id =>self.id)
relationship.save!
}
end

Expand Down
17 changes: 0 additions & 17 deletions db/migrate/20090129155049_create_groupings.rb

This file was deleted.

17 changes: 17 additions & 0 deletions db/migrate/20090130095555_create_relationships.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class CreateRelationships < ActiveRecord::Migration
def self.up
create_table :relationships do |t|
t.string :subject_type, :null => false
t.integer :subject_id , :null => false
t.string :predicate , :null => false
t.string :object_type , :null => false
t.integer :object_id , :null => false

t.timestamps
end
end

def self.down
drop_table :relationships
end
end
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'test_helper'

class GroupingTest < ActiveSupport::TestCase
class RelationshipTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
Expand Down

0 comments on commit e7ae6da

Please sign in to comment.