Created
August 29, 2012 14:48
-
-
Save karledurante/3513710 to your computer and use it in GitHub Desktop.
has_and_belongs_to_many SecondBase issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Student < SecondBase::Base | |
has_and_belongs_to_many :courses | |
end | |
class Course < SecondBase::Base | |
has_and_belongs_to_many :students | |
end | |
student = Student.first | |
course = Course.first | |
# This generate an insert statement (into student_courses_students) using | |
# ActiveRecord::Base.connection, and not SecondBase::Base.connection | |
student.courses << course |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment