diff --git a/.rake_tasks~ b/.rake_tasks~ new file mode 100644 index 0000000..9bae174 --- /dev/null +++ b/.rake_tasks~ @@ -0,0 +1,39 @@ +about +assets:clean[keep] +assets:clobber +assets:environment +assets:precompile +cache_digests:dependencies +cache_digests:nested_dependencies +db:create +db:drop +db:fixtures:load +db:migrate +db:migrate:status +db:rollback +db:schema:cache:clear +db:schema:cache:dump +db:schema:dump +db:schema:load +db:seed +db:setup +db:structure:dump +db:structure:load +db:version +doc:app +log:clear +middleware +notes +notes:custom +rails:template +rails:update +routes +secret +stats +test +test:all +test:all:db +test:db +time:zones:all +tmp:clear +tmp:create diff --git a/app/models/comment.rb b/app/models/comment.rb new file mode 100644 index 0000000..a8c1dc4 --- /dev/null +++ b/app/models/comment.rb @@ -0,0 +1,3 @@ +class Comment < ActiveRecord::Base + belongs_to :mission +end diff --git a/app/models/mission.rb b/app/models/mission.rb new file mode 100644 index 0000000..c214e82 --- /dev/null +++ b/app/models/mission.rb @@ -0,0 +1,4 @@ +class Mission < ActiveRecord::Base + has_and_belongs_to_many :users + has_many :comments +end diff --git a/app/models/note.rb b/app/models/note.rb new file mode 100644 index 0000000..daccdaf --- /dev/null +++ b/app/models/note.rb @@ -0,0 +1,3 @@ +class Note < ActiveRecord::Base + belongs_to :user +end diff --git a/app/models/project.rb b/app/models/project.rb new file mode 100644 index 0000000..967bbbc --- /dev/null +++ b/app/models/project.rb @@ -0,0 +1,3 @@ +class Project < ActiveRecord::Base + has_and_belongs_to_many :users +end diff --git a/app/models/share.rb b/app/models/share.rb new file mode 100644 index 0000000..9fb2c82 --- /dev/null +++ b/app/models/share.rb @@ -0,0 +1,2 @@ +class Share < ActiveRecord::Base +end diff --git a/app/models/user.rb b/app/models/user.rb new file mode 100644 index 0000000..dd6c597 --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,6 @@ +class User < ActiveRecord::Base + has_and_belongs_to_many :projects + has_and_belongs_to_many :missions + + has_many :notes +end diff --git a/db/migrate/20161210043747_create_users.rb b/db/migrate/20161210043747_create_users.rb new file mode 100644 index 0000000..b59a0ef --- /dev/null +++ b/db/migrate/20161210043747_create_users.rb @@ -0,0 +1,11 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.string :name + t.string :password_digest + t.string :email + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20161210044025_create_projects.rb b/db/migrate/20161210044025_create_projects.rb new file mode 100644 index 0000000..2d0e2da --- /dev/null +++ b/db/migrate/20161210044025_create_projects.rb @@ -0,0 +1,10 @@ +class CreateProjects < ActiveRecord::Migration + def change + create_table :projects do |t| + t.string :name + t.string :content + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20161210044843_create_missions.rb b/db/migrate/20161210044843_create_missions.rb new file mode 100644 index 0000000..44205e6 --- /dev/null +++ b/db/migrate/20161210044843_create_missions.rb @@ -0,0 +1,12 @@ +class CreateMissions < ActiveRecord::Migration + def change + create_table :missions do |t| + t.string :name + t.datetime :deadline + t.integer :priority + t.string :status + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20161210045206_create_comments.rb b/db/migrate/20161210045206_create_comments.rb new file mode 100644 index 0000000..099e2c7 --- /dev/null +++ b/db/migrate/20161210045206_create_comments.rb @@ -0,0 +1,10 @@ +class CreateComments < ActiveRecord::Migration + def change + create_table :comments do |t| + t.string :content + t.references :mission, index: true, foreign_key: true + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20161210045652_create_shares.rb b/db/migrate/20161210045652_create_shares.rb new file mode 100644 index 0000000..e5a8b6e --- /dev/null +++ b/db/migrate/20161210045652_create_shares.rb @@ -0,0 +1,9 @@ +class CreateShares < ActiveRecord::Migration + def change + create_table :shares do |t| + t.string :content + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20161210045735_create_notes.rb b/db/migrate/20161210045735_create_notes.rb new file mode 100644 index 0000000..0604823 --- /dev/null +++ b/db/migrate/20161210045735_create_notes.rb @@ -0,0 +1,10 @@ +class CreateNotes < ActiveRecord::Migration + def change + create_table :notes do |t| + t.string :content + t.references :user, index: true, foreign_key: true + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20161210050040_drop_tables_not_named_conventional.rb b/db/migrate/20161210050040_drop_tables_not_named_conventional.rb new file mode 100644 index 0000000..c74784e --- /dev/null +++ b/db/migrate/20161210050040_drop_tables_not_named_conventional.rb @@ -0,0 +1,11 @@ +class DropTablesNotNamedConventional < ActiveRecord::Migration + def change + drop_table :coment + drop_table :mission + drop_table :mission_coment + drop_table :note + drop_table :project + drop_table :share + drop_table :user + end +end diff --git a/db/migrate/20161210055342_rename_mission_user_to_missions_users.rb b/db/migrate/20161210055342_rename_mission_user_to_missions_users.rb new file mode 100644 index 0000000..966a32f --- /dev/null +++ b/db/migrate/20161210055342_rename_mission_user_to_missions_users.rb @@ -0,0 +1,5 @@ +class RenameMissionUserToMissionsUsers < ActiveRecord::Migration + def change + rename_table :mission_user, :missions_users + end +end diff --git a/db/migrate/20161210055513_rename_project_user_to_projects_users.rb b/db/migrate/20161210055513_rename_project_user_to_projects_users.rb new file mode 100644 index 0000000..ca6b94c --- /dev/null +++ b/db/migrate/20161210055513_rename_project_user_to_projects_users.rb @@ -0,0 +1,5 @@ +class RenameProjectUserToProjectsUsers < ActiveRecord::Migration + def change + rename_table :project_user, :projects_users + end +end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000..af0a81a --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,74 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20161210055513) do + + create_table "comments", force: :cascade do |t| + t.string "content" + t.integer "mission_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "comments", ["mission_id"], name: "index_comments_on_mission_id" + + create_table "missions", force: :cascade do |t| + t.string "name" + t.datetime "deadline" + t.integer "priority" + t.string "status" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "missions_users", id: false, force: :cascade do |t| + t.integer "mission_id" + t.integer "user_id" + end + + create_table "notes", force: :cascade do |t| + t.string "content" + t.integer "user_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "notes", ["user_id"], name: "index_notes_on_user_id" + + create_table "projects", force: :cascade do |t| + t.string "name" + t.string "content" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "projects_users", id: false, force: :cascade do |t| + t.integer "project_id" + t.integer "user_id" + end + + create_table "shares", force: :cascade do |t| + t.string "content" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "users", force: :cascade do |t| + t.string "name" + t.string "password_digest" + t.string "email" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + +end diff --git a/test/fixtures/comments.yml b/test/fixtures/comments.yml new file mode 100644 index 0000000..1043d0a --- /dev/null +++ b/test/fixtures/comments.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + content: MyString + mission_id: + +two: + content: MyString + mission_id: diff --git a/test/fixtures/missions.yml b/test/fixtures/missions.yml new file mode 100644 index 0000000..7cd9e41 --- /dev/null +++ b/test/fixtures/missions.yml @@ -0,0 +1,13 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + deadline: 2016-12-10 12:48:43 + priority: 1 + status: MyString + +two: + name: MyString + deadline: 2016-12-10 12:48:43 + priority: 1 + status: MyString diff --git a/test/fixtures/notes.yml b/test/fixtures/notes.yml new file mode 100644 index 0000000..01638eb --- /dev/null +++ b/test/fixtures/notes.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + content: + user_id: + +two: + content: + user_id: diff --git a/test/fixtures/projects.yml b/test/fixtures/projects.yml new file mode 100644 index 0000000..2a0a458 --- /dev/null +++ b/test/fixtures/projects.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + content: MyString + +two: + name: MyString + content: MyString diff --git a/test/fixtures/shares.yml b/test/fixtures/shares.yml new file mode 100644 index 0000000..ab8d999 --- /dev/null +++ b/test/fixtures/shares.yml @@ -0,0 +1,7 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + content: MyString + +two: + content: MyString diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml new file mode 100644 index 0000000..b4f1bcc --- /dev/null +++ b/test/fixtures/users.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + password_digest: MyString + email: MyString + +two: + name: MyString + password_digest: MyString + email: MyString diff --git a/test/models/comment_test.rb b/test/models/comment_test.rb new file mode 100644 index 0000000..b6d6131 --- /dev/null +++ b/test/models/comment_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class CommentTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/mission_test.rb b/test/models/mission_test.rb new file mode 100644 index 0000000..d49e76e --- /dev/null +++ b/test/models/mission_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class MissionTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/note_test.rb b/test/models/note_test.rb new file mode 100644 index 0000000..7bbab53 --- /dev/null +++ b/test/models/note_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class NoteTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/project_test.rb b/test/models/project_test.rb new file mode 100644 index 0000000..0821e1f --- /dev/null +++ b/test/models/project_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ProjectTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/share_test.rb b/test/models/share_test.rb new file mode 100644 index 0000000..199d270 --- /dev/null +++ b/test/models/share_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ShareTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/user_test.rb b/test/models/user_test.rb new file mode 100644 index 0000000..82f61e0 --- /dev/null +++ b/test/models/user_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class UserTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end