Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

inverse of in rails

class Project < ActiveRecord::Base
  has_many :tasks, :inverse_of=>:project
end

class Task < ActiveRecord::Base
  belongs_to :project, :inverse_of=>:tasks
end
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #inverse #rails
ADD COMMENT
Topic
Name
1+5 =