raw1z / amistad

Adds friendships management into a rails application
http://github.com/raw1z/amistad
MIT License
185 stars 71 forks source link

Wrong number of arguments (3 for 2) #52

Open Javed43 opened 9 years ago

Javed43 commented 9 years ago

I have installed amistad and after the installation when I'm unable to start the server as it giving an error.

/home/mohd.hussain/.rvm/gems/ruby-1.9.3-p484@partyapp/gems/activerecord-3.2.14/lib/active_record/associations.rb:1197:in has_many': wrong number of arguments (3 for 2) (ArgumentError) from /home/mohd.hussain/.rvm/gems/ruby-1.9.3-p484@partyapp/gems/amistad-0.10.2/lib/amistad/active_record_friend_model.rb:14:inblock in module:ActiveRecordFriendModel' from /h

I'm using ruby - 1.9.3 and rails 3.2.14

What am I doing wrong

nguyen-brian commented 8 years ago

I believe this is an incompatibility between Rails 3.2 and this has_many statement:

has_many  :pending_invited, -> { where(:'friendships.pending' => true, :'friendships.blocker_id' => nil) }, :through => :friendships, :source => :friend

This problem can be avoided by downgrading to version 0.9.2.