I'm using mongo_mapper 0.7.5 and rails 2.3.8, and I have an instance method that works in my console, but not in the controller of my actual app. I have no idea why this is.
#controller
if @friendship.save
user1.add_friend(user2)
...
#model
...
key :friends_count, Integer, :default => 0
key :followers_count, Integer, :default => 0
def add_friend(user)
...
self.increment(:friends_count => 1)
user.increment(:followers_count => 1)
true
end
And this works in the console, but in the controller it does not change the follower count, only the friends count. What gives? The only thing I can even think of is that the way that I'm passing the user in is the problem, but I'm not sure how to fix it.