add Human resource
authorTom Clegg <tom@clinicalfuture.com>
Thu, 27 Jun 2013 18:52:43 +0000 (14:52 -0400)
committerTom Clegg <tom@clinicalfuture.com>
Thu, 27 Jun 2013 18:52:43 +0000 (14:52 -0400)
24 files changed:
apps/workbench/app/assets/javascripts/humans.js.coffee [new file with mode: 0644]
apps/workbench/app/assets/stylesheets/humans.css.scss [new file with mode: 0644]
apps/workbench/app/controllers/humans_controller.rb [new file with mode: 0644]
apps/workbench/app/helpers/humans_helper.rb [new file with mode: 0644]
apps/workbench/app/models/human.rb [new file with mode: 0644]
apps/workbench/config/initializers/inflections.rb
apps/workbench/config/routes.rb
apps/workbench/test/fixtures/humans.yml [new file with mode: 0644]
apps/workbench/test/functional/humans_controller_test.rb [new file with mode: 0644]
apps/workbench/test/unit/helpers/humans_helper_test.rb [new file with mode: 0644]
apps/workbench/test/unit/human_test.rb [new file with mode: 0644]
services/api/app/assets/javascripts/humans.js.coffee [new file with mode: 0644]
services/api/app/assets/stylesheets/humans.css.scss [new file with mode: 0644]
services/api/app/controllers/arvados/v1/humans_controller.rb [new file with mode: 0644]
services/api/app/helpers/humans_helper.rb [new file with mode: 0644]
services/api/app/models/human.rb [new file with mode: 0644]
services/api/config/initializers/inflections.rb
services/api/config/routes.rb
services/api/db/migrate/20130627184333_create_humans.rb [new file with mode: 0644]
services/api/db/schema.rb
services/api/test/fixtures/humans.yml [new file with mode: 0644]
services/api/test/functional/humans_controller_test.rb [new file with mode: 0644]
services/api/test/unit/helpers/humans_helper_test.rb [new file with mode: 0644]
services/api/test/unit/human_test.rb [new file with mode: 0644]

diff --git a/apps/workbench/app/assets/javascripts/humans.js.coffee b/apps/workbench/app/assets/javascripts/humans.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/apps/workbench/app/assets/stylesheets/humans.css.scss b/apps/workbench/app/assets/stylesheets/humans.css.scss
new file mode 100644 (file)
index 0000000..f8afcdf
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the Humans controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/apps/workbench/app/controllers/humans_controller.rb b/apps/workbench/app/controllers/humans_controller.rb
new file mode 100644 (file)
index 0000000..e141655
--- /dev/null
@@ -0,0 +1,2 @@
+class HumansController < ApplicationController
+end
diff --git a/apps/workbench/app/helpers/humans_helper.rb b/apps/workbench/app/helpers/humans_helper.rb
new file mode 100644 (file)
index 0000000..ca84af0
--- /dev/null
@@ -0,0 +1,2 @@
+module HumansHelper
+end
diff --git a/apps/workbench/app/models/human.rb b/apps/workbench/app/models/human.rb
new file mode 100644 (file)
index 0000000..31653bd
--- /dev/null
@@ -0,0 +1,2 @@
+class Human < ArvadosBase
+end
index 15be67b59c5a58babd548db2e0b486534e38f25b..8f744968fc6c9e9a558dba6f7962af265239c78d 100644 (file)
@@ -15,6 +15,8 @@
 # end
 
 ActiveSupport::Inflector.inflections do |inflect|
-  inflect.plural /^(specimen)$/i, '\1s'
-  inflect.singular /^(specimen)s/i, '\1'
+  inflect.plural /^([Ss]pecimen)$/i, '\1s'
+  inflect.singular /^([Ss]pecimen)s?/i, '\1'
+  inflect.plural /^([Hh]uman)$/i, '\1s'
+  inflect.singular /^([Hh]uman)s?/i, '\1'
 end
index 87e44728e96ccf303930c40beea73f6b9402b0da..f3cd099e7a56bdf6d37844646cb2a0aaa7e012ef 100644 (file)
@@ -1,4 +1,7 @@
 ArvadosWorkbench::Application.routes.draw do
+  resources :humans
+
+
   resources :traits
 
 
