Well I do see you’re missing a :through clause on Group:
class Group < ActiveRecord::Base
has_many :invitations
has_many :users, :through => :memberships
end
As for the @user.invitations
, hmm…
class User < ActiveRecord::Base
has_many :memberships
has_many :groups, :through => :memberships
has_many :invitations, :through => :groups (?)
end
You might be better off defining a method User#invitations and building the relationship programatically.
Jason