17 Oct '15, 2pm

ruby: Railsで複数テーブルのjoins/includesとwhere検索 | EasyRamble

class Country < ActiveRecord::Base has_many :prefectures end class Prefecture < ActiveRecord::Base belongs_to :country has_many :cities end class City < ActiveRecord::Base belongs_to :prefecture has_many :towns end class Town < ActiveRecord::Base belongs_to :city end

Full article: http://easyramble.com/rails-multi-tables-joins-includes-w...

Tweets