私はこれらのエラーを処理しようとして頭がいっぱいです。基本的に、Mongoid を使用してデータベースを処理し、次のユーザー パターンと関係パターンを作成しました。これは、こちらのページの下部にある例のほぼカーボン コピーのようです。私は次のいずれかを呼び出そうとしています:
user1.relationships.find(:all, :conditions => {:rel_user => user_in_question, :rel_type => "following" })
user1.relationships.all(:conditions => {:rel_user => user_in_question, :rel_type => "following" })
user1.relationships.where(:rel_type => "following")
user1.relationships.following #with a named scope
これらはすべて、関係配列全体を返すように見えます。基準で検索しません。find() メソッドも、引数を 1 つしかとれないというエラーをスローします。im_following? メソッドは常に true を返します。
コードをインラインで投稿するのが良いのか、Gist から投稿するのが良いのかわからないので、要点は次のとおりです。
user.rb
user_follow_spec.rb
relationship.rb
助けていただければ幸いです。