From e78974a8bd3efc6203d4a7de297f9cd71194ce76 Mon Sep 17 00:00:00 2001 From: Larissa Reis Date: Mon, 18 Jul 2016 13:28:57 -0300 Subject: [PATCH] Fixes indentation and typo --- app/controllers/my_profile/followers_controller.rb | 2 +- app/controllers/public/profile_controller.rb | 6 +++--- app/models/person.rb | 4 ++-- app/views/followers/index.html.erb | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/my_profile/followers_controller.rb b/app/controllers/my_profile/followers_controller.rb index 86b6113..f2d663d 100644 --- a/app/controllers/my_profile/followers_controller.rb +++ b/app/controllers/my_profile/followers_controller.rb @@ -24,7 +24,7 @@ class FollowersController < MyProfileController def update_category followed_profile = Profile.find_by(:id => params["followed_profile_id"]) - selected_circles = params[:circles].map{|circle_name, circle_id| Circle.find_by(:id => circle_id)}.select{|c|not c.nil?} + selected_circles = params[:circles].map{ |circle_name, circle_id| Circle.find_by(:id => circle_id) }.select{ |c| c.present? } if followed_profile current_person.update_profile_circles(followed_profile, selected_circles) diff --git a/app/controllers/public/profile_controller.rb b/app/controllers/public/profile_controller.rb index d1fc0c4..c7237fa 100644 --- a/app/controllers/public/profile_controller.rb +++ b/app/controllers/public/profile_controller.rb @@ -163,7 +163,7 @@ class ProfileController < PublicController def follow if request.post? if profile.followed_by?(current_person) - render :text => _("You are already following %s.") % profile.name, :status => 400 + render :text => _("You are already following %s.") % profile.name, :status => 400 else selected_circles = params[:circles].map{|circle_name, circle_id| Circle.find_by(:id => circle_id)}.select{|c|not c.nil?} if selected_circles.present? @@ -179,8 +179,8 @@ class ProfileController < PublicController end def find_profile_circles - circles = Circle.where(:person => current_person, :profile_type => profile.class.name) - render :partial => 'blocks/profile_info_actions/circles', :locals => { :circles => circles, :profile_types => Circle.profile_types.to_a } + circles = Circle.where(:person => current_person, :profile_type => profile.class.name) + render :partial => 'blocks/profile_info_actions/circles', :locals => { :circles => circles, :profile_types => Circle.profile_types.to_a } end def unfollow diff --git a/app/models/person.rb b/app/models/person.rb index 8f67ac7..828b536 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -200,14 +200,14 @@ class Person < Profile end end - def follow (profile, circles) + def follow(profile, circles) circles = [circles] unless circles.is_a?(Array) circles.each do |new_circle| ProfileFollower.create(profile: profile, circle: new_circle) end end - def update_profile_circles (profile, new_circles) + def update_profile_circles(profile, new_circles) profile_circles = ProfileFollower.with_profile(profile).with_follower(self).map(&:circle) circles_to_add = new_circles - profile_circles circles_to_remove = profile_circles - new_circles diff --git a/app/views/followers/index.html.erb b/app/views/followers/index.html.erb index d2a5561..0efd862 100644 --- a/app/views/followers/index.html.erb +++ b/app/views/followers/index.html.erb @@ -1,6 +1,6 @@
-

<%= _("%s following") % profile.name %>

+

<%= _("%s is following") % profile.name %>

<% cache_timeout(profile.manage_friends_cache_key(params), 4.hours) do %> <% if @followed_people.empty? %> -- libgit2 0.21.2