MongoMapper, Rails, Increment Works in Console but not Controller
- by Michael Waxman
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…