I'm at my wit's end trying to handle these errors. Basically, I've created the following User and Relationship patterns, using Mongoid to handle my database. This seems like a near-carbon copy of the example at the bottom of the page here. I'm trying to call any of the following:
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
These all seem to just return the entire relationships array; they don't search through by criteria. The find() method also throws an error saying that it only can take 1 argument. The im_following? method always returns true.
I'm not sure if it's better to post code in-line or from gist, so here are the gists:
user.rb
user_follow_spec.rb
relationship.rb
I would appreciate any help.