Commit 1292adb4 by Đường Sỹ Hoàng

Fixed conflict

parent 1cf7b5ac
......@@ -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
......@@ -26,7 +22,7 @@ class UsersController < ApplicationController
if @user.save
@user.send_activation_email
flash[:info] = "Please check your email to activate your account."
redirect_to root_url
redirect_to root_url
else
render "new"
end
......
......@@ -4,5 +4,4 @@ class Relationship < ApplicationRecord
validates :follower_id, presence: true
validates :followed_id, presence: true
end
......@@ -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.
......
......@@ -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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment