diff --git a/app/models/onclick_time.rb b/app/models/onclick_time.rb new file mode 100644 index 000000000..16b17ea9a --- /dev/null +++ b/app/models/onclick_time.rb @@ -0,0 +1,3 @@ +class OnclickTime < ActiveRecord::Base + attr_accessible :onclick_time, :user_id +end diff --git a/db/migrate/20150906065702_create_onclick_times.rb b/db/migrate/20150906065702_create_onclick_times.rb new file mode 100644 index 000000000..3922b775e --- /dev/null +++ b/db/migrate/20150906065702_create_onclick_times.rb @@ -0,0 +1,10 @@ +class CreateOnclickTimes < ActiveRecord::Migration + def change + create_table :onclick_times do |t| + t.integer :user_id + t.datetime :onclick_time + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 5bf838c25..5867a62e5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150906025009) do +ActiveRecord::Schema.define(:version => 20150906065702) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -497,23 +497,26 @@ ActiveRecord::Schema.define(:version => 20150906025009) do add_index "documents", ["created_on"], :name => "index_documents_on_created_on" add_index "documents", ["project_id"], :name => "documents_project_id" - create_table "dts", :force => true do |t| - t.string "IPLineCode" - t.string "Description" - t.string "Num" - t.string "Variable" - t.string "TraceInfo" - t.string "Method" + create_table "dts", :primary_key => "Num", :force => true do |t| + t.string "Defect", :limit => 50 + t.string "Category", :limit => 50 t.string "File" - t.string "IPLine" - t.string "Review" - t.string "Category" - t.string "Defect" - t.string "PreConditions" - t.string "StartLine" + t.string "Method" + t.string "Module", :limit => 20 + t.string "Variable", :limit => 50 + t.integer "StartLine" + t.integer "IPLine" + t.string "IPLineCode", :limit => 200 + t.string "Judge", :limit => 15 + t.integer "Review", :limit => 1 + t.string "Description" + t.text "PreConditions", :limit => 2147483647 + t.text "TraceInfo", :limit => 2147483647 + t.text "Code", :limit => 2147483647 t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.integer "id", :null => false end create_table "enabled_modules", :force => true do |t| @@ -936,6 +939,13 @@ ActiveRecord::Schema.define(:version => 20150906025009) do t.datetime "updated_at", :null => false end + create_table "onclick_times", :force => true do |t| + t.integer "user_id" + t.datetime "onclick_time" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "open_id_authentication_associations", :force => true do |t| t.integer "issued" t.integer "lifetime" diff --git a/spec/factories/onclick_times.rb b/spec/factories/onclick_times.rb new file mode 100644 index 000000000..fcdda983d --- /dev/null +++ b/spec/factories/onclick_times.rb @@ -0,0 +1,7 @@ +FactoryGirl.define do + factory :onclick_time do + user_id 1 +onclick_time "2015-09-06 14:57:02" + end + +end diff --git a/spec/models/onclick_time_spec.rb b/spec/models/onclick_time_spec.rb new file mode 100644 index 000000000..bc453f545 --- /dev/null +++ b/spec/models/onclick_time_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe OnclickTime, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end