Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

rails has_many through source 1

class Pet < ActiveRecord::Base
  has_many :dogs
end

class Dog < ActiveRecord::Base
  belongs_to :pet
  has_many :breeds
end

class Dog::Breed < ActiveRecord::Base
  belongs_to :dog
end
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #rails #source
ADD COMMENT
Topic
Name
6+8 =