You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Came across an interesting issue today, where approving friendships was failing, complaining that the number of arguments provided was incorrect.
It seems that amistad and devise invitable conflict by both adding the 'invited?' method to the model. Anyone have any good solutions for this, if I absolutely need both gems?
For now, some monkey-patching is letting me work around the issue, but given that I'm overriding 'approve', it's not exactly robust:
In an initialiser:
module Amistad
module ActiveRecordFriendModel
def approve(user)
friendship = find_any_friendship_with(user)
return false if friendship.nil? || friendship_invited?(user)
friendship.update_attribute(:pending, false)
end
alias_method :friendship_invited?, :invited?
end
end
Any suggestions on a better long term solution?
The text was updated successfully, but these errors were encountered:
Came across an interesting issue today, where approving friendships was failing, complaining that the number of arguments provided was incorrect.
It seems that amistad and devise invitable conflict by both adding the 'invited?' method to the model. Anyone have any good solutions for this, if I absolutely need both gems?
For now, some monkey-patching is letting me work around the issue, but given that I'm overriding 'approve', it's not exactly robust:
In an initialiser:
Any suggestions on a better long term solution?
The text was updated successfully, but these errors were encountered: