Displaying 1 result from an estimated 1 matches for "max_friends_allow".
Did you mean:
max_friends_allowed
2009 May 04
1
Syncronization in rails
...e is the logic that I am trying to achieve. I have a User Model and
the business rule is that user can accept maximum 5 friends requests.
for this I have an accept method in User Model which looks similar to
below code snippet
def accept(friend)
raise ArgumentError if self.friends.count >= MAX_FRIENDS_ALLOWED
...
...
#code to add friend to friends list
end
As you can see that I basically query for count of friends for a user
and if the count is greater then or equal to MAX_FRIENDS_ALLOWED the
friend accept request should not go through.
From the UI perspective I have a link_to_remote, &qu...