I have a club model and a member model that are linked through a membership model. In other words
class Club < ActiveRecord::Base has_many :members, :through => :memberships end class Member < ActiveRecord::Base has_many :clubs, :through => :memberships end
However, when I try to create a new member and add him to the club, I get a message that the club is not valid.
> club = Club.find(1) > member = Member.new(:name => 'Member Name') > member.clubs << club > member.save
The member.save will return false. Looking at member.errors.messages, I find
> member.errors.messages @messages={:clubs=>["is invalid"]}
It is really strange that this does not happen for my development environment (using sqlite3), but only for my EngineYard deployment using mySQL.
source share