rename Project to Group
authorTom Clegg <tom@clinicalfuture.com>
Wed, 13 Mar 2013 22:34:00 +0000 (15:34 -0700)
committerTom Clegg <tom@clinicalfuture.com>
Wed, 13 Mar 2013 23:24:26 +0000 (16:24 -0700)
15 files changed:
app/assets/javascripts/groups.js.coffee [moved from app/assets/javascripts/projects.js.coffee with 100% similarity]
app/assets/stylesheets/groups.css.scss [moved from app/assets/stylesheets/projects.css.scss with 63% similarity]
app/controllers/orvos/v1/groups_controller.rb [new file with mode: 0644]
app/controllers/orvos/v1/projects_controller.rb [deleted file]
app/helpers/groups_helper.rb [new file with mode: 0644]
app/helpers/projects_helper.rb [deleted file]
app/models/group.rb [moved from app/models/project.rb with 86% similarity]
config/routes.rb
db/migrate/20130313175417_rename_projects_to_groups.rb [new file with mode: 0644]
db/schema.rb
test/fixtures/groups.yml [moved from test/fixtures/projects.yml with 100% similarity]
test/functional/groups_controller_test.rb [moved from test/functional/projects_controller_test.rb with 57% similarity]
test/unit/group_test.rb [moved from test/unit/project_test.rb with 63% similarity]
test/unit/helpers/groups_helper_test.rb [new file with mode: 0644]
test/unit/helpers/projects_helper_test.rb [deleted file]

similarity index 63%
rename from app/assets/stylesheets/projects.css.scss
rename to app/assets/stylesheets/groups.css.scss
index 7b9c6ec3962bc303dc9c113449782bc7cf3c05ed..679563657b554e17f8d3332641df4e06bcd4ce6c 100644 (file)
@@ -1,3 +1,3 @@
-// Place all the styles related to the Projects controller here.
+// Place all the styles related to the Groups controller here.
 // They will automatically be included in application.css.
 // You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/controllers/orvos/v1/groups_controller.rb b/app/controllers/orvos/v1/groups_controller.rb
new file mode 100644 (file)
index 0000000..019318a
--- /dev/null
@@ -0,0 +1,2 @@
+class Orvos::V1::GroupsController < ApplicationController
+end
diff --git a/app/controllers/orvos/v1/projects_controller.rb b/app/controllers/orvos/v1/projects_controller.rb
deleted file mode 100644 (file)
index 98497d1..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-class Orvos::V1::ProjectsController < ApplicationController
-end
diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb
new file mode 100644 (file)
index 0000000..c091b2f
--- /dev/null
@@ -0,0 +1,2 @@
+module GroupsHelper
+end
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
deleted file mode 100644 (file)
index db5c5ce..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-module ProjectsHelper
-end
similarity index 86%
rename from app/models/project.rb
rename to app/models/group.rb
index 1fdaca8585fc55003cb6c2e3cfa92a012765f27f..f57cf0d58d8deba2562d0cbdd39068f98e3e81f4 100644 (file)
@@ -1,4 +1,4 @@
-class Project < OrvosModel
+class Group < OrvosModel
   include AssignUuid
   include KindAndEtag
   include CommonApiTemplate
index b41af15f530d897b7804ad53a3a6c65edb033639..2b254aceb8f4b35680de8e27d155ac91af8fa050 100644 (file)
@@ -4,7 +4,7 @@ Server::Application.routes.draw do
   resources :api_client_authorizations
   resources :api_clients
   resources :logs
-  resources :projects
+  resources :groups
   resources :specimens
   resources :collections
   resources :links
@@ -81,7 +81,7 @@ Server::Application.routes.draw do
       resources :pipelines
       resources :pipeline_invocations
       resources :specimens
-      resources :projects
+      resources :groups
       resources :logs
       resources :users
       resources :jobs
diff --git a/db/migrate/20130313175417_rename_projects_to_groups.rb b/db/migrate/20130313175417_rename_projects_to_groups.rb
new file mode 100644 (file)
index 0000000..868dfe7
--- /dev/null
@@ -0,0 +1,21 @@
+class RenameProjectsToGroups < ActiveRecord::Migration
+  def up
+    rename_table :projects, :groups
+    rename_index :groups, :index_projects_on_created_at, :index_groups_on_created_at
+    rename_index :groups, :index_projects_on_modified_at, :index_groups_on_modified_at
+    rename_index :groups, :index_projects_on_uuid, :index_groups_on_uuid
+    Link.update_all({head_kind:'orvos#group'}, ['head_kind=?','orvos#project'])
+    Link.update_all({tail_kind:'orvos#group'}, ['tail_kind=?','orvos#project'])
+    Log.update_all({object_kind:'orvos#group'}, ['object_kind=?','orvos#project'])
+  end
+
+  def down
+    Log.update_all({object_kind:'orvos#project'}, ['object_kind=?','orvos#group'])
+    Link.update_all({tail_kind:'orvos#project'}, ['tail_kind=?','orvos#group'])
+    Link.update_all({head_kind:'orvos#project'}, ['head_kind=?','orvos#group'])
+    rename_index :groups, :index_groups_on_created_at, :index_projects_on_created_at
+    rename_index :groups, :index_groups_on_modified_at, :index_projects_on_modified_at
+    rename_index :groups, :index_groups_on_uuid, :index_projects_on_uuid
+    rename_table :groups, :projects
+  end
+end
index 70307e1e3c63cd50eced9eb61f2cf55993afee64..715c793ad81c0b954cfaed95171799ffed23b401 100644 (file)
@@ -11,7 +11,7 @@
 #
 # It's strongly recommended to check this file into your version control system.
 
