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
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?