Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sample_app
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Đường Sỹ Hoàng
sample_app
Commits
1292adb4
Commit
1292adb4
authored
Nov 22, 2019
by
Đường Sỹ Hoàng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed conflict
parent
1cf7b5ac
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
21 deletions
+2
-21
app/controllers/users_controller.rb
+0
-4
app/models/relationship.rb
+0
-1
app/models/user.rb
+2
-4
app/views/users/edit.html.erb
+0
-12
No files found.
app/controllers/users_controller.rb
View file @
1292adb4
...
...
@@ -9,11 +9,7 @@ class UsersController < ApplicationController
def
show
@user
=
User
.
find
(
params
[
:id
])
<<<<<<<
HEAD
redirect_to
root_url
and
return
unless
@user
.
activated
=======
redirect_to
root_url
and
return
unless
@user
.
activated
>>>>>>>
Removed
unuse
file
@microposts
=
@user
.
microposts
.
paginate
(
page:
params
[
:page
])
end
...
...
app/models/relationship.rb
View file @
1292adb4
...
...
@@ -4,5 +4,4 @@ class Relationship < ApplicationRecord
validates
:follower_id
,
presence:
true
validates
:followed_id
,
presence:
true
end
app/models/user.rb
View file @
1292adb4
...
...
@@ -89,10 +89,8 @@ class User < ApplicationRecord
# Defines a proto-feed.
# See "Following users" for the full implementation.
def
feed
following_ids
=
"SELECT followed_id FROM relationships
WHERE follower_id = :user_id"
Micropost
.
where
(
"user_id IN (
#{
following_ids
}
)
OR user_id = :user_id"
,
user_id:
id
)
following_ids
=
"SELECT followed_id FROM relationships WHERE follower_id = :user_id"
Micropost
.
where
(
"user_id IN (
#{
following_ids
}
) OR user_id = :user_id"
,
user_id:
id
)
end
# Follows a user.
...
...
app/views/users/edit.html.erb
View file @
1292adb4
...
...
@@ -5,22 +5,10 @@
<div
class=
"row"
>
<div
class=
"col-md-6 col-md-offset-3"
>
<
<<<<<<
HEAD
<<<<<<<
HEAD
<%=
render
"form"
%>
<div
class=
"gravatar_edit"
>
<%=
gravatar_for
@user
%>
<a
href=
"http://gravatar.com/emails"
>
change
</a>
=======
<%=
render
"form"
%>
=======
<%=
render
"form"
%>
>>>>>>> Fixed coding styles
<div
class=
"gravatar_edit"
>
<%=
gravatar_for
@user
%>
<a
href=
"http://gravatar.com/emails"
>
change
</a>
>>>>>>> Removed unuse file
</div>
</div>
</div>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment