tags.pluck(:name) end end # pluck Λ͍ͬͯΔͨΊɺeager loading ͕ޮ͔ͳ͍ user = User.includes(:tags).first #=> User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]] #=> Tag Load (0.1ms) SELECT "tags".* FROM "tags" WHERE "tags"."user_id" = ? [["user_id", 1]] user.tag_names #=> Tag Pluck (0.0ms) SELECT "name" FROM "tags" WHERE "tags"."user_id" = ? [["user_id", 1]] 20