Mailinglist Archive: yast-commit (883 mails)

< Previous Next >
[yast-commit] <rest-service> master : Remove unused domain/resource model
  • From: Klaus Kämpf <kkaempf@xxxxxxx>
  • Date: Mon, 6 Jul 2009 15:37:54 +0200
  • Message-id: <E1MNoPs-0006jU-UK@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit f12f833da555453beded2d7c9018d5789ffda190
Author: Klaus Kämpf <kkaempf@xxxxxxx>
Date: Mon Jul 6 15:37:54 2009 +0200

Remove unused domain/resource model

This is obsolete code since weeks. Resources are created at run-time by
reading config/resources/<name>.yml
---
webservice/app/models/domain.rb | 6 ----
webservice/app/models/resource.rb | 6 ----
.../db/migrate/20090417104517_create_domains.rb | 11 -------
.../db/migrate/20090417104522_create_resources.rb | 14 ---------
webservice/test/fixtures/domains.yml | 14 ---------
webservice/test/fixtures/resources.yml | 31 --------------------
webservice/test/unit/domain_test.rb | 22 --------------
webservice/test/unit/resource_test.rb | 13 --------
8 files changed, 0 insertions(+), 117 deletions(-)

diff --git a/webservice/app/models/domain.rb b/webservice/app/models/domain.rb
deleted file mode 100644
index ba1f272..0000000
--- a/webservice/app/models/domain.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-class Domain < ActiveRecord::Base
- has_many :resources
- def to_s
- name
- end
-end
diff --git a/webservice/app/models/resource.rb
b/webservice/app/models/resource.rb
deleted file mode 100644
index 9fe046e..0000000
--- a/webservice/app/models/resource.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-class Resource < ActiveRecord::Base
- belongs_to :domain
- def to_s
- name
- end
-end
diff --git a/webservice/db/migrate/20090417104517_create_domains.rb
b/webservice/db/migrate/20090417104517_create_domains.rb
deleted file mode 100644
index 104b8b2..0000000
--- a/webservice/db/migrate/20090417104517_create_domains.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-class CreateDomains < ActiveRecord::Migration
- def self.up
- create_table :domains do |t|
- t.string :name
- end
- end
-
- def self.down
- drop_table :domains
- end
-end
diff --git a/webservice/db/migrate/20090417104522_create_resources.rb
b/webservice/db/migrate/20090417104522_create_resources.rb
deleted file mode 100644
index 0304751..0000000
--- a/webservice/db/migrate/20090417104522_create_resources.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-class CreateResources < ActiveRecord::Migration
- def self.up
- create_table :resources do |t|
- t.string :name
- t.text :url
- t.boolean :singular, :default => false
- t.references :domain
- end
- end
-
- def self.down
- drop_table :resources
- end
-end
diff --git a/webservice/test/fixtures/domains.yml
b/webservice/test/fixtures/domains.yml
deleted file mode 100644
index 1e9dc75..0000000
--- a/webservice/test/fixtures/domains.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# test/fixtures/domains.yml
-#
-network:
- id: 1
- name: network
-
-printer:
- id: 2
- name: printer
-
-storage:
- id: 3
- name: storage
diff --git a/webservice/test/fixtures/resources.yml
b/webservice/test/fixtures/resources.yml
deleted file mode 100644
index cbff9b5..0000000
--- a/webservice/test/fixtures/resources.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# test/fixtures/resources.yml
-#
-
-network_routes:
- name: routes
- domain_id: 1
-
-network_interfaces:
- name: interfaces
- domain_id: 1
-
-network_devices:
- name: devices
- domain_id: 1
-
-printer_queues:
- name: queues
- domain_id: 2
-
-printer_devices:
- name: devices
- domain_id: 2
-
-storage_devices:
- name: devices
- domain_id: 3
-
-storage_partitions:
- name: partitions
- domain_id: 3
diff --git a/webservice/test/unit/domain_test.rb
b/webservice/test/unit/domain_test.rb
deleted file mode 100644
index f0636b7..0000000
--- a/webservice/test/unit/domain_test.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require 'test_helper'
-
-class DomainTest < ActiveSupport::TestCase
- fixtures :domains
-
- # simple Domain tests
- # assume 3 fixture entries
-
- test "domain table" do
- network = Domain.find(1)
- assert network
- # to_s should return the name
- assert network.to_s == network.name
-
- printer = Domain.find(2)
- assert printer
-
- storage = Domain.find(3)
- assert storage
- end
-end
-
\ No newline at end of file
diff --git a/webservice/test/unit/resource_test.rb
b/webservice/test/unit/resource_test.rb
deleted file mode 100644
index e1572b4..0000000
--- a/webservice/test/unit/resource_test.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require 'test_helper'
-
-class ResourceTest < ActiveSupport::TestCase
- fixtures :domains, :resources
-
- test "resource table" do
- network = Domain.find(1)
- # FIXME: should be 'find_by_name_and_domain' -> Rails 2.3 regression ?
- network_routes = Resource.find_by_name_and_domain_id("routes", network)
- assert network_routes
- assert network_routes.domain == network
- end
-end
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages