Skip to content
This repository has been archived by the owner on Aug 12, 2018. It is now read-only.

Commit

Permalink
setting up paper trail
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorSheremeta committed Mar 10, 2016
1 parent 122f679 commit 1250612
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
3 changes: 3 additions & 0 deletions backend/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ gem 'bcrypt'

gem 'jwt'

# for maintaining audits
gem 'paper_trail', '~> 4.0.2'

# for windows
gem 'tzinfo-data', platforms: [:x64_mingw,:mingw, :mswin]

Expand Down
13 changes: 13 additions & 0 deletions backend/db/migrate/20160310183317_create_versions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class CreateVersions < ActiveRecord::Migration
def change
create_table :versions do |t|
t.string :item_type, :null => false
t.integer :item_id, :null => false
t.string :event, :null => false
t.string :whodunnit
t.text :object
t.datetime :created_at
end
add_index :versions, [:item_type, :item_id]
end
end
18 changes: 17 additions & 1 deletion backend/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20160224070033) do
ActiveRecord::Schema.define(version: 20160310183317) do

create_table "admins", force: :cascade do |t|
t.datetime "created_at", null: false
Expand All @@ -22,6 +22,11 @@

add_index "admins", ["approved"], name: "index_admins_on_approved"

create_table "audit_trails", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "degrees", force: :cascade do |t|
t.integer "year", null: false
t.string "degree_type", null: false
Expand Down Expand Up @@ -96,4 +101,15 @@

add_index "users", ["approved"], name: "index_users_on_approved"

create_table "versions", force: :cascade do |t|
t.string "item_type", null: false
t.integer "item_id", null: false
t.string "event", null: false
t.string "whodunnit"
t.text "object"
t.datetime "created_at"
end

add_index "versions", ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"

end

0 comments on commit 1250612

Please sign in to comment.