Rails 5.0.0.1,ActiveRecord包括select和HASU MUN THORT

Rails 5.0.0.1,ActiveRecord包括select和HASU MUN THORT,activerecord,ruby-on-rails-5,Activerecord,Ruby On Rails 5,我正在使用以下代码行生成我的表: def index @documentation_languages = Documentation::Language .includes(:tags) .select(:id, :abbreviation, :name, :version) .order(:slug) end 他们会叫: SELECT "documentation_languages"."id", "documentation_languages"."abbre

我正在使用以下代码行生成我的表:

def index
  @documentation_languages = Documentation::Language
    .includes(:tags)
    .select(:id, :abbreviation, :name, :version)
    .order(:slug)
end
他们会叫:

SELECT "documentation_languages"."id", "documentation_languages"."abbreviation", "documentation_languages"."name", "documentation_languages"."version" FROM "documentation_languages" ORDER BY "documentation_languages"."slug" ASC
SELECT "documentation_language_tags".* FROM "documentation_language_tags" WHERE "documentation_language_tags"."language_id" IN (2, 3, 1, 4, 5, 6, 7, 8, 9, 10, 11, 13, 12, 14, 15, 16, 17)
SELECT "documentation_tags".* FROM "documentation_tags" WHERE "documentation_tags"."id" = 1

我正在使用
has\u many:tags,through::language\u tags
内部
文档::language
模型。是否有任何方法可以从包含的
标记表中选择
文档标记.name

我使用
范围
参数has\u many
将代码更改为:

has_many :tags, ->{ select(:name) }, through: :language_tags