Commit e78974a8bd3efc6203d4a7de297f9cd71194ce76

Authored by Larissa Reis
1 parent bfaf133d

Fixes indentation and typo

app/controllers/my_profile/followers_controller.rb
@@ -24,7 +24,7 @@ class FollowersController < MyProfileController @@ -24,7 +24,7 @@ class FollowersController < MyProfileController
24 def update_category 24 def update_category
25 followed_profile = Profile.find_by(:id => params["followed_profile_id"]) 25 followed_profile = Profile.find_by(:id => params["followed_profile_id"])
26 26
27 - selected_circles = params[:circles].map{|circle_name, circle_id| Circle.find_by(:id => circle_id)}.select{|c|not c.nil?} 27 + selected_circles = params[:circles].map{ |circle_name, circle_id| Circle.find_by(:id => circle_id) }.select{ |c| c.present? }
28 28
29 if followed_profile 29 if followed_profile
30 current_person.update_profile_circles(followed_profile, selected_circles) 30 current_person.update_profile_circles(followed_profile, selected_circles)
app/controllers/public/profile_controller.rb
@@ -163,7 +163,7 @@ class ProfileController < PublicController @@ -163,7 +163,7 @@ class ProfileController < PublicController
163 def follow 163 def follow
164 if request.post? 164 if request.post?
165 if profile.followed_by?(current_person) 165 if profile.followed_by?(current_person)
166 - render :text => _("You are already following %s.") % profile.name, :status => 400 166 + render :text => _("You are already following %s.") % profile.name, :status => 400
167 else 167 else
168 selected_circles = params[:circles].map{|circle_name, circle_id| Circle.find_by(:id => circle_id)}.select{|c|not c.nil?} 168 selected_circles = params[:circles].map{|circle_name, circle_id| Circle.find_by(:id => circle_id)}.select{|c|not c.nil?}
169 if selected_circles.present? 169 if selected_circles.present?
@@ -179,8 +179,8 @@ class ProfileController < PublicController @@ -179,8 +179,8 @@ class ProfileController < PublicController
179 end 179 end
180 180
181 def find_profile_circles 181 def find_profile_circles
182 - circles = Circle.where(:person => current_person, :profile_type => profile.class.name)  
183 - render :partial => 'blocks/profile_info_actions/circles', :locals => { :circles => circles, :profile_types => Circle.profile_types.to_a } 182 + circles = Circle.where(:person => current_person, :profile_type => profile.class.name)
  183 + render :partial => 'blocks/profile_info_actions/circles', :locals => { :circles => circles, :profile_types => Circle.profile_types.to_a }
184 end 184 end
185 185
186 def unfollow 186 def unfollow
app/models/person.rb
@@ -200,14 +200,14 @@ class Person < Profile @@ -200,14 +200,14 @@ class Person < Profile
200 end 200 end
201 end 201 end
202 202
203 - def follow (profile, circles) 203 + def follow(profile, circles)
204 circles = [circles] unless circles.is_a?(Array) 204 circles = [circles] unless circles.is_a?(Array)
205 circles.each do |new_circle| 205 circles.each do |new_circle|
206 ProfileFollower.create(profile: profile, circle: new_circle) 206 ProfileFollower.create(profile: profile, circle: new_circle)
207 end 207 end
208 end 208 end
209 209
210 - def update_profile_circles (profile, new_circles) 210 + def update_profile_circles(profile, new_circles)
211 profile_circles = ProfileFollower.with_profile(profile).with_follower(self).map(&:circle) 211 profile_circles = ProfileFollower.with_profile(profile).with_follower(self).map(&:circle)
212 circles_to_add = new_circles - profile_circles 212 circles_to_add = new_circles - profile_circles
213 circles_to_remove = profile_circles - new_circles 213 circles_to_remove = profile_circles - new_circles
app/views/followers/index.html.erb
1 <div id="manage_followed people"> 1 <div id="manage_followed people">
2 2
3 -<h1><%= _("%s following") % profile.name %></h1> 3 +<h1><%= _("%s is following") % profile.name %></h1>
4 4
5 <% cache_timeout(profile.manage_friends_cache_key(params), 4.hours) do %> 5 <% cache_timeout(profile.manage_friends_cache_key(params), 4.hours) do %>
6 <% if @followed_people.empty? %> 6 <% if @followed_people.empty? %>