Permalink
Please sign in to comment.
Showing
with
133 additions
and 87 deletions.
- +12 −12 rails/sshb/Gemfile.lock
- +2 −0 rails/sshb/app/assets/javascripts/dashboard.js
- +2 −0 rails/sshb/app/assets/javascripts/users.js
- +3 −0 rails/sshb/app/assets/stylesheets/dashboard.scss
- +1 −0 rails/sshb/app/controllers/articles_controller.rb
- +2 −0 rails/sshb/app/controllers/dashboard_controller.rb
- +0 −4 rails/sshb/app/controllers/users/registrations_controller.rb
- +8 −0 rails/sshb/app/controllers/users_controller.rb
- +2 −0 rails/sshb/app/helpers/dashboard_helper.rb
- +2 −0 rails/sshb/app/helpers/users_helper.rb
- +4 −1 rails/sshb/app/models/board.rb
- +0 −5 rails/sshb/app/models/boards_owner.rb
- +4 −0 rails/sshb/app/models/ownership.rb
- +4 −2 rails/sshb/app/models/user.rb
- 0 rails/sshb/app/views/dashboard/index.html.erb
- +3 −20 rails/sshb/app/views/{home → layouts}/_header.html.erb
- +1 −1 rails/sshb/app/views/layouts/application.html.erb
- +1 −4 rails/sshb/app/views/users/registrations/show.html.erb
- 0 rails/sshb/app/views/users/show.html.erb
- +13 −1 rails/sshb/config/environments/development.rb
- +1 −0 rails/sshb/config/initializers/devise.rb
- +9 −5 rails/sshb/config/routes.rb
- +0 −10 rails/sshb/db/migrate/20160107011130_create_boards_owners.rb
- +9 −0 rails/sshb/db/migrate/20160118141512_create_ownerships.rb
- +8 −9 rails/sshb/db/schema.rb
- +16 −6 rails/sshb/db/seeds.rb
- +7 −0 rails/sshb/test/controllers/dashboard_controller_test.rb
- +7 −0 rails/sshb/test/controllers/users_controller_test.rb
- +0 −6 rails/sshb/test/fixtures/boards_owners.yml
- +11 −0 rails/sshb/test/fixtures/ownerships.yml
- +1 −1 rails/sshb/test/models/{boards_owner_test.rb → ownership_test.rb}
24
rails/sshb/Gemfile.lock
2
rails/sshb/app/assets/javascripts/dashboard.js
| @@ -0,0 +1,2 @@ | ||
| +// Place all the behaviors and hooks related to the matching controller here. | ||
| +// All this logic will automatically be available in application.js. |
2
rails/sshb/app/assets/javascripts/users.js
| @@ -0,0 +1,2 @@ | ||
| +// Place all the behaviors and hooks related to the matching controller here. | ||
| +// All this logic will automatically be available in application.js. |
3
rails/sshb/app/assets/stylesheets/dashboard.scss
| @@ -0,0 +1,3 @@ | ||
| +// Place all the styles related to the dashboard controller here. | ||
| +// They will automatically be included in application.css. | ||
| +// You can use Sass (SCSS) here: http://sass-lang.com/ |
1
rails/sshb/app/controllers/articles_controller.rb
2
rails/sshb/app/controllers/dashboard_controller.rb
| @@ -0,0 +1,2 @@ | ||
| +class DashboardController < ApplicationController | ||
| +end |
4
rails/sshb/app/controllers/users/registrations_controller.rb
8
rails/sshb/app/controllers/users_controller.rb
| @@ -0,0 +1,8 @@ | ||
| +class UsersController < ApplicationController | ||
| + | ||
| + before_action :authenticate_user! | ||
| + | ||
| + def show | ||
| + @user = current_user | ||
| + end | ||
| +end |
2
rails/sshb/app/helpers/dashboard_helper.rb
| @@ -0,0 +1,2 @@ | ||
| +module DashboardHelper | ||
| +end |
2
rails/sshb/app/helpers/users_helper.rb
| @@ -0,0 +1,2 @@ | ||
| +module UsersHelper | ||
| +end |
5
rails/sshb/app/models/board.rb
5
rails/sshb/app/models/boards_owner.rb
| @@ -1,5 +0,0 @@ | ||
| -class BoardsOwner < ActiveRecord::Base | ||
| - belongs_to :board | ||
| - belongs_to :user | ||
| - belongs_to :role | ||
| -end |
4
rails/sshb/app/models/ownership.rb
| @@ -0,0 +1,4 @@ | ||
| +class Ownership < ActiveRecord::Base | ||
| + belongs_to :user | ||
| + belongs_to :ownerable, polymorphic: true | ||
| +end |
6
rails/sshb/app/models/user.rb
0
rails/sshb/app/views/dashboard/index.html.erb
No changes.
23
rails/sshb/app/views/home/_header.html.erb → ...s/sshb/app/views/layouts/_header.html.erb
2
rails/sshb/app/views/layouts/application.html.erb
5
rails/sshb/app/views/users/registrations/show.html.erb
0
rails/sshb/app/views/users/show.html.erb
No changes.
14
rails/sshb/config/environments/development.rb
1
rails/sshb/config/initializers/devise.rb
14
rails/sshb/config/routes.rb
10
rails/sshb/db/migrate/20160107011130_create_boards_owners.rb
| @@ -1,10 +0,0 @@ | ||
| -class CreateBoardsOwners < ActiveRecord::Migration | ||
| - def change | ||
| - create_table :boards_owners do |t| | ||
| - t.belongs_to :board, index: true | ||
| - t.belongs_to :role, index: true | ||
| - t.belongs_to :user, index: true | ||
| - t.timestamps null: false | ||
| - end | ||
| - end | ||
| -end |
9
rails/sshb/db/migrate/20160118141512_create_ownerships.rb
| @@ -0,0 +1,9 @@ | ||
| +class CreateOwnerships < ActiveRecord::Migration | ||
| + def change | ||
| + create_table :ownerships do |t| | ||
| + t.references :user, index: true, foreign_key: true | ||
| + t.references :ownerable, polymorphic: true, index: true | ||
| + t.timestamps null: false | ||
| + end | ||
| + end | ||
| +end |
17
rails/sshb/db/schema.rb
22
rails/sshb/db/seeds.rb
7
rails/sshb/test/controllers/dashboard_controller_test.rb
| @@ -0,0 +1,7 @@ | ||
| +require 'test_helper' | ||
| + | ||
| +class DashboardControllerTest < ActionController::TestCase | ||
| + # test "the truth" do | ||
| + # assert true | ||
| + # end | ||
| +end |
7
rails/sshb/test/controllers/users_controller_test.rb
| @@ -0,0 +1,7 @@ | ||
| +require 'test_helper' | ||
| + | ||
| +class UsersControllerTest < ActionController::TestCase | ||
| + # test "the truth" do | ||
| + # assert true | ||
| + # end | ||
| +end |
6
rails/sshb/test/fixtures/boards_owners.yml
| @@ -1,6 +0,0 @@ | ||
| -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html | ||
| - | ||
| -one: | ||
| - board_id: 1 | ||
| - user_id: 1 | ||
| - role_id: 4 |
11
rails/sshb/test/fixtures/ownerships.yml
| @@ -0,0 +1,11 @@ | ||
| +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html | ||
| + | ||
| +one: | ||
| + user_id: | ||
| + ownerable_id: | ||
| + ownerable_type: Ownerable | ||
| + | ||
| +two: | ||
| + user_id: | ||
| + ownerable_id: | ||
| + ownerable_type: Ownerable |
2
rails/sshb/test/models/boards_owner_test.rb → rails/sshb/test/models/ownership_test.rb
0 comments on commit
f3630c4