Skip to content

Instantly share code, notes, and snippets.

@karledurante
Created August 29, 2012 14:48
Show Gist options
  • Save karledurante/3513710 to your computer and use it in GitHub Desktop.
Save karledurante/3513710 to your computer and use it in GitHub Desktop.
has_and_belongs_to_many SecondBase issue
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