You can override the scope to automatically add a table name prefix
class Parent < ActiveRecord::Base
class << self; alias_method :old_group, :group; end
scope :group, lambda { |g|
old_group("#{table_name}.#{g}")
}
end
Parent.join(:child).group(:name)
user1454117
source
share