diff --git a/apps/workbench/test/fixtures/humans.yml b/apps/workbench/test/fixtures/humans.yml
new file mode 100644 (file)
index 0000000..c63aac0
--- /dev/null
@@ -0,0 +1,11 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+# This model initially had no columns defined.  If you add columns to the
+# model remove the '{}' from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+#  column: value
diff --git a/apps/workbench/test/functional/humans_controller_test.rb b/apps/workbench/test/functional/humans_controller_test.rb
new file mode 100644 (file)
index 0000000..ae2b79d
--- /dev/null
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class HumansControllerTest < ActionController::TestCase
+  # test "the truth" do
+  #   assert true
+  # end
+end
diff --git a/apps/workbench/test/unit/helpers/humans_helper_test.rb b/apps/workbench/test/unit/helpers/humans_helper_test.rb
new file mode 100644 (file)
index 0000000..8c515d6
--- /dev/null
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class HumansHelperTest < ActionView::TestCase
+end
diff --git a/apps/workbench/test/unit/human_test.rb b/apps/workbench/test/unit/human_test.rb
new file mode 100644 (file)
index 0000000..2863cbf
--- /dev/null
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class HumanTest < ActiveSupport::TestCase
+  # test "the truth" do
+  #   assert true
+  # end
+end
diff --git a/services/api/app/assets/javascripts/humans.js.coffee b/services/api/app/assets/javascripts/humans.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/services/api/app/assets/stylesheets/humans.css.scss b/services/api/app/assets/stylesheets/humans.css.scss
new file mode 100644 (file)
index 0000000..f8afcdf
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the Humans controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/services/api/app/controllers/arvados/v1/humans_controller.rb b/services/api/app/controllers/arvados/v1/humans_controller.rb
new file mode 100644 (file)
index 0000000..61cfe69
--- /dev/null
@@ -0,0 +1,2 @@
+class Arvados::V1::HumansController < ApplicationController
+end
diff --git a/services/api/app/helpers/humans_helper.rb b/services/api/app/helpers/humans_helper.rb
new file mode 100644 (file)
index 0000000..ca84af0
--- /dev/null
@@ -0,0 +1,2 @@
+module HumansHelper
+end
diff --git a/services/api/app/models/human.rb b/services/api/app/models/human.rb
new file mode 100644 (file)
index 0000000..f031915
--- /dev/null
@@ -0,0 +1,10 @@
+class Human < ArvadosModel
+  include AssignUuid
+  include KindAndEtag
+  include CommonApiTemplate
+  serialize :properties, Hash
+
+  api_accessible :superuser, :extend => :common do |t|
+    t.add :properties
+  end
+end
index 719262b36a0df6f44e024b7d3a621960cb00cf4a..79bca3af389506f6bf63ee594b76399e6164514a 100644 (file)
@@ -12,4 +12,6 @@
 ActiveSupport::Inflector.inflections do |inflect|
   inflect.plural /^([Ss]pecimen)$/i, '\1s'
   inflect.singular /^([Ss]pecimen)s?/i, '\1'
+  inflect.plural /^([Hh]uman)$/i, '\1s'
+  inflect.singular /^([Hh]uman)s?/i, '\1'
 end
index f50ae5a69b38ae5e0524c6c1e926e6908248386d..faeb00b3896753ef77d4fc1c8bc00838d21b5558 100644 (file)
@@ -1,4 +1,5 @@
 Server::Application.routes.draw do
+  resources :humans
   resources :traits
   resources :repositories
   resources :virtual_machines
@@ -106,6 +107,7 @@ Server::Application.routes.draw do
       resources :virtual_machines
       resources :repositories
       resources :traits
+      resources :humans
     end
   end
 
diff --git a/services/api/db/migrate/20130627184333_create_humans.rb b/services/api/db/migrate/20130627184333_create_humans.rb
new file mode 100644 (file)
index 0000000..5051658
--- /dev/null
@@ -0,0 +1,15 @@
+class CreateHumans < ActiveRecord::Migration
+  def change
+    create_table :humans do |t|
+      t.string :uuid, :null => false
+      t.string :owner, :null => false
+      t.string :modified_by_client
+      t.string :modified_by_user
+      t.datetime :modified_at
+      t.text :properties
+
+      t.timestamps
+    end
+    add_index :humans, :uuid, :unique => true
+  end
+end
index 11d1ec806757739dcb030c1f21634d12c022fc43..34d176357955043216a8306b9641ee3e5cc344b5 100644 (file)
@@ -11,7 +11,7 @@
 #
 # It's strongly recommended to check this file into your version control system.
 
-ActiveRecord::Schema.define(:version => 20130627154537) do
+ActiveRecord::Schema.define(:version => 20130627184333) do
 
   create_table "api_client_authorizations", :force => true do |t|
     t.string   "api_token",               :null => false
@@ -125,6 +125,19 @@ ActiveRecord::Schema.define(:version => 20130627154537) do
   add_index "groups", ["modified_at"], :name => "index_groups_on_modified_at"
   add_index "groups", ["uuid"], :name => "index_groups_on_uuid", :unique => true
 
+  create_table "humans", :force => true do |t|
+    t.string   "uuid",               :null => false
+    t.string   "owner",              :null => false
+    t.string   "modified_by_client"
+    t.string   "modified_by_user"
+    t.datetime "modified_at"
+    t.text     "properties"
+    t.datetime "created_at"
+    t.datetime "updated_at"
+  end
+
+  add_index "humans", ["uuid"], :name => "index_humans_on_uuid", :unique => true
+
   create_table "job_tasks", :force => true do |t|
     t.string   "uuid"
     t.string   "owner"
diff --git a/services/api/test/fixtures/humans.yml b/services/api/test/fixtures/humans.yml
new file mode 100644 (file)
index 0000000..e93e9a5
--- /dev/null
@@ -0,0 +1,17 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+one:
+  uuid: MyString
+  owner: MyString
+  modified_by_client: MyString
+  modified_by_user: MyString
+  modified_at: 2013-06-27 14:43:33
+  properties: MyText
+
+two:
+  uuid: MyString
+  owner: MyString
+  modified_by_client: MyString
+  modified_by_user: MyString
+  modified_at: 2013-06-27 14:43:33
+  properties: MyText
diff --git a/services/api/test/functional/humans_controller_test.rb b/services/api/test/functional/humans_controller_test.rb
new file mode 100644 (file)
index 0000000..ae2b79d
--- /dev/null
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class HumansControllerTest < ActionController::TestCase
+  # test "the truth" do
+  #   assert true
+  # end
+end
diff --git a/services/api/test/unit/helpers/humans_helper_test.rb b/services/api/test/unit/helpers/humans_helper_test.rb
new file mode 100644 (file)
index 0000000..8c515d6
--- /dev/null
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class HumansHelperTest < ActionView::TestCase
+end
diff --git a/services/api/test/unit/human_test.rb b/services/api/test/unit/human_test.rb
new file mode 100644 (file)
index 0000000..2863cbf
--- /dev/null
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class HumanTest < ActiveSupport::TestCase
+  # test "the truth" do
+  #   assert true
+  # end
+end