]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/friendships_controller.rb
Modify the way Friends are added
[rails.git] / app / controllers / friendships_controller.rb
index ab54cbfd1b31f7dcd8fec56d4e23ec9c5c92908e..8de438fd21fda3d76c12851f8854ed35be345a3d 100644 (file)
@@ -18,9 +18,9 @@ class FriendshipsController < ApplicationController
       friendship.befriender = current_user
       friendship.befriendee = @friend
       if current_user.friends_with?(@friend)
-        flash[:warning] = t ".already_a_friend", :name => @friend.display_name
+        flash[:warning] = t ".already_followed", :name => @friend.display_name
       elsif current_user.friendships.where(:created_at => Time.now.utc - 1.hour..).count >= current_user.max_friends_per_hour
-        flash.now[:error] = t ".limit_exceeded"
+        flash[:error] = t ".limit_exceeded"
       elsif friendship.save
         flash[:notice] = t ".success", :name => @friend.display_name
         UserMailer.friendship_notification(friendship).deliver_later
@@ -40,7 +40,7 @@ class FriendshipsController < ApplicationController
         Friendship.where(:befriender => current_user, :befriendee => @friend).delete_all
         flash[:notice] = t ".success", :name => @friend.display_name
       else
-        flash[:error] = t ".not_a_friend", :name => @friend.display_name
+        flash[:error] = t ".not_followed", :name => @friend.display_name
       end
 
       referer = safe_referer(params[:referer]) if params[:referer]