--- /dev/null
+# 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/
--- /dev/null
+// Place all the styles related to the Logs controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
--- /dev/null
+class Orvos::V1::LogsController < ApplicationController
+end
--- /dev/null
+module LogsHelper
+end
--- /dev/null
+class Log < ActiveRecord::Base
+ include AssignUuid
+ include KindAndEtag
+ include CommonApiTemplate
+ serialize :info, Hash
+
+ api_accessible :superuser, :extend => :common do |t|
+ t.add :object_kind
+ t.add :object_uuid
+ t.add :event_at
+ t.add :event_type
+ t.add :summary
+ t.add :info
+ end
+end
Server::Application.routes.draw do
+ resources :logs
+
resources :projects
resources :specimens
--- /dev/null
+class CreateLogs < ActiveRecord::Migration
+ def up
+ create_table :logs do |t|
+ t.string :uuid
+ t.string :created_by_client
+ t.string :created_by_user
+ t.string :modified_by_client
+ t.string :modified_by_user
+ t.string :object_kind
+ t.string :object_uuid
+ t.datetime :event_at
+ t.string :event_type
+ t.text :summary
+ t.text :info
+
+ t.timestamps
+ end
+ add_index :logs, :uuid, :unique => true
+ add_index :logs, :object_kind
+ add_index :logs, :object_uuid
+ add_index :logs, :event_type
+ add_index :logs, :event_at
+ add_index :logs, :summary
+ end
+
+ def down
+ drop_table :logs end
+end
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20130118002239) do
+ActiveRecord::Schema.define(:version => 20130122201442) do
create_table "collections", :force => true do |t|
t.string "locator"
add_index "collections", ["uuid"], :name => "index_collections_on_uuid", :unique => true
+ create_table "logs", :force => true do |t|
+ t.string "uuid"
+ t.string "created_by_client"
+ t.string "created_by_user"
+ t.string "modified_by_client"
+ t.string "modified_by_user"
+ t.string "object_kind"
+ t.string "object_uuid"
+ t.datetime "event_at"
+ t.string "event_type"
+ t.text "summary"
+ t.text "info"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "logs", ["event_at"], :name => "index_logs_on_event_at"
+ add_index "logs", ["event_type"], :name => "index_logs_on_event_type"
+ add_index "logs", ["object_kind"], :name => "index_logs_on_object_kind"
+ add_index "logs", ["object_uuid"], :name => "index_logs_on_object_uuid"
+ add_index "logs", ["summary"], :name => "index_logs_on_summary"
+ add_index "logs", ["uuid"], :name => "index_logs_on_uuid", :unique => true
+
create_table "metadata", :force => true do |t|
t.string "uuid"
t.string "created_by_client"
--- /dev/null
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+one:
+ uuid: MyString
+ created_by_client: MyString
+ created_by_user: MyString
+ modified_by_client: MyString
+ modified_by_user: MyString
+ object_kind: MyString
+ object_uuid: MyString
+ event_at: 2013-01-22 12:14:42
+ event_type: MyString
+ summary: MyText
+ info: MyText
+
+two:
+ uuid: MyString
+ created_by_client: MyString
+ created_by_user: MyString
+ modified_by_client: MyString
+ modified_by_user: MyString
+ object_kind: MyString
+ object_uuid: MyString
+ event_at: 2013-01-22 12:14:42
+ event_type: MyString
+ summary: MyText
+ info: MyText
--- /dev/null
+require 'test_helper'
+
+class LogsControllerTest < ActionController::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
--- /dev/null
+require 'test_helper'
+
+class LogsHelperTest < ActionView::TestCase
+end
--- /dev/null
+require 'test_helper'
+
+class LogTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end