-
Notifications
You must be signed in to change notification settings - Fork 239
事業をエンジニアリングしよう ②実装 #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Mikiko9882
wants to merge
12
commits into
yusukedayo:develop
Choose a base branch
from
Mikiko9882:mokumoku1
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
01940f9
Update README.md
kenchasonakai 3164f1d
Update README.md
kenchasonakai 597f7ac
Update README.md
kenchasonakai f534e8c
add: nodeのバージョンを指定するようにした
kenchasonakai cc18636
Merge branch 'develop' of github.com:runteq/mokumoku into develop
kenchasonakai a9ecb8a
READMEを変更
Mikiko9882 939d415
趣味登録
Mikiko9882 68995e7
テストが通るようにした
Mikiko9882 4a5c7ca
プロフィールに飛べる
Mikiko9882 3113fb6
フォローできるようにした
Mikiko9882 9eaa95e
spec戻した
Mikiko9882 d5781cc
不要なファイル
Mikiko9882 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,3 +40,6 @@ yarn-debug.log* | |
| .yarn-integrity | ||
|
|
||
| /config/credentials/production.key | ||
|
|
||
| .DS_Store | ||
| vendor/bundle/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 16.16.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| class RelationshipsController < ApplicationController | ||
| def create | ||
| current_user.follow(params[:user_id]) | ||
| redirect_to request.referer | ||
| end | ||
|
|
||
| # フォロー外すとき | ||
| def destroy | ||
| current_user.unfollow(params[:user_id]) | ||
| redirect_to request.referer | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| class RelationshipDecorator < Draper::Decorator | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 使っていないファイルは削除しましょう。 |
||
| delegate_all | ||
|
|
||
| # Define presentation-specific methods here. Helpers are accessed through | ||
| # `helpers` (aka `h`). You can override attributes, for example: | ||
| # | ||
| # def created_at | ||
| # helpers.content_tag :span, class: 'time' do | ||
| # object.created_at.strftime("%a %m/%d/%y") | ||
| # end | ||
| # end | ||
|
|
||
| end | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| class Relationship < ApplicationRecord | ||
| belongs_to :follower, class_name: "User" | ||
| belongs_to :followed, class_name: "User" | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| <h1><%= @user.name %> のプロフィール</h1> | ||
|
|
||
| <p><strong>Hobby:</strong> <%= @user.hobby %></p> | ||
| <p><strong>Profile:</strong> <%= @user.profile %></p> | ||
|
|
||
| <% if current_user.following?(@user) %> | ||
| <%= link_to "フォローを外す", user_relationships_path(@user.id), method: :delete %> | ||
| <% else %> | ||
| <%= link_to "フォローする", user_relationships_path(@user.id), method: :post %> | ||
| <% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| class AddProfileAndHobbyToUsers < ActiveRecord::Migration[6.1] | ||
| def change | ||
| add_column :users, :profile, :string | ||
| add_column :users, :hobby, :string | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| class CreateRelationships < ActiveRecord::Migration[6.1] | ||
| def change | ||
| create_table :relationships do |t| | ||
| t.integer :follower_id | ||
| t.integer :followed_id | ||
|
|
||
| t.timestamps | ||
| end | ||
| end | ||
| end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| require 'rails_helper' | ||
|
|
||
| RSpec.describe RelationshipDecorator do | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| FactoryBot.define do | ||
| factory :relationship do | ||
| follower_id { 1 } | ||
| followed_id { 1 } | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| require 'rails_helper' | ||
|
|
||
| RSpec.describe Relationship, type: :model do | ||
| pending "add some examples to (or delete) #{__FILE__}" | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| require 'rails_helper' | ||
|
|
||
| RSpec.describe "Relationships", type: :request do | ||
| describe "GET /index" do | ||
| pending "add some examples (or delete) #{__FILE__}" | ||
| end | ||
| end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
共通化してbefore_actionしたほうが良さそうです。