:main end ! class BargainBase < ActiveRecord::Base self.abstract_class = true use_switch_point :bargain end ! class User < MainBase; end class Recipe < MainBase; end ! class Bargain::Shop < BargainBase; end class Bargain::Leaflet < BargainBase; end
< ActiveRecord::Base belongs_to :a end irb(main):001:0> B.includes(:a).pluck(:id) (0.2ms) SELECT `bs`.`id` FROM `bs` LEFT OUTER JOIN `as` ON `as`.`id` = `bs`.`a_id`