add Project resource
authorTom Clegg <tom@clinicalfuture.com>
Wed, 16 Jan 2013 21:57:24 +0000 (13:57 -0800)
committerTom Clegg <tom@clinicalfuture.com>
Wed, 16 Jan 2013 21:57:24 +0000 (13:57 -0800)
12 files changed:
app/assets/javascripts/projects.js.coffee [new file with mode: 0644]
app/assets/stylesheets/projects.css.scss [new file with mode: 0644]
app/controllers/orvos/v1/projects_controller.rb [new file with mode: 0644]
app/helpers/projects_helper.rb [new file with mode: 0644]
app/models/project.rb [new file with mode: 0644]
config/routes.rb
db/migrate/20130116215213_create_projects.rb [new file with mode: 0644]
db/schema.rb
test/fixtures/projects.yml [new file with mode: 0644]
test/functional/projects_controller_test.rb [new file with mode: 0644]
test/unit/helpers/projects_helper_test.rb [new file with mode: 0644]
test/unit/project_test.rb [new file with mode: 0644]

diff --git a/app/assets/javascripts/projects.js.coffee b/app/assets/javascripts/projects.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/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss
new file mode 100644 (file)
index 0000000..7b9c6ec
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the Projects 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/projects_controller.rb b/app/controllers/orvos/v1/projects_controller.rb
new file mode 100644 (file)
index 0000000..98497d1
--- /dev/null
@@ -0,0 +1,2 @@
+class Orvos::V1::ProjectsController < ApplicationController
+end
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
new file mode 100644 (file)
index 0000000..db5c5ce
--- /dev/null
@@ -0,0 +1,2 @@
+module ProjectsHelper
+end
diff --git a/app/models/project.rb b/app/models/project.rb
new file mode 100644 (file)
index 0000000..5bc7957
--- /dev/null
@@ -0,0 +1,2 @@
+class Project < ActiveRecord::Base
+end
index bbfbe862f85bed51359c5d267d61928a90daf1f8..af8f5e1ee40499c55a8955230d0804e0373e0efd 100644 (file)
@@ -1,4 +1,6 @@
 Server::Application.routes.draw do
+  resources :projects
+
   resources :specimens
   resources :collections
   resources :metadata
diff --git a/db/migrate/20130116215213_create_projects.rb b/db/migrate/20130116215213_create_projects.rb
new file mode 100644 (file)
index 0000000..5ae59e1
--- /dev/null
@@ -0,0 +1,21 @@
+class CreateProjects < ActiveRecord::Migration
+  def up
+    create_table :projects do |t|
+      t.string :uuid
+      t.string :created_by_client
+      t.string :created_by_user
+      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.timestamps
+    end
+    add_index :projects, :uuid, :unique => true
+  end
+  def down
+    drop_table :projects
+  end
+end
index 9d2c4297fe6b8da3a8f50306d31a29303f65c169..cece25ae32e55dcfc48694a1f51396acc0f6e783 100644 (file)
@@ -11,7 +11,7 @@
 #
 # It's strongly recommended to check this file into your version control system.
 
-ActiveRecord::Schema.define(:version => 20130116024233) do
+ActiveRecord::Schema.define(:version => 20130116215213) do
 
   create_table "collections", :force => true do |t|
     t.string   "locator"
@@ -109,6 +109,21 @@ ActiveRecord::Schema.define(:version => 20130116024233) do
 
   add_index "pipelines", ["uuid"], :name => "index_pipelines_on_uuid", :unique => true
 
+  create_table "projects", :force => true do |t|
+    t.string   "uuid"
+    t.string   "created_by_client"
+    t.string   "created_by_user"
+    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", ["uuid"], :name => "index_projects_on_uuid", :unique => true
+
   create_table "specimens", :force => true do |t|
     t.string   "uuid"
     t.string   "created_by_client"
diff --git a/test/fixtures/projects.yml b/test/fixtures/projects.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/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb
new file mode 100644 (file)
index 0000000..c098166
--- /dev/null
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class ProjectsControllerTest < ActionController::TestCase
+  # test "the truth" do
+  #   assert true
+  # end
+end
diff --git a/test/unit/helpers/projects_helper_test.rb b/test/unit/helpers/projects_helper_test.rb
new file mode 100644 (file)
index 0000000..a591e4e
--- /dev/null
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class ProjectsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb
new file mode 100644 (file)
index 0000000..0821e1f
--- /dev/null
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class ProjectTest < ActiveSupport::TestCase
+  # test "the truth" do
+  #   assert true
+  # end
+end