-ActiveRecord::Schema.define(:version => 20130218181504) do
+ActiveRecord::Schema.define(:version => 20130313175417) do
 
   create_table "api_client_authorizations", :force => true do |t|
     t.string   "api_token",               :null => false
@@ -68,6 +68,22 @@ ActiveRecord::Schema.define(:version => 20130218181504) do
   add_index "collections", ["modified_at"], :name => "index_collections_on_modified_at"
   add_index "collections", ["uuid"], :name => "index_collections_on_uuid", :unique => true
 
+  create_table "groups", :force => true do |t|
+    t.string   "uuid"
+    t.string   "owner"
+    t.datetime "created_at"
+    t.string   "modified_by_client"
+    t.string   "modified_by_user"
+    t.datetime "modified_at"
+    t.string   "name"
+    t.text     "description"
+    t.datetime "updated_at"
+  end
+
+  add_index "groups", ["created_at"], :name => "index_groups_on_created_at"
+  add_index "groups", ["modified_at"], :name => "index_groups_on_modified_at"
+  add_index "groups", ["uuid"], :name => "index_groups_on_uuid", :unique => true
+
   create_table "job_steps", :force => true do |t|
     t.string   "uuid"
     t.string   "owner"
@@ -132,8 +148,6 @@ ActiveRecord::Schema.define(:version => 20130218181504) do
     t.datetime "modified_at"
     t.string   "tail_uuid"
     t.string   "tail_kind"
-    t.integer  "native_target_id"
-    t.string   "native_target_type"
     t.string   "link_class"
     t.string   "name"
     t.string   "head_uuid"
@@ -234,22 +248,6 @@ ActiveRecord::Schema.define(:version => 20130218181504) do
   add_index "pipelines", ["modified_at"], :name => "index_pipelines_on_modified_at"
   add_index "pipelines", ["uuid"], :name => "index_pipelines_on_uuid", :unique => true
 
-  create_table "projects", :force => true do |t|
-    t.string   "uuid"
-    t.string   "owner"
-    t.datetime "created_at"
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
-    t.datetime "modified_at"
-    t.string   "name"
-    t.text     "description"
-    t.datetime "updated_at"
-  end
-
-  add_index "projects", ["created_at"], :name => "index_projects_on_created_at"
-  add_index "projects", ["modified_at"], :name => "index_projects_on_modified_at"
-  add_index "projects", ["uuid"], :name => "index_projects_on_uuid", :unique => true
-
   create_table "specimens", :force => true do |t|
     t.string   "uuid"
     t.string   "owner"
similarity index 57%
rename from test/functional/projects_controller_test.rb
rename to test/functional/groups_controller_test.rb
index c0981663a6c0bb35d577c462d4ff88529241e1e2..ab75c4e7d5c6603de82a1765bb2ab9f937648af4 100644 (file)
@@ -1,6 +1,6 @@
 require 'test_helper'
 
-class ProjectsControllerTest < ActionController::TestCase
+class GroupsControllerTest < ActionController::TestCase
   # test "the truth" do
   #   assert true
   # end
similarity index 63%
rename from test/unit/project_test.rb
rename to test/unit/group_test.rb
index 0821e1fa6a084b34f25229d2cdd5e42ae4b82274..778eb0c58112da09ed327f989964963b1fbde577 100644 (file)
@@ -1,6 +1,6 @@
 require 'test_helper'
 
-class ProjectTest < ActiveSupport::TestCase
+class GroupTest < ActiveSupport::TestCase
   # test "the truth" do
   #   assert true
   # end
diff --git a/test/unit/helpers/groups_helper_test.rb b/test/unit/helpers/groups_helper_test.rb
new file mode 100644 (file)
index 0000000..cd06333
--- /dev/null
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class GroupsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/projects_helper_test.rb b/test/unit/helpers/projects_helper_test.rb
deleted file mode 100644 (file)
index a591e4e..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-require 'test_helper'
-
-class ProjectsHelperTest < ActionView::TestCase
-end