trackington 0.1.7.pre → 0.1.8.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/app/core.rb +11 -7
- data/lib/db/migrate/20160207202529_create_users.rb +7 -7
- data/lib/db/migrate/20160207203302_create_user_credentials.rb +11 -11
- data/lib/db/migrate/20160209100247_create_projects.rb +9 -9
- data/lib/db/migrate/20160209101604_create_project_roles.rb +10 -10
- data/lib/db/migrate/20160209153945_create_sprints.rb +11 -11
- data/lib/db/migrate/20160209154117_create_tasks.rb +18 -18
- data/lib/db/migrate/20160209165534_update_sprint_columns.rb +5 -5
- data/lib/db/migrate/20160209193650_update_tasks_references.rb +5 -5
- data/lib/db/migrate/20160209195016_update_tasks_column.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 79ddc3fe3dd6b662220a29b7626342bcc29d2a47
|
|
4
|
+
data.tar.gz: 75fcd788c565df5ce2286177e5c93db81502c8f9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: edb150b43fa8d002f4646722b663327448d7f64e42b83d5ce0393fda54b57509c008008f472b221093df5781ccee47c333ee024c5f1d061302c9659f70096a20
|
|
7
|
+
data.tar.gz: c6ec17d4442389a2e4d517f26bbca071bc07cf1f1878fffe34283dbe8060cb95484333beb2228a8cbd81bd7387d273c06d752e6dbc53c9b4f2c876b4eada167d
|
data/lib/app/core.rb
CHANGED
|
@@ -8,22 +8,26 @@ module Trackington
|
|
|
8
8
|
class Application
|
|
9
9
|
attr_reader :users, :projects
|
|
10
10
|
|
|
11
|
-
def initialize
|
|
11
|
+
def initialize(connection_config = nil)
|
|
12
12
|
@users = UserRepository.new
|
|
13
13
|
@projects = ProjectRepository.new
|
|
14
14
|
|
|
15
|
-
establish_connection
|
|
15
|
+
establish_connection(connection_config)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
private
|
|
19
19
|
|
|
20
|
-
def establish_connection
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
def establish_connection(config)
|
|
21
|
+
if config.nil?
|
|
22
|
+
config_path = File.expand_path('../../db/config.yml', __FILE__)
|
|
23
|
+
config = YAML.load(IO.read(config_path))
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
env = ENV['DB'] || 'development'
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
ActiveRecord::Base.establish_connection(config[env])
|
|
28
|
+
else
|
|
29
|
+
ActiveRecord::Base.establish_connection(config)
|
|
30
|
+
end
|
|
27
31
|
end
|
|
28
32
|
end
|
|
29
33
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
class CreateUsers < ActiveRecord::Migration
|
|
2
|
-
def change
|
|
3
|
-
create_table :users do |t|
|
|
4
|
-
t.string :email
|
|
5
|
-
end
|
|
6
|
-
end
|
|
7
|
-
end
|
|
1
|
+
class CreateUsers < ActiveRecord::Migration
|
|
2
|
+
def change
|
|
3
|
+
create_table :users do |t|
|
|
4
|
+
t.string :email
|
|
5
|
+
end
|
|
6
|
+
end
|
|
7
|
+
end
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
class CreateUserCredentials < ActiveRecord::Migration
|
|
2
|
-
def change
|
|
3
|
-
create_table :credentials do |t|
|
|
4
|
-
t.string :password
|
|
5
|
-
t.string :salt
|
|
6
|
-
t.string :session_key
|
|
7
|
-
|
|
8
|
-
t.belongs_to :user, index: true
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
end
|
|
1
|
+
class CreateUserCredentials < ActiveRecord::Migration
|
|
2
|
+
def change
|
|
3
|
+
create_table :credentials do |t|
|
|
4
|
+
t.string :password
|
|
5
|
+
t.string :salt
|
|
6
|
+
t.string :session_key
|
|
7
|
+
|
|
8
|
+
t.belongs_to :user, index: true
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
class CreateProjects < ActiveRecord::Migration
|
|
2
|
-
def change
|
|
3
|
-
create_table :projects do |t|
|
|
4
|
-
t.string :description
|
|
5
|
-
t.string :title
|
|
6
|
-
t.boolean :public, default: false
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
end
|
|
1
|
+
class CreateProjects < ActiveRecord::Migration
|
|
2
|
+
def change
|
|
3
|
+
create_table :projects do |t|
|
|
4
|
+
t.string :description
|
|
5
|
+
t.string :title
|
|
6
|
+
t.boolean :public, default: false
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
end
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
class CreateProjectRoles < ActiveRecord::Migration
|
|
2
|
-
def change
|
|
3
|
-
create_table :project_roles do |t|
|
|
4
|
-
t.integer :role_type, default: 0
|
|
5
|
-
|
|
6
|
-
t.belongs_to :user, index: true
|
|
7
|
-
t.belongs_to :project, index: true
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
end
|
|
1
|
+
class CreateProjectRoles < ActiveRecord::Migration
|
|
2
|
+
def change
|
|
3
|
+
create_table :project_roles do |t|
|
|
4
|
+
t.integer :role_type, default: 0
|
|
5
|
+
|
|
6
|
+
t.belongs_to :user, index: true
|
|
7
|
+
t.belongs_to :project, index: true
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
class CreateSprints < ActiveRecord::Migration
|
|
2
|
-
def change
|
|
3
|
-
create_table :sprints do |t|
|
|
4
|
-
t.date :start_time
|
|
5
|
-
t.date :end_time
|
|
6
|
-
t.boolean :is_backlog
|
|
7
|
-
|
|
8
|
-
t.belongs_to :project, index: true
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
end
|
|
1
|
+
class CreateSprints < ActiveRecord::Migration
|
|
2
|
+
def change
|
|
3
|
+
create_table :sprints do |t|
|
|
4
|
+
t.date :start_time
|
|
5
|
+
t.date :end_time
|
|
6
|
+
t.boolean :is_backlog
|
|
7
|
+
|
|
8
|
+
t.belongs_to :project, index: true
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
class CreateTasks < ActiveRecord::Migration
|
|
2
|
-
def change
|
|
3
|
-
create_table :tasks do |t|
|
|
4
|
-
t.string :title
|
|
5
|
-
t.string :description
|
|
6
|
-
|
|
7
|
-
t.integer :time_planned
|
|
8
|
-
t.integer :time_actual
|
|
9
|
-
|
|
10
|
-
t.integer :priority # Blocker, Critical, Major, Minor, Trivial
|
|
11
|
-
t.integer :type # Epic, Bug, Improvement, New Feature, Story, Task
|
|
12
|
-
t.integer :status
|
|
13
|
-
|
|
14
|
-
t.integer :assigned_to # should be belongs_to :user
|
|
15
|
-
t.integer :created_by # should be belongs_to :user
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
1
|
+
class CreateTasks < ActiveRecord::Migration
|
|
2
|
+
def change
|
|
3
|
+
create_table :tasks do |t|
|
|
4
|
+
t.string :title
|
|
5
|
+
t.string :description
|
|
6
|
+
|
|
7
|
+
t.integer :time_planned
|
|
8
|
+
t.integer :time_actual
|
|
9
|
+
|
|
10
|
+
t.integer :priority # Blocker, Critical, Major, Minor, Trivial
|
|
11
|
+
t.integer :type # Epic, Bug, Improvement, New Feature, Story, Task
|
|
12
|
+
t.integer :status
|
|
13
|
+
|
|
14
|
+
t.integer :assigned_to # should be belongs_to :user
|
|
15
|
+
t.integer :created_by # should be belongs_to :user
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
class UpdateSprintColumns < ActiveRecord::Migration
|
|
2
|
-
def change
|
|
3
|
-
add_column :sprints, :is_active, :boolean
|
|
4
|
-
end
|
|
5
|
-
end
|
|
1
|
+
class UpdateSprintColumns < ActiveRecord::Migration
|
|
2
|
+
def change
|
|
3
|
+
add_column :sprints, :is_active, :boolean
|
|
4
|
+
end
|
|
5
|
+
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
class UpdateTasksReferences < ActiveRecord::Migration
|
|
2
|
-
def change
|
|
3
|
-
add_reference :tasks, :sprint, index: true, foreign_key: true
|
|
4
|
-
end
|
|
5
|
-
end
|
|
1
|
+
class UpdateTasksReferences < ActiveRecord::Migration
|
|
2
|
+
def change
|
|
3
|
+
add_reference :tasks, :sprint, index: true, foreign_key: true
|
|
4
|
+
end
|
|
5
|
+
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
class UpdateTasksColumn < ActiveRecord::Migration
|
|
2
|
-
def change
|
|
3
|
-
rename_column :tasks, :type, :task_type
|
|
4
|
-
end
|
|
5
|
-
end
|
|
1
|
+
class UpdateTasksColumn < ActiveRecord::Migration
|
|
2
|
+
def change
|
|
3
|
+
rename_column :tasks, :type, :task_type
|
|
4
|
+
end
|
|
5
|
+
end